Exemplo n.º 1
0
    public bool PlayMec(Vector2 playindex)
    {
        TestAnimation t = GetAnimation((int)playindex.x);

        if (t != null)
        {
            t.isPositive = true;
            t.Play(this.time, this.step, this.distance);
            t.SetAction(this.actiontime * t.GetAlltime(), delegate
            {
                call1 = true;
            });
        }
        else
        {
            return(false);
        }


        //can add animation before play inverse animation
        pauseStartTime = Time.time;
        pauseAction    = delegate
        {
            pauseAction = null;
            TestAnimation tt = GetAnimation((int)playindex.y);
            if (tt != null)
            {
                tt.isPositive = false;
                Vector3 newTime     = new Vector3(this.time.z, this.time.y, this.time.x);
                Vector3 newStep     = new Vector3(this.step.z, this.step.y, this.step.x);
                Vector2 newDistance = new Vector2(this.distance.y, this.distance.x);
                tt.Play(newTime, -newStep, newDistance);
                tt.SetAction(this.actiontime * tt.GetAlltime(), delegate
                {
                    call2 = true;
                });
            }
        };
        return(true);
    }