Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Boo Ghost Script
- // name
- using UnityEngine;
- class BooGhostScript : MonoBehaviour
- {
- // Start is called before the first frame update
- protected void Start()
- {
- {
- Private SpriteRenderer memberSpriteRenderer = null;
- }
- // Update is called once per frame
- void Update()
- {
- // Create a color variable.
- Color localColor;
- localColor = Color.black;
- // Get the sprite color.
- localColor = memberSpritRenderer.color;
- // Change a color.
- localColor.r = 1.0f; // 0.0 is no red, 1.0 is max red.
- localColor.g = 0.5f; // 0.0 is no green, 1.0 is max green.
- localColor.b = 0.0f; // 0.0 is no blue, 1.0 is max blue.
- localColor.a = 0.5f; // 0.0 is completely invisible, 1.0f is completely visible.
- // You have to change the sprite renderer color
- // to actually change the color.
- memberSpriteRenderer.color = localColor;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement