Exemplo n.º 1
0
    public void Interact(HeroStuff whoInteract)
    {
        if (whoInteract.HeroSpendCoins(PriceOfPick))
        {
            whoInteract.CouldMineGold = true;
        }

        gameObject.SetActive(false);
    }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     HeroStuff = GetComponent <HeroStuff>();
 }