Exemplo n.º 1
0
        public Creature Clone()
        {
            var creature =
                new Creature(CreatureStructure.Clone(), MovementPatterns.Select(m => m.Clone()))
            {
                Name = Name, Description = Description
            };

            return(creature);
        }
Exemplo n.º 2
0
    void FindAndLoadResources()
    {
        _board = GameObject.Find("Board").GetComponent <Board>();

        // get the size of each space from the Board component
        if (_board != null)
        {
            _spaceSize = _board.getSpaceSize();
        }

        _player = GameObject.Find("Player_" + _playerOwner).GetComponent <Player>();

        // get the size of each space from the Board component
        if (_player == null)
        {
            Debug.LogError("Player is null ::Creature.cs::Start()");
        }

        _gameData = GameObject.Find("Game_Data").GetComponent <GameData>();

        if (_gameData == null)
        {
            Debug.LogError("Game Data object is NULL");
        }

        _movementPatterns = _gameData.GetComponent <MovementPatterns>();

        if (_movementPatterns == null)
        {
            Debug.LogError("Movement Patterns script is NULL and should be on Game Data object");
        }

        _attackPatterns = _gameData.GetComponent <AttackPatterns>();

        if (_attackPatterns == null)
        {
            Debug.LogError("Attack Patterns script is NULL and should be on Game Data object");
        }
    }