bool CastValues(ECast Type, ECastMode Mode, int Value, float CastTime) { if (AnimatorComponent) { this.CastTime = CastTime; CastMode = Mode; string Trigger = "Cast"; switch (Type) { case ECast.Aoe: Trigger += ("AOE" + Value); break; case ECast.Buff: Trigger += ("Buff" + Value); break; case ECast.Summon: Trigger += ("Summon" + Value); break; default: break; } Trigger += "Trigger"; AnimatorComponent.SetTrigger(Trigger); AnimatorComponent.SetInteger("Weapon", (int)EWeapon.Armed); AnimatorComponent.SetInteger("LeftWeapon", 0); AnimatorComponent.SetInteger("RightWeapon", 0); return(true); } return(false); }
public void Cast(string InputName, ECast Type, ECastMode Mode, int Value, float CastTime) { switch (CastMode) { case ECastMode.Default: if (Input.GetButtonDown(InputName)) { IsCast = true; CastValues(Type, Mode, Value, CastTime); } break; case ECastMode.Channeling: if (Input.GetButtonDown(InputName)) { IsCast = CastValues(Type, Mode, Value, CastTime); } if (Input.GetButtonUp(InputName)) { AnimatorComponent.SetTrigger("CastEndTrigger"); IsCast = false; } break; case ECastMode.Toggle: this.CastTime = -1; if (IsCast) { if (Input.GetButtonDown(InputName)) { IsCast = false; AnimatorComponent.SetTrigger("CastEndTrigger"); } } else { if (Input.GetButtonDown(InputName)) { IsCast = true; CastValues(Type, Mode, Value, CastTime); } } break; case ECastMode.Instant: if (Input.GetButtonDown(InputName)) { IsCast = true; CastValues(Type, Mode, Value, CastTime); } break; case ECastMode.Strike: if (Input.GetButtonDown(InputName)) { CastMeter = Mathf.Clamp(CastMeter + CastAdd, 0, CastCap); } if (CastMeter >= CastCap) { IsCast = true; CastMeter = 0; CastValues(Type, Mode, Value, CastTime); Invoke("OnCastInvoke", CastCapTime); } break; } }