// Use this for initialization void Start() { anim = GetComponent <Animator>(); rbody = GetComponent <Rigidbody2D>(); sRenderer = GetComponent <SpriteRenderer>(); scale = transform.localScale.x; whip = GetComponent <Whip>(); whip.enabled = false; if (indy == null) { indy = this; } hasHammer = false; hammer.gameObject.SetActive(hasHammer); gun.gameObject.SetActive(false); jetpackAnim = jetpack.GetComponent <Animator>(); jetpack.SetActive(false); moneyText.enabled = true; }
void OnTriggerEnter2D(Collider2D other) { if (indy == null) { indy = IndyController.indy; } if (other.gameObject.tag == "Player" && indy.GetMoney() >= cost) { upgradeAction(); indy.RemoveMoney(cost); Destroy(this.gameObject); } }
void Start() { StartCoroutine(changeText()); indy = IndyController.indy; }