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); } }
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); }
public static void Log(object obj) { ScreenText.Log(obj.ToString()); }