Exemple #1
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         teleportinstance.GetComponent <TeleportPlayer>().DestroyEnemies();
         StartCoroutine(Warp());
     }
 }
Exemple #2
0
    void Awake()
    {
        count = 0;

        /* if (Instance == null)
         * {
         * Instance = null;
         * DontDestroyOnLoad (gameObject);
         * }
         * else if (Instance != this)
         * Destroy (gameObject);*/

        UnityEngine.XR.XRDevice.DisableAutoXRCameraTracking(cam, true);
        cinematic.StartTimeLine();
        playerMovement.GetComponent <TeleportPlayer> ().enabled = false;
        smoke = GameObject.FindGameObjectsWithTag("Smoke");
    }
Exemple #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!collision.isTrigger)
     {
         teleportinstance.CanClick = true;
     }
     if (collision.gameObject.tag == "spawn")
     {
         teleportinstance.GetComponent <TeleportPlayer>().currentspawn = collision.transform;
     }
     if (collision.gameObject.name == "Tutorial")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 0;
     }
     if (collision.gameObject.name == "1st floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 1;
     }
     if (collision.gameObject.name == "2nd floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 2;
     }
     if (collision.gameObject.name == "3rd floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 3;
     }
     if (collision.gameObject.name == "4th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 4;
     }
     if (collision.gameObject.name == "5th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 5;
     }
     if (collision.gameObject.name == "6th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 6;
     }
     if (collision.gameObject.name == "7th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 7;
     }
     if (collision.gameObject.name == "8th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 8;
     }
     if (collision.gameObject.name == "9th floor")
     {
         teleportinstance.GetComponent <TeleportPlayer>().levelstate = 9;
     }
 }