public void Interact(HeroStuff whoInteract) { if (whoInteract.HeroSpendCoins(PriceOfPick)) { whoInteract.CouldMineGold = true; } gameObject.SetActive(false); }
public void Interact(HeroStuff whoInteract) { //var coin = collision.gameObject; //After animation coin will be destroyed Animator.Play("CoinDestroy"); //Remove a few components from coin object. //After that, the Hero can go through the Coin Destroy(GetComponent <Rigidbody>()); Destroy(GetComponent <CapsuleCollider>()); whoInteract.HeroGetCoins(); }
// Start is called before the first frame update void Start() { HeroStuff = GetComponent <HeroStuff>(); }