예제 #1
0
 public void ResetVisability()
 {
     if (m_visibilityCount > 0)
     {
         m_visibilityCount = 0;
         HexCellDataShader.RefreshVisibility(this);
     }
 }
예제 #2
0
 public void DecreaseVisibility()
 {
     m_visibilityCount--;
     if (m_visibilityCount == 0)
     {
         HexCellDataShader.RefreshVisibility(this);
     }
 }
예제 #3
0
 public void IncreaseVisibility()
 {
     m_visibilityCount++;
     if (m_visibilityCount == 1)
     {
         IsExplored = true;
         HexCellDataShader.RefreshVisibility(this);
     }
 }
예제 #4
0
    void Awake()
    {
        HexMetrics.NoiseSource = NoiseSource;
        HexMetrics.InitialiseHashGrid(Seed);
        HexUnit.UnitPrefab          = HexUnitPrefab;
        m_hexCellShaderData         = gameObject.AddComponent <HexCellDataShader>();
        m_hexCellShaderData.HexGrid = this;

        CreateMap(CellCountX, CellCountZ, Wrap);
    }
예제 #5
0
    public void Load(BinaryReader binReader)
    {
        m_terrainTypeIndex    = binReader.ReadByte();
        m_elevation           = binReader.ReadByte();
        IsExplored            = binReader.ReadBoolean();
        m_waterLevel          = binReader.ReadByte();
        m_urbanDensityLevel   = binReader.ReadByte();
        m_farmDensityLevel    = binReader.ReadByte();
        m_plantDensityLevel   = binReader.ReadByte();
        m_specialFeatureIndex = binReader.ReadByte();
        m_walled                 = binReader.ReadBoolean();
        m_hasIncomingRiver       = binReader.ReadBoolean();
        m_incomingRiverDirection = (HexDirection)binReader.ReadByte();
        m_hasOutgoingRiver       = binReader.ReadBoolean();
        m_outgoingRiverDirection = (HexDirection)binReader.ReadByte();
        for (int i = 0; i < m_roads.Length; ++i)
        {
            m_roads[i] = binReader.ReadBoolean();
        }

        HexCellDataShader.RefreshTerrain(this);
        RefreshPosition();
    }
예제 #6
0
 public void SetMapData(float value)
 {
     HexCellDataShader.SetMapData(this, value);
 }