1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System.Collections;
- using System.Collections.Generic;
- using CombatLibrary.CombatLibrary.CombatCore.Utility;
- using Fort23.UTool;
- using UnityEngine;
- public class ImageMove
- {
- // public AnimationCurve ShowSizeCurve;
- public AnimationCurve SizeCurve;
- public AnimationCurve moveSpeed;
- public GameObjectPool GameObjectPool;
- public RectTransform transform;
- public ACurve currAcur;
- public float yanChi;
- private float currTime;
- public float speed;
- // public float showSizeSpeed;
- public bool isShowSize = true;
- public Vector3 moveTargetPos;
- public Vector3 moveStartPos;
- public bool Update()
- {
- if (currAcur.CurveInfos == null)
- {
- return true;
- }
- yanChi -= Time.deltaTime;
- if (yanChi > 0)
- {
- return false;
- }
- GameObjectPool.own.gameObject.SetActive(true);
- // if (isShowSize)
- // {
- // currTime += Time.deltaTime * showSizeSpeed;
- // float ss = currTime;
- // if (ShowSizeCurve != null)
- // {
- // ss = ShowSizeCurve.Evaluate(currTime);
- // transform.localScale = Vector3.one * ss;
- // }
- //
- //
- // Vector3 p = Vector3.Lerp(moveStartPos, moveTargetPos, ss);
- // transform.anchoredPosition = p;
- // if (currTime >= 1)
- // {
- // isShowSize = false;
- // currTime = 0;
- // }
- //
- // return false;
- // }
- currTime += Time.deltaTime * speed;
- float ms = currTime;
- if (moveSpeed != null)
- {
- ms = moveSpeed.Evaluate(currTime);
- }
- transform.anchoredPosition = currAcur.EvaluateForVector2(ms,ms);
- float s = currTime;
- if (SizeCurve != null)
- {
- s = SizeCurve.Evaluate(currTime);
- transform.localScale = Vector3.one * s;
- }
- if (currTime > 1)
- {
- currAcur.CurveInfos = null;
- }
- return false;
- }
- }
|