diff --git a/Assets/Scenes/TreeWorld_02.unity b/Assets/Scenes/TreeWorld_02.unity index a858cd6fd353dd287a3c078e7e7793f997ecbf49..d33b4cd8291c2bdd78002700d4db7fd10757a4e5 100644 --- a/Assets/Scenes/TreeWorld_02.unity +++ b/Assets/Scenes/TreeWorld_02.unity @@ -44230,7 +44230,7 @@ PrefabInstance: - target: {fileID: 8372521933355871045, guid: c1d50ceff6c06de40b71063574eba754, type: 3} propertyPath: m_AnchoredPosition.x - value: -0.000030517578 + value: -0.000091552734 objectReference: {fileID: 0} - target: {fileID: 8372521933459236753, guid: c1d50ceff6c06de40b71063574eba754, type: 3} diff --git a/Assets/Scripts/InteractionEngine/ImageHintAnimation.cs b/Assets/Scripts/InteractionEngine/ImageHintAnimation.cs index 1c4cb8247968b44461700e6cf25db8797db39d55..5ec730c4a04770cbb1ea6116d81fd4ad41cf00d2 100644 --- a/Assets/Scripts/InteractionEngine/ImageHintAnimation.cs +++ b/Assets/Scripts/InteractionEngine/ImageHintAnimation.cs @@ -20,9 +20,7 @@ void Start() if (imageToChange != null) imageToChangeDefaultColor = imageToChange.color; - animationStartColor = globalSettings.hintAnimationStartColor; - animationEndColor = globalSettings.hintAnimationEndColor; - animateDuration = globalSettings.hintAnimationDuration; + updateAnimationParameters(); } // Update is called once per frame @@ -38,7 +36,10 @@ void Update() public void AnimationTrigger() { if (imageToChange != null) + { + updateAnimationParameters(); animating = true; + } } private void Animate() @@ -55,4 +56,10 @@ private void Animate() } } + + private void updateAnimationParameters() { + animationStartColor = globalSettings.hintAnimationStartColor; + animationEndColor = globalSettings.hintAnimationEndColor; + animateDuration = globalSettings.hintAnimationDuration; + } } diff --git a/Assets/Scripts/InteractionEngine/MeshRendererHintAnimation.cs b/Assets/Scripts/InteractionEngine/MeshRendererHintAnimation.cs index e28d56ec803ccf069a8502119a1fc0a8a77e16f7..2b7753f4f14ee11832af839a648df3afe39e9f11 100644 --- a/Assets/Scripts/InteractionEngine/MeshRendererHintAnimation.cs +++ b/Assets/Scripts/InteractionEngine/MeshRendererHintAnimation.cs @@ -19,9 +19,7 @@ void Start() if (meshRendererToChange != null) meshRendererToChangeDefaultColor = meshRendererToChange.material.color; - animationStartColor = globalSettings.hintAnimationStartColor; - animationEndColor = globalSettings.hintAnimationEndColor; - animateDuration = globalSettings.hintAnimationDuration; + updateAnimationParameters(); } // Update is called once per frame @@ -35,7 +33,10 @@ void Update() public void AnimationTrigger() { if (meshRendererToChange != null) + { + updateAnimationParameters(); animating = true; + } } private void Animate() { @@ -48,6 +49,12 @@ private void Animate() { else { meshRendererToChange.material.color = Color.Lerp(animationStartColor, animationEndColor, Mathf.PingPong(Time.time, 1)); } + } + private void updateAnimationParameters() + { + animationStartColor = globalSettings.hintAnimationStartColor; + animationEndColor = globalSettings.hintAnimationEndColor; + animateDuration = globalSettings.hintAnimationDuration; } }