From cd7cad320eb49e2dad64ce2198260b44ec1a145b Mon Sep 17 00:00:00 2001 From: Kelvin Sung Date: Sun, 23 Jun 2024 13:41:26 -0700 Subject: [PATCH] Changed from Access to the shader via Renderer to Changing SpriteRenderer --- .../Assets/Scripts/Hero/GreenArrowBehavior.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classnotes/Module-2/2.1.ObjectNavigation/Assets/Scripts/Hero/GreenArrowBehavior.cs b/Classnotes/Module-2/2.1.ObjectNavigation/Assets/Scripts/Hero/GreenArrowBehavior.cs index e8a36f1..12d4eba 100644 --- a/Classnotes/Module-2/2.1.ObjectNavigation/Assets/Scripts/Hero/GreenArrowBehavior.cs +++ b/Classnotes/Module-2/2.1.ObjectNavigation/Assets/Scripts/Hero/GreenArrowBehavior.cs @@ -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().material.color = mMouseColor; + GetComponent().color = mMouseColor; } // Update is called once per frame @@ -28,9 +28,9 @@ void Update() mFollowMousePosition = !mFollowMousePosition; Debug.Log("Current control mode Mouse=" + mFollowMousePosition); if (mFollowMousePosition) - GetComponent().material.color = mMouseColor; + GetComponent().color = mMouseColor; else - GetComponent().material.color = Color.white; + GetComponent().color = Color.white; } if (mFollowMousePosition)