objectFinished() public method

public objectFinished ( TriggeredObject, ob ) : void
ob TriggeredObject,
return void
コード例 #1
0
    public void doAction(TriggerSignalObject trigger)
    {
        Sequence sequence = DOTween.Sequence ();
        isTriggered = true;

        for(int i = 0; i < wayPoints.Count; i++)
        {
            sequence.Append(transform.DOMove(wayPoints[i].transform.position, wayPointSpeeds[i]));
            sequence.Join(transform.DORotate (wayPoints[i].transform.eulerAngles, wayPointSpeeds[i]));
        }

        sequence.PrependInterval (startDelay);
        sequence.AppendInterval (endDelay);

        if (loop) {

            for(int i = wayPoints.Count - 2; i >= 0; i--)
            {
                sequence.Append(transform.DOMove(wayPoints[i].transform.position, wayPointSpeeds[i + 1]));
                sequence.Join(transform.DORotate (wayPoints[i].transform.eulerAngles, wayPointSpeeds[i + 1]));
            }

            sequence.Append(transform.DOMove(startingLocation, wayPointSpeeds[0]));
            sequence.Join(transform.DORotate (startingRotation, wayPointSpeeds[0]));
        }

        sequence.OnComplete (() => {trigger.objectFinished (this);});

        sequence.Play ();
    }
コード例 #2
0
    public void doAction(TriggerSignalObject trigger)
    {
        Sequence sequence = DOTween.Sequence();

        isTriggered = true;

        for (int i = 0; i < wayPoints.Count; i++)
        {
            sequence.Append(transform.DOMove(wayPoints[i].transform.position, wayPointSpeeds[i]));
            sequence.Join(transform.DORotate(wayPoints[i].transform.eulerAngles, wayPointSpeeds[i]));
        }


        sequence.PrependInterval(startDelay);
        sequence.AppendInterval(endDelay);

        if (loop)
        {
            for (int i = wayPoints.Count - 2; i >= 0; i--)
            {
                sequence.Append(transform.DOMove(wayPoints[i].transform.position, wayPointSpeeds[i + 1]));
                sequence.Join(transform.DORotate(wayPoints[i].transform.eulerAngles, wayPointSpeeds[i + 1]));
            }

            sequence.Append(transform.DOMove(startingLocation, wayPointSpeeds[0]));
            sequence.Join(transform.DORotate(startingRotation, wayPointSpeeds[0]));
        }

        sequence.OnComplete(() => { trigger.objectFinished(this); });

        sequence.Play();
    }
コード例 #3
0
    public void doAction(TriggerSignalObject trigger)
    {
        Debug.Log(loop);
        if (!isTriggered || loop)
        {
            Debug.Log("Go again...");
            on = !on;
            switchOnOff(on);

            isTriggered = true;
            trigger.objectFinished(this);
        }
    }
コード例 #4
0
    public void doAction(TriggerSignalObject trigger)
    {
        Debug.Log (loop);
        if(!isTriggered || loop)
        {
            Debug.Log ("Go again...");
            on = !on;
            switchOnOff (on);

            isTriggered = true;
            trigger.objectFinished (this);
        }
    }