private void toggleInteractText() { Togglable textComponent = interactText.GetComponent <TogglableText>(); if (textComponent != null) { textComponent.Toggle(); } }
public static Item Create(int type, int amount = -1, Entity owner = null) { Item newItem; if (GameData.GameItems[type] is Gun) newItem = new Gun(type, amount, owner); else if (GameData.GameItems[type] is Melee) newItem = new Melee(type, amount, owner); else if (GameData.GameItems[type] is Goggles) newItem = new Goggles(type, owner); else if (GameData.GameItems[type] is Torch) newItem = new Torch(type, owner); else if (GameData.GameItems[type] is SmartPhone) newItem = new SmartPhone(type, owner); else if (GameData.GameItems[type] is Togglable) newItem = new Togglable(type, owner); else newItem = new Item(type, amount, owner); return newItem; }