Пример #1
0
 protected virtual void PotionHasExpired()
 {
     if (potionState == PotionStates.IsExpiring)
     {
         return;
     }
     potionState = PotionStates.IsExpiring;
     //SEND Message to loader
     Debug.Log("potion expired");
     this.enabled = false;
     Destroy(this);
 }
Пример #2
0
 protected virtual void PotionCollected(GameObject picker)
 {
     if (picker.tag != "Player")
     {
         return;
     }
     if (potionState == PotionStates.IsCollected || potionState == PotionStates.IsExpiring)
     {
         return;
     }
     //state is attract,then can collect
     potionState = PotionStates.IsCollected;
     player      = picker.GetComponent <Player>();
     //Move to player
     this.gameObject.transform.SetParent(player.gameObject.transform);
     this.gameObject.transform.position = player.gameObject.transform.position;
     PotionEffect();
     PotionPayload();
     //SEND MESSAGE AND DISABLED
     //.....
     //animator.enabled=false;
     spriteRenderer.enabled = false;
 }
Пример #3
0
 // Start is called before the first frame update
 protected virtual void Start()
 {
     potionState = PotionStates.InAttractMode;
 }