Exemplo n.º 1
0
 /// <summary>
 /// 輸入玩家的UI
 /// 使角色設定為玩家操控
 /// </summary>
 /// <param name="_input"></param>
 public void SetUserInput(MyJoystick _movement, MyUnityUI _attack, MyUnityUI[] _skill)
 {
     if (myBehavior == null)
     {
         return;
     }
     //更新技能使得圖案跟上
     myBehavior.InputUI(_movement, _attack, _skill);
     for (int i = 0; i < Skills.Length; i++)
     {
         SkillChange(Skills[i]);
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// 輸入玩家控制的UI
    /// </summary>
    /// <param name="_movement"></param>
    /// <param name="_attack"></param>
    /// <param name="_skill"></param>
    public void InputUI(MyJoystick _movement, MyUnityUI _attack, MyUnityUI[] _skill)
    {
        PlayerInput myInput     = input as PlayerInput;
        MyJoystick  oldMovement = null;
        MyUnityUI   oldAttack   = null;

        MyUnityUI[] oldSkill = null;
        if (myInput != null)
        {
            oldMovement = myInput.MovementController;
            oldAttack   = myInput.AttackButton;
            oldSkill    = myInput.SkillButton;
        }
        PlayerInput newInput = new PlayerInput(this)
        {
            MovementController = _movement == null ? oldMovement : _movement,
            AttackButton       = _attack == null ? oldAttack : _attack,
            SkillButton        = _skill == null? oldSkill : _skill
        };

        input = newInput;
    }
Exemplo n.º 3
0
 /// <summary>
 /// 手動新增子物件,盡量使用Prefab,不要使用此函式
 /// </summary>
 /// <param name="_unityUI"></param>
 public void AddUIMember(MyUnityUI _unityUI)
 {
     members.Add(_unityUI);
     _unityUI.GameObject.transform.SetParent(Transform);
 }