Timeline preview and iTween: iTween scripts getting added to objects in the editor
Anyone else seeing this? I have a script that uses itween in a function. The specific tweeen is punchscale and it has a looptype of loop. I kill the itween by name in another function in the script. it all works fine, no errors, works on PC and mobile The script is attached to an object that is animated using timeline. Sometimes when I am testing in the Unity editor a whole bunch of iTween scripts get added to the object, and appear in the editor, and I have to delete them by hand. sometimes there are hundreds of them. This is like something happening at runtime, with the animator, is impacting the scene? Here is a picture, and the code
public void StartPulsing()
{
if (PulsingEnable)
{
if (this.isActiveAndEnabled == true)
{
// Save the current scale so it can be reset when pulsing stops
// stuck into a variable for debugging. Optimizer will do the right thing with this
RectTransform tmpTransform = this.GetComponent<RectTransform>();
Original_Scale = tmpTransform.localScale;
System.Collections.Hashtable hash =
new System.Collections.Hashtable();
hash.Add("name", HighlightTweenName);
hash.Add("amount", new Vector3(PulseSizeX, PulseSizeY, PulseSizeZ));
hash.Add("time", PulseTime);
hash.Add("looptype", iTween.LoopType.loop);
iTween.PunchScale(this.gameObject, hash);
}
}
}
public void StopPulsing()
{
if (PulsingEnable)
{
iTween.StopByName(HighlightTweenName);
GetComponent<RectTransform>().localScale = Original_Scale;
}
}
Your answer
Follow this Question
Related Questions
CustomEditor on Inspector, Text too big to be fully rendered 0 Answers
How to save a two-dimensional array, as part of the variable inspector? 0 Answers
How do I use EditorGUILayout.EnumPopup with an enum with 'holes' in a custom inspector. 3 Answers
Is it possible to customize how a variable of a certain type would look in the inspector? 1 Answer
Why does Unity use the default values for my Serializable objects while running? 1 Answer