Пример #1
0
        private void OnTriggerEnter(Collider c)
        {
            if (isOpening)
            {
                return;
            }

            var inventory = c.GetComponent <PlayerInventory>();

            if (inventory == null)
            {
                return;
            }

            if (inventory.HasKey(keyID))
            {
                ScreenText.Log("Opened {0} door", Key.Name);

                inventory.RemoveKey(keyID);
                Open();
            }
            else
            {
                ScreenText.Log("{0} key required", Key.Name);
            }
        }
Пример #2
0
        private void OnTriggerEnter(Collider c)
        {
            var inventory = c.GetComponent <PlayerInventory>();

            if (inventory == null)
            {
                return;
            }

            ScreenText.Log("Picked up {0} key", Key.Name);
            inventory.AddKey(keyID);
            UnityUtil.Destroy(gameObject);
        }
Пример #3
0
 public static void Log(object obj)
 {
     ScreenText.Log(obj.ToString());
 }