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);
     }
 }
Пример #3
0
    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;
    }
Пример #4
0
 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>();
 }
Пример #6
0
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     notif       = FindObjectOfType <NotifController>().GetComponent <NotifController>();
 }
Пример #7
0
 void Start()
 {
     itemSpawnTime = itemSpawnRate;
     notif         = FindObjectOfType <NotifController>();
 }
Пример #8
0
 void Start()
 {
     notif              = FindObjectOfType <NotifController>().GetComponent <NotifController>();
     fireLight.enabled  = false;
     fireSprite.enabled = false;
 }