Esempio n. 1
0
        private void MoveToTile(Vector3 position)
        {
            if (CanMove(position))
            {
                var cp = tileMap.WorldToCell(position);
                position = tileMap.CellToWorld(cp);

                characterClass.currectTile = cp;
                characterClass.MoveToPosition(position);

                gameScript.UpdateMove(-1);
            }
        }
Esempio n. 2
0
        void Start()
        {
            tileMapGenerator.Generate();
            var cp = new Vector3Int(tileMapGenerator.tileMapHeight - 1, tileMapGenerator.tileMapHeight - 1, 0);

            characterClass2.currectTile = cp;
            characterClass2.MoveToPosition(tileMapGenerator.tileMap.CellToWorld(cp));

            characterController            = new CharactController_();
            characterController.gameScript = this;
            characterController.tileMap    = tileMapGenerator.tileMap;

            GetComponent <GamepadGeneric>().controller = characterController;


            SetNewTurn();
        }