void Start () { spiritState = GetComponent <SpiritStateController> (); rb = GetComponent<Rigidbody> (); }
void CollectSpirit(SpiritStateController spiritState) { // reset idle health decrease timer TimerIdleHealthDecreaseCount = 0; // increase my live value IncreaseHealth (CollectionHealthIncrease); // add the collections points collectionPoints += spiritState.CollectionsPoints; // play sound audioSource.PlayOneShot (collectSound); Debug.Log ("Spirit collected!! Points: "+collectionPoints+ " ||| needed next: "+GameRules.LevelConditions [Level + 1]); // TODO test if i can leven up if (collectionPoints >= GameRules.LevelConditions [Level + 1]) { LevelUp(); } // trigger Spirit destruction spiritState.GetCollected (); }