public void OnAfterDeserialize() { if (primary_function_enum != null) { primary_function = (PrimaryFunction)Enum.Parse(typeof(PrimaryFunction), primary_function_enum); } if (hierarchy_rank_enum != null) { hierarchy_rank = (HierarchyRank)Enum.Parse(typeof(HierarchyRank), hierarchy_rank_enum); } if (item_function_enum != null) { item_function = (ItemFunction)Enum.Parse(typeof(ItemFunction), item_function_enum); } if (material_function_enum != null) { material_function = (MaterialFunction)Enum.Parse(typeof(MaterialFunction), material_function_enum); } if (morph_function_enum != null) { morph_function = (MorphFunction)Enum.Parse(typeof(MorphFunction), morph_function_enum); } if (animation_function_enum != null) { animation_function = (AnimationFunction)Enum.Parse(typeof(AnimationFunction), animation_function_enum); } if (artisttools_function_enum != null) { artisttools_function = (ArtistToolsFunction)Enum.Parse(typeof(ArtistToolsFunction), artisttools_function_enum); } }
public AnimationRotator(T[] objectCollection, AnimationFunction function, float playTimeSeconds, AnimationDirection direction = AnimationDirection.FORWARD, int startIndex = 0) { ObjectCollection = objectCollection; this.function = function; this.direction = direction; activeIndex = startIndex; updateIntervall = (playTimeSeconds * 1000) / ObjectCollection.Length; }
private void AlterScale(Vector2 amount) { if (animFuncX != null && animFuncY != null) { UpdateLocalScale(animFuncX.EndValue, animFuncY.EndValue); } animFuncX = new AnimationFunction(Time.time, transform.localScale.x, shrinkDuration, transform.localScale.x - amount.x); animFuncY = new AnimationFunction(Time.time, transform.localScale.y, shrinkDuration, transform.localScale.y - amount.y); }
public void changeAnimation(string newAnimation) { if (anim != null) { if (comp != newAnimation || comp == "new") { comp = newAnimation; currentAnimation = findAnim(newAnimation); currentAnimation.animEvent.Invoke(); anim.Play(currentAnimation.animation.name, 0, 0); } } }
AnimationFunction findAnim(string nameOfAnim) { AnimationFunction tempFunc = new AnimationFunction(); for (int i = 0; i < allAnimations.Length; i++) { if (nameOfAnim == allAnimations[i].animation.name) { return(allAnimations[i]); } } Debug.LogError("no animation found with the name " + nameOfAnim); return(tempFunc); }
private void Update() { if (animFuncX != null && animFuncY != null) { if (animFuncX.Finished(Time.time) && animFuncY.Finished(Time.time)) { UpdateLocalScale(animFuncX.EndValue, animFuncY.EndValue); animFuncX = null; animFuncY = null; } else { UpdateLocalScale(animFuncX.GetValue(Time.time), animFuncY.GetValue(Time.time)); } } }