Пример #1
0
    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;
        }
    }
Пример #2
0
 private void SetDefaultValue()
 {
     AI        = GetComponent <CharaInputAI>();
     Input     = GetComponent <CharaInputPlayer>();
     Parameter = GetComponent <CharaParameterManager>();
     Map       = UnityEngine.GameObject.Find("_Map").GetComponent <Map>();
 }
Пример #3
0
 /*
  * ▒███████▒████████▒▒████████
  * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒
  * ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒
  */
 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))));
 }
Пример #4
0
    /*
     * ▒██████▒▒████████▒████████
     * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
     * ▒██████▒▒████████▒▒▒▒██▒▒▒
     * ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
     * ▒██████▒▒████████▒▒▒▒██▒▒▒
     */

    private void SetActionState(CharaInputManager input)
    {
        if (input.GetKey("fire"))
        {
            ExecuteFire();
            ActionState = "Fire";
        }
        else
        {
            ActionState = "";
        }
    }
Пример #5
0
 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;
     }
 }
Пример #6
0
 private void SetDefaultValue()
 {
     AI        = GetComponent<CharaInputAI>();
     Input     = GetComponent<CharaInputPlayer>();
     Parameter = GetComponent<CharaParameterManager>();
     Map       = UnityEngine.GameObject.Find("_Map").GetComponent<Map>();
 }
Пример #7
0
 /*
   ▒██████▒▒████████▒████████
   ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
   ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
  */
 private void SetActionState(CharaInputManager input)
 {
     if (input.GetKey("fire")) {
         ExecuteFire();
         ActionState = "Fire";
     } else {
         ActionState = "";
     }
 }
Пример #8
0
 /*
   ▒███████▒████████▒▒████████
   ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒
   ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒
  */
 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)));
 }