Beispiel #1
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (GetItem(other) == justDropped)
     {
         justDropped = null;
     }
 }
Beispiel #2
0
 void HandleBomb()
 {
     // Handles logic when player returns to the bomb
     if (itemStash != null)
     {
         itemStash.ApplyEffect(this);
         itemStash = null;
     }
     else
     {
         Debug.Log("You have no item in your stash");
     }
 }
Beispiel #3
0
    // Use this for initialization

    void Start()
    {
        if (isLocalPlayer)
        {
            GameObject.FindObjectOfType <StashButtonController> ().player = this.gameObject;
        }

        justDropped      = null;
        timer            = GameObject.FindObjectOfType <UpdateTime> ();
        spriteRenderer   = gameObject.GetComponent <SpriteRenderer> ();
        profileContainer = gameObject.GetComponent <PlayerProfileContainer> ();
        playerScore      = gameObject.GetComponent <PlayerScore> ();
    }
Beispiel #4
0
    public void EmptyStash()
    {
        if (itemStash == null)
        {
            Debug.Log("No item in stash to drop.");
            return;
        }

        justDropped = itemStash;
        itemStash.OnDrop(transform.position);
        itemStash = null;

        Debug.Log("Dropped item");
    }
Beispiel #5
0
 public void AddToStash(IItemable item)
 {
     if (justDropped == item)
     {
         Debug.Log("you just dropped this item");
         return;
     }
     if (itemStash == null)
     {
         item.OnPickUp();
         itemStash = item;
         Debug.Log("You picked up an item");
     }
     else
     {
         Debug.Log("You already have an item in your stash");
     }
 }
Beispiel #6
0
 public void PlayerReset()
 {
     Debug.Log("reset player");
     FindObjectOfType <PlayerMovement>().ResetPosition();
     itemStash = null;
 }