Example #1
0
 // Start is called before the first frame update
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag.CompareTo("Player") == 0)
     {
         ScrollingText.StartSentence(new string[] { "Urgh... I can't leave this something...?" }, new string[] { "NoLeave" });
     }
 }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.CompareTo("Player") == 0)
     {
         if (PlayerPrefs.GetInt("FinalItem") == 1)
         {
             PlayerPrefs.SetInt("FinalItem", 0);
             SceneManager.LoadScene("GameEnd");
         }
         else
         {
             ScrollingText.StartSentence(new string[] { "I need to find the missing item to activate" }, new string[] { "Main" });
         }
     }
 }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (!Active)
        {
            return;
        }

        GameObject gobject = other.gameObject;

        if (other.CompareTag("Player") && Active)
        {
            Vector3 position = other.transform.position;
            AddImpact(position, Force);
            if (Rooms.RollRoom() == false)
            {
                int numb = Random.Range(0, 100);
                if (numb < 20)
                {
                    spawn.Chest();
                }

                spawnEnemies.Spawn();

                EnemyCount = spawnEnemies.amount;

                Debug.Log("Yolo");
            }
            else
            {
                ScrollingText.StartSentence(new string[] { "I found the room with missing item, I need to leave now" }, new string[] { "NoLeave" });
                PlayerPrefs.SetInt("FinalItem", 1);
                spawnExit.SetActive(true);
            }
            SpawnedEnemy = true;
        }
    }