Beispiel #1
0
    void InitialiseRespawn()
    {
        const int defaultRespawnNode = -1;

        respawn        = GetComponent <Respawn>();;
        waypointNodeID = defaultRespawnNode;
        respawn.AddLastToRespawnAction(() => { Go(0); });
        respawn.AddLastToRespawnAction(() => { Stop(breakForce); });
        respawn.AddLastToRespawnAction(pid.ResetValues);
        respawn.AddLastToRespawnAction(() => { respawn.respawnNode = waypointNodeID - 1; });
        respawn.AddLastToRespawnAction(() => { timeAlive = 0; StartCoroutine(SetIdleOnATimer(2f)); });
        respawn.AddLastToRespawnAction(() => { respawn.RespawnObject(GetNextWayPoint(0), (GetNextWayPoint(0 + 1) - GetNextWayPoint(0)).normalized); });
    }