Skip to content
Snippets Groups Projects
Commit 07a083d5 authored by John Schihada's avatar John Schihada
Browse files

Fix: For applying changes to globalSettings-file while playing

parent b237895c
No related branches found
No related tags found
No related merge requests found
...@@ -44230,7 +44230,7 @@ PrefabInstance: ...@@ -44230,7 +44230,7 @@ PrefabInstance:
- target: {fileID: 8372521933355871045, guid: c1d50ceff6c06de40b71063574eba754, - target: {fileID: 8372521933355871045, guid: c1d50ceff6c06de40b71063574eba754,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: -0.000030517578 value: -0.000091552734
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8372521933459236753, guid: c1d50ceff6c06de40b71063574eba754, - target: {fileID: 8372521933459236753, guid: c1d50ceff6c06de40b71063574eba754,
type: 3} type: 3}
...@@ -20,9 +20,7 @@ void Start() ...@@ -20,9 +20,7 @@ void Start()
if (imageToChange != null) if (imageToChange != null)
imageToChangeDefaultColor = imageToChange.color; imageToChangeDefaultColor = imageToChange.color;
animationStartColor = globalSettings.hintAnimationStartColor; updateAnimationParameters();
animationEndColor = globalSettings.hintAnimationEndColor;
animateDuration = globalSettings.hintAnimationDuration;
} }
// Update is called once per frame // Update is called once per frame
...@@ -38,7 +36,10 @@ void Update() ...@@ -38,7 +36,10 @@ void Update()
public void AnimationTrigger() public void AnimationTrigger()
{ {
if (imageToChange != null) if (imageToChange != null)
{
updateAnimationParameters();
animating = true; animating = true;
}
} }
private void Animate() private void Animate()
...@@ -55,4 +56,10 @@ private void Animate() ...@@ -55,4 +56,10 @@ private void Animate()
} }
} }
private void updateAnimationParameters() {
animationStartColor = globalSettings.hintAnimationStartColor;
animationEndColor = globalSettings.hintAnimationEndColor;
animateDuration = globalSettings.hintAnimationDuration;
}
} }
...@@ -19,9 +19,7 @@ void Start() ...@@ -19,9 +19,7 @@ void Start()
if (meshRendererToChange != null) if (meshRendererToChange != null)
meshRendererToChangeDefaultColor = meshRendererToChange.material.color; meshRendererToChangeDefaultColor = meshRendererToChange.material.color;
animationStartColor = globalSettings.hintAnimationStartColor; updateAnimationParameters();
animationEndColor = globalSettings.hintAnimationEndColor;
animateDuration = globalSettings.hintAnimationDuration;
} }
// Update is called once per frame // Update is called once per frame
...@@ -35,7 +33,10 @@ void Update() ...@@ -35,7 +33,10 @@ void Update()
public void AnimationTrigger() { public void AnimationTrigger() {
if (meshRendererToChange != null) if (meshRendererToChange != null)
{
updateAnimationParameters();
animating = true; animating = true;
}
} }
private void Animate() { private void Animate() {
...@@ -48,6 +49,12 @@ private void Animate() { ...@@ -48,6 +49,12 @@ private void Animate() {
else { else {
meshRendererToChange.material.color = Color.Lerp(animationStartColor, animationEndColor, Mathf.PingPong(Time.time, 1)); meshRendererToChange.material.color = Color.Lerp(animationStartColor, animationEndColor, Mathf.PingPong(Time.time, 1));
} }
}
private void updateAnimationParameters()
{
animationStartColor = globalSettings.hintAnimationStartColor;
animationEndColor = globalSettings.hintAnimationEndColor;
animateDuration = globalSettings.hintAnimationDuration;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment