public void RemoveWet() { if (state == ScarecrowState.Wet) { state = ScarecrowState.Alive; } }
public void RemoveAflame() { if (state == ScarecrowState.Aflame) { state = ScarecrowState.Alive; fireObject.SetActive(false); } }
public void SetAflame() { switch (state) { case ScarecrowState.Alive: state = ScarecrowState.Aflame; fireObject.SetActive(true); break; case ScarecrowState.Wet: state = ScarecrowState.Alive; break; } }
public void SetWet() { switch (state) { case ScarecrowState.Alive: state = ScarecrowState.Wet; break; case ScarecrowState.Aflame: state = ScarecrowState.Alive; fireObject.SetActive(false); break; } }
public void SetAflame() { Debug.Log("LIGHT ME ON FIRE " + state.ToString()); switch (state) { case ScarecrowState.Alive: state = ScarecrowState.Aflame; fireObject.SetActive(true); Debug.Log("I'M ON FIRE!"); break; case ScarecrowState.Wet: state = ScarecrowState.Alive; break; } }
public void DamagePart(ScarecrowPartType partType, int amount) { if (_parts.ContainsKey(partType)) { _parts[partType].Damage(amount); } if (partType == ScarecrowPartType.Peg && _parts[partType].State == ScarecrowPartState.Ruined) { transform.Find("Sprites").Find("Dead").GetComponent <SpriteRenderer>().enabled = true; } if (_parts.Values.All(p => p.State == ScarecrowPartState.Ruined)) { state = ScarecrowState.Dead; } }