void OnTriggerExit2D(Collider2D other) { if (GetItem(other) == justDropped) { justDropped = null; } }
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"); } }
// 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> (); }
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"); }
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"); } }
public void PlayerReset() { Debug.Log("reset player"); FindObjectOfType <PlayerMovement>().ResetPosition(); itemStash = null; }