Exemplo n.º 1
0
    public void AnimationOnUpdate(float value)
    {
        if (enabled == false)
        {
            return;
        }

        curAnimationValue = value;
        Vector3 toPos = Vector3.zero;

        movePathBase.GetPointAtTime(value, out toPos);
        gameObject.transform.localPosition = toPos;
        UpdateRotation();
        if (onAnimationUpdate != null)
        {
            onAnimationUpdate(value);
        }
    }
Exemplo n.º 2
0
    public void Update()
    {
        if (!isPlay)
        {
            return;
        }
        if (Time.time < fStartTime + delay)
        {
            return;
        }
        float curTime = Time.time - (fStartTime + delay);

        movePath.GetPointAtTime(curTime / time, out tempPos);
        transform.position = tempPos;
        if (curTime > time)
        {
            if (onMoveFinish != null)
            {
                onMoveFinish(gameObject);
            }
        }
    }