Example #1
0
 private void StanaloneGestureHandle()
 {
     ZoomHandle();
     if (swipeConditions.Evaluate())
     {
         SwipeHandle();
     }
 }
Example #2
0
        private void OnCursorSelected(Vector3Int position)
        {
            if (canMoveConditions.Evaluate())
            {
                Vector3Int selected = position;

                if (!ShouldHandleSelect(position))
                {
                    return;
                }

                agentBehaviorMaking.MakeDecision();
            }
        }
Example #3
0
 private void OnOffEffect()
 {
     onClick?.Invoke();
     if (switchConditions.Evaluate())
     {
         if (!IsOn)
         {
             SwitchOn();
         }
         else
         {
             SwitchOff();
         }
     }
 }
Example #4
0
    private void Update()
    {
        if (selectConditions.Evaluate())
        {
            try
            {
                Vector3 mousePos = CrossInput.Position;
//#if UNITY_ANDROID && !UNITY_EDITOR
//                AndroidAdbLog.LogInfo(mousePos);
//                //AndroidAdbLog.LogInfo(Input.GetTouch(0).position);
//#endif


                bool raycastHitted = Physics.Raycast(
                    CameraRaycaster.ScreenPointToRay(mousePos),
                    out RaycastHit hitInfo,
                    CameraRaycaster.farClipPlane);

                if (raycastHitted)
                {
                    SelectedPosition = MapIns.WorldToCell(hitInfo.point).ZToZero();

                    DetermineSelectedOnTower();
                    // DetermineSelectedOnRSS(hitInfo);

                    selectedCallback?.Invoke(SelectedPosition);
                }
            }
            catch (System.Exception e)
            {
//#if UNITY_ANDROID && !UNITY_EDITOR
//                AndroidAdbLog.LogInfo(e.ToString());
//#endif
                Debugger.Log(e.ToString());
                Debugger.Log(Input.mousePosition);
            }
        }
    }
Example #5
0
 protected override void Update()
 {
     if (isOpened)
     {
         if (!isClosing)
         {
             if (selectCondition.Evaluate())
             {
                 RectTransformUtility.ScreenPointToLocalPointInRectangle
                     (MiniMapImage, CrossInput.Position, null, out Vector2 local);
                 SetNavigateIcon(local);
             }
         }
         else
         {
             closeCounter += Time.deltaTime;
             if (closeCounter >= delayCloseMiniMap)
             {
                 Close();
             }
         }
     }
 }