private void SetMovementState(CharaInputManager input) { Direction = GetDirection(input); switch (Direction) { case 0: default: MovementState = "Idle"; break; case 1: case 2: case 3: case 4: case 6: case 7: case 8: case 9: if (Input.GetKey("dash")) { ExecuteDash(); MovementState = "Dash"; } else { ExecuteWalk(); MovementState = "Walk"; } break; } }
private void SetDefaultValue() { AI = GetComponent <CharaInputAI>(); Input = GetComponent <CharaInputPlayer>(); Parameter = GetComponent <CharaParameterManager>(); Map = UnityEngine.GameObject.Find("_Map").GetComponent <Map>(); }
/* * ▒███████▒████████▒▒████████ * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒ * ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒ * ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒ * ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒ */ private int GetDirection(CharaInputManager input) { u = input.GetKey("up0"); l = input.GetKey("left0"); d = input.GetKey("down0"); r = input.GetKey("right0"); return(u ? (d ? (l ? (r ? 0 : 4) : (r ? 6 : 0)) : (l ? (r ? 8 : 7) : (r ? (l ? 8 : 9) : 8))) : (l ? (r ? (d ? 2 : 0) : (d ? 1 : 4)) : (r ? (d ? 3 : 6) : (d ? 2 : 0)))); }
/* * ▒██████▒▒████████▒████████ * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒ * ▒██████▒▒████████▒▒▒▒██▒▒▒ * ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒ * ▒██████▒▒████████▒▒▒▒██▒▒▒ */ private void SetActionState(CharaInputManager input) { if (input.GetKey("fire")) { ExecuteFire(); ActionState = "Fire"; } else { ActionState = ""; } }
private void SetDefaultValue() { AI = GetComponent<CharaInputAI>(); Input = GetComponent<CharaInputPlayer>(); Parameter = GetComponent<CharaParameterManager>(); Map = UnityEngine.GameObject.Find("_Map").GetComponent<Map>(); }
/* ▒██████▒▒████████▒████████ ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒ ▒██████▒▒████████▒▒▒▒██▒▒▒ ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒ ▒██████▒▒████████▒▒▒▒██▒▒▒ */ private void SetActionState(CharaInputManager input) { if (input.GetKey("fire")) { ExecuteFire(); ActionState = "Fire"; } else { ActionState = ""; } }
/* ▒███████▒████████▒▒████████ ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒ ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒ ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒ ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒ */ private int GetDirection(CharaInputManager input) { u = input.GetKey("up0"); l = input.GetKey("left0"); d = input.GetKey("down0"); r = input.GetKey("right0"); return u ? (d ? (l ? (r ? 0 : 4) : (r ? 6 : 0)) : (l ? (r ? 8 : 7) : (r ? (l ? 8 : 9) : 8))) : (l ? (r ? (d ? 2 : 0) : (d ? 1 : 4)) : (r ? (d ? 3 : 6) : (d ? 2 : 0))); }