Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (!taken)
        {
            taken = true;
            RespawnControl respawnControl = other.GetComponent <RespawnControl>();
            respawnControl.spawnPoint = tf;

            flagTf.Rotate(0.0f, 180f, 0.0f, Space.Self);
        }
    }
Esempio n. 2
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);
        }
    }
Esempio n. 3
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);
        }
    }
Esempio n. 4
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);
        }
    }
Esempio n. 5
0
 void P2StartingSpawn(Player2Spawns spawn)
 {
     RespawnControl.Respawn(players [1], p2_spawndict [spawn]);
 }
Esempio n. 6
0
 void P1StartingSpawn(Player1Spawns spawn)
 {
     RespawnControl.Respawn(players [0], p1_spawndict [spawn]);
 }