private void Update() { if (CurrentPosition == LastPosition) { return; } ResetAssistPlaneRotation(); var dragDisplacement = CurrentPosition - LastPosition; var cameraDisplacement = Mode * dragDisplacement * 0.03f; MainCameraTra.Translate(cameraDisplacement.x, 0, cameraDisplacement.y, AssistPlane); var cam = MainCameraTra.GetComponent <Camera>(); var ray0 = cam.ScreenPointToRay(Cursor.position); var destination = ray0.GetPoint(-ray0.origin.y / ray0.direction.y); if (InSceneCursor) { InSceneCursor.position = destination.SetV3Y(0.1f); } if (!PlayerWalker) { PlayerWalker = MainController.Instance.FocusedUnit ? MainController.Instance.FocusedUnit.GetComponent <PathfindingWalker>() : null; } if (PlayerWalker) { PlayerWalker.WalkTo(destination); } LastPosition = CurrentPosition; }
void Awake() { State = StateEnum.Idle; HideUI(); enabled = true; _directionWalker = Walker.GetComponent <DirectionWalker>(); _pathfindingWalker = Walker.GetComponent <PathfindingWalker>(); }
public void Init() { _directionWalker = Walker.GetComponent<DirectionWalker>(); _pathfindingWalker = Walker.GetComponent<PathfindingWalker>(); State = StateEnum.Idle; TouchCircle.gameObject.SetActive(false); TouchSpot.gameObject.SetActive(false); DragDrop.gameObject.SetActive(false); if (JoystickAssistCircle) JoystickAssistCircle.gameObject.SetActive(false); if (JoystickAssistSpot) JoystickAssistSpot.gameObject.SetActive(false); }
public void Init() { _directionWalker = Walker.GetComponent <DirectionWalker>(); _pathfindingWalker = Walker.GetComponent <PathfindingWalker>(); State = StateEnum.Idle; TouchCircle.gameObject.SetActive(false); TouchSpot.gameObject.SetActive(false); DragDrop.gameObject.SetActive(false); if (JoystickAssistCircle) { JoystickAssistCircle.gameObject.SetActive(false); } if (JoystickAssistSpot) { JoystickAssistSpot.gameObject.SetActive(false); } }
public void Init(Unit playerUnit) { PlayerWalker = playerUnit.Walker; }
void Awake() { State = StateEnum.Idle; HideUI(); enabled = true; _directionWalker = Walker.GetComponent<DirectionWalker>(); _pathfindingWalker = Walker.GetComponent<PathfindingWalker>(); }