Пример #1
0
    void Start()
    {
        cursorIndicater = Instantiate(cursorIndicaterPrefab);
        cursorIndicater.SetActive(false);

        mainCharacter = FindObjectOfType <MainCharacter>();

        updateMousePoint = () =>
        {
            unitCursor.inputMousePosition(Input.mousePosition);
            if (unitCursor.HasFoundTile())
            {
                cursorIndicater.transform.position = unitCursor.GetSpawnPoint(false);
                cursorIndicater.SetActive(true);
                mainCharacter.LookAt(unitCursor.GetSpawnPoint(false));
            }
            else
            {
                cursorIndicater.SetActive(false);
            }
        };

        onPressMouseLeftButtonDown = () =>
        {
            ClickTileOrUI(true);
        };

        onPressMouseRightButtonDown = () =>
        {
            ClickTileOrUI(false);
        };

        onPressEsc = () =>
        {
            SceneInitializer.Instance.InitializeScene(SceneType.Level);
        };
    }