Skip to content

Commit

Permalink
Changed from Access to the shader via Renderer to Changing SpriteRend…
Browse files Browse the repository at this point in the history
…erer
  • Loading branch information
kelvinhsung committed Jun 23, 2024
1 parent cf712ba commit cd7cad3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class GreenArrowBehavior : MonoBehaviour
void Start()
{
Debug.Assert(mTheCamera != null); // must be set in the editor before starting the game!
GetComponent<Renderer>().material.color = mMouseColor;
GetComponent<SpriteRenderer>().color = mMouseColor;
}

// Update is called once per frame
Expand All @@ -28,9 +28,9 @@ void Update()
mFollowMousePosition = !mFollowMousePosition;
Debug.Log("Current control mode Mouse=" + mFollowMousePosition);
if (mFollowMousePosition)
GetComponent<Renderer>().material.color = mMouseColor;
GetComponent<SpriteRenderer>().color = mMouseColor;
else
GetComponent<Renderer>().material.color = Color.white;
GetComponent<SpriteRenderer>().color = Color.white;
}

if (mFollowMousePosition)
Expand Down

0 comments on commit cd7cad3

Please sign in to comment.