void Start() { player = FindObjectOfType <PlayerController>(); notifController = FindObjectOfType <NotifController>(); templateItem.gameObject.SetActive(false); inventoryTransform = GetComponent <RectTransform>(); originalPos = new Vector3(inventoryTransform.position.x, inventoryTransform.position.y, inventoryTransform.position.z); inventoryTransform.SetPositionAndRotation(new Vector3(originalPos.x, originalPos.y + inventoryOffset, originalPos.z), Quaternion.identity); }
public override void Interaction(Item item) { if (Random.Range(0f, 1f) >= successChance) { playerInventory = FindObjectOfType <PlayerInventory>().GetComponent <PlayerInventory>(); playerInventory.AddItem(receiveItem, amount); playerInventory.RemoveItem(item, 1); } else { if (notif == null) { notif = FindObjectOfType <NotifController>().GetComponent <NotifController>(); } notif.CreateNotif(failNotifMsg); } }
public void Pause() { NotifController notif = FindObjectOfType <NotifController>(); if (notif != null) { notif.debugText.text += "GM do pause " + Time.realtimeSinceStartup + ""; } pause = !pause; snd_mng.Pause(pause); pauseBtn.gameObject.SetActive(!pause); resumeBtn.gameObject.SetActive(pause); darkenScreen.gameObject.SetActive(pause); Time.timeScale = pause ? 0 : 1; }
public override void Interaction(Item item) { if (Random.Range(0f, 1f) > 0.7f) { playerInventory = FindObjectOfType <PlayerInventory>().GetComponent <PlayerInventory>(); playerInventory.AddItem(halfCoconut, 2); playerInventory.RemoveItem(item, 1); } else { if (notif == null) { notif = FindObjectOfType <NotifController>().GetComponent <NotifController>(); } notif.CreateNotif("You failed to break the coconut."); } }
void Start() { notif = FindObjectOfType <NotifController>().GetComponent <NotifController>(); }
void Start() { audioSource = GetComponent <AudioSource>(); notif = FindObjectOfType <NotifController>().GetComponent <NotifController>(); }
void Start() { itemSpawnTime = itemSpawnRate; notif = FindObjectOfType <NotifController>(); }
void Start() { notif = FindObjectOfType <NotifController>().GetComponent <NotifController>(); fireLight.enabled = false; fireSprite.enabled = false; }