コード例 #1
0
ファイル: Hex.cs プロジェクト: Zarrrah/Team-Project
    //Returns the terrain difficulty modifier as a float, is taken into account but currently tiles dont have different modifiers
    private float GetTerrainDifficulty(TerrainMovementModifier i)
    {
        switch (i)
        {
        case TerrainMovementModifier.Easy:
            return(0.75f);

        case TerrainMovementModifier.Normal:
            return(1.0f);

        case TerrainMovementModifier.Hard:
            return(1.25f);

        default:
            return(1.0f);
        }
    }
コード例 #2
0
ファイル: Hex.cs プロジェクト: Zarrrah/Team-Project
    private void Start()
    {
        //Sets the value of all required variables
        _map = this.transform.parent.GetComponent <Map>();
        uint _numberOfPlayers = _map.GetNumberOfPlayers();

        _factionInfluence = new bool[_numberOfPlayers];

        _renderer = this.transform.GetComponent <SpriteRenderer>();



        _movementRequirement = 1.0f;
        _movementRestriction = MovementType.Passable;
        _movementModifer     = TerrainMovementModifier.Normal;

        if (_cooridnates._x == 3 && _cooridnates._y == 3)
        {
            Colour = Color.black;
            _movementRequirement = 5;
        }
    }