private void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of Ghost Inventory"); return; } instance = this; }
public GhostInput(GameObject thisobject, GameObject tempHead, InputManager tempInput, GhostInventory tempInv) { inventory = tempInv; input = tempInput; _controller = thisobject.GetComponent <CharacterController>(); _Headtransform = tempHead.GetComponent <Transform>(); _transform = thisobject.GetComponent <Transform>(); _animator = thisobject.GetComponent <Animator>(); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
void PlayerAwake() { input = new InputManager(); hotbar = new GhostInventory(defaultIcon, selectedIcon, emptyItem, SlotNumber); MyCamera.SetActive(false); MyFBOCam.SetActive(false); ThisPlayer = new Ghost(gameObject, head, hotbar, false, input); Player1Stats = new GhostStatObserver(ThisPlayer); Player1Score = new GhostScoreObserver(ThisPlayer); /*FOR TUTORIAL:*///ThisPlayer.SetState(new TeachWalkState()); /*FOR EDITING:*/ ThisPlayer.SetState(new TeachPickupState()); CrawlerTrap crawlertemp = new CrawlerTrap(); hotbar.AddTrap(crawlertemp, CrawlerIcon); }
//Constructor public Ghost(GameObject thisobject, GameObject temphead, GhostInventory tempinv, bool isEditor, InputManager tempInput) : base(thisobject) { Head = temphead; ThisInput = new GhostInput(thisobject, temphead, tempInput, tempinv); ThisStamina = new Stamina(100, 12.5f, 40.0f); ThisInventory = tempinv; thisobject.name = "Ghost" + Ghosts.ToString(); Health = 100; if (!isEditor) { GhostNumber = Ghosts; Ghosts++; AllGhosts.Add(GhostNumber, this); Added = true; } }
void Start() { inventory = GhostInventory.instance; slots = parent.GetComponentsInChildren <InventorySlot>(); }
void Start() { ghostInventory = GhostInventory.instance; }