Пример #1
0
    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;
    }
Пример #2
0
    void Awake()
    {
        State = StateEnum.Idle;
        HideUI();
        enabled = true;

        _directionWalker   = Walker.GetComponent <DirectionWalker>();
        _pathfindingWalker = Walker.GetComponent <PathfindingWalker>();
    }
Пример #3
0
    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);
    }
Пример #4
0
    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);
        }
    }
Пример #5
0
 public void Init(Unit playerUnit)
 {
     PlayerWalker = playerUnit.Walker;
 }
Пример #6
0
    void Awake()
    {
        State = StateEnum.Idle;
        HideUI();
        enabled = true;

        _directionWalker = Walker.GetComponent<DirectionWalker>();
        _pathfindingWalker = Walker.GetComponent<PathfindingWalker>();
    }