public AnimationPosition(AnimationPosition source) : base(source) { fromPos = source.fromPos; toPos = source.toPos; lerpType = source.lerpType; posType = source.posType; isFromTarget = source.isFromTarget; }
public void Animate(string animationName, AnimationPosition positionName) { Vector3 position = (positionName == AnimationPosition.TopRight) ? new Vector3(0.4f, 0.6f, 0) : new Vector3(-0.4f, 0.6f, 0); GameObject animation = Instantiate(Resources.Load <GameObject>(animationName)); if (animation == null) { Debug.LogError("Could not find " + animationName + " prefab in Resources folder!"); } else { animation.transform.parent = transform; animation.transform.position = transform.position + position; } }
protected override void Load() { uiAnimation = new AnimationPosition(aniTarget, aniLength, aniCurve, fromPos, toPos, lerpType, posType, isFromTarget); }