コード例 #1
0
ファイル: InputDevice.cs プロジェクト: zhangxuelei86/suis
 public void RemoveInput(InputMethod inputMethod)
 {
     if (inputMethods.Contains(inputMethod))
     {
         inputMethods.Remove(inputMethod);
     }
 }
コード例 #2
0
ファイル: InputDevice.cs プロジェクト: zhangxuelei86/suis
 public void AddInputMethod(InputMethod inputMethod)
 {
     if (!inputMethods.Contains(inputMethod))
     {
         inputMethod.device = this;
         inputMethods.Add(inputMethod);
     }
 }
コード例 #3
0
ファイル: InputDevice.cs プロジェクト: zhangxuelei86/suis
 private void Start()
 {
     if (autoAddChildrenOnAwake)
     {
         for (int i = 0; i < transform.childCount; ++i)
         {
             InputMethod inputMethod = transform.GetChild(i).GetComponent <InputMethod>();
             if (inputMethod != null)
             {
                 AddInputMethod(inputMethod);
             }
         }
     }
 }
コード例 #4
0
ファイル: ActionTrigger.cs プロジェクト: zhangxuelei86/suis
        public void testAction(InputMethod inputMethod, float distance, InputHandler handler)
        {
            performedAction = performingAction;

            //Check if the input types are the same
            bool inputTypeMatches = (inputMethod.Type & type) != InputType.None;

            //If they are, check if the action is being performed
            performingAction = inputTypeMatches ? isPerformingAction(inputMethod, distance, handler) : false;

            if (!performedAction && performingAction)
            {
                OnActionStarted.Invoke(inputMethod, distance, handler);
            }
            if (performingAction)
            {
                OnActionUpdate.Invoke(inputMethod, distance, handler);
            }
            if (performedAction && !performingAction)
            {
                OnActionEnded.Invoke(inputMethod, distance, handler);
            }
        }
コード例 #5
0
ファイル: ActionTrigger.cs プロジェクト: zhangxuelei86/suis
 protected abstract bool isPerformingAction(InputMethod inputMethod, float distance, InputHandler handler);
コード例 #6
0
 protected override bool isPerformingAction(InputMethod inputMethod, float distance, InputHandler handler)
 {
     return(isPerformingAction(inputMethod as PointerInput, distance, handler));
 }