Пример #1
0
    void OnCollisionEnter(Collision coll)
    {
        if (coll.gameObject.name == "Player")
        {
            lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }

        if (coll.gameObject.name == "Player2")
        {
            lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }
    }
Пример #2
0
    void OnTriggerEnter(Collider coll)
    {
        if (coll.gameObject.tag == "Player")
        {
            lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }

        if (coll.gameObject.tag == "Player2")
        {
            lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }
    }
Пример #3
0
    //reverse direction upon collision with wall
    //kills player.
    void OnCollisionEnter(Collision coll)
    {
        if (enemyState == EnemyState.NORMAL)
        {
            speed *= -1f;
        }

        if (coll.gameObject.name == "Player")
        {
            lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }

        if (coll.gameObject.name == "Player2")
        {
            lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2];
            RespawnControl.Respawn(coll.gameObject, lastCheckpoint);
        }
    }
Пример #4
0
 void P2StartingSpawn(Player2Spawns spawn)
 {
     RespawnControl.Respawn(players [1], p2_spawndict [spawn]);
 }
Пример #5
0
 void P1StartingSpawn(Player1Spawns spawn)
 {
     RespawnControl.Respawn(players [0], p1_spawndict [spawn]);
 }