Beispiel #1
0
        public void Init()
        {
            if (m_terrain == null)
            {
                m_terrain = new EPMDelaunayTerrain();
            }

            if (m_materialAgent == null)
            {
                m_materialAgent = new EPMMaterialAgent();
                foreach (EPMPoint.PointType t in System.Enum.GetValues(typeof(EPMPoint.PointType)))
                {
                    Color color = EPMMaterialAgent.GetDefaultColor(t);
                    g_typeColorDic.Add(t, color);
                    m_materialAgent.SetColor(t, color);
                }
            }

            m_hillHalfWidth         = 10f;
            m_roadHalfWidth         = 4f;
            m_riverHalfWidth        = 4f;
            m_islandBorderHalfWidth = 5f;
            m_mountainRadius        = 30f;
            m_defaultHillHeight     = 30f;
            m_defaultMountainHeight = 60f;
        }
Beispiel #2
0
        public void ReDrawTexture()
        {
            if (m_creator == null)
            {
                return;
            }

            textureHeight = Mathf.RoundToInt(m_creator.g_customData.terrainLength / scale);
            textureWidth  = Mathf.RoundToInt(m_creator.g_customData.terrainWidth / scale);

            originTexture.Resize(textureWidth, textureHeight);
            showTexture.Resize(textureWidth, textureHeight);

            RedrawBase();

            ReDrawLineSections(m_creator.g_customData.hillLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.Hill));
            ReDrawLineSections(m_creator.g_customData.roadLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.Road));
            ReDrawLineSections(m_creator.g_customData.riverLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.River));
            ReDrawCicleSections(m_creator.g_customData.mountainLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.Mountain), Mathf.RoundToInt(30 / scale));
            ReDrawLineSections(m_creator.g_customData.sandGroundLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.Sand));
            ReDrawLineSections(m_creator.g_customData.soilGroundLists, EPMMaterialAgent.GetDefaultColor(EPMPoint.PointType.Soil));
            showTexture.Apply();
            originTexture.Apply();
        }