Inheritance: MonoBehaviour
Beispiel #1
0
 public static bool isPassableWater(Terrains tag)
 {
     return(tag == Terrains.Water ||
            tag == Terrains.StillWater ||
            tag == Terrains.DeepWater ||
            tag == Terrains.WaterfallCrest);
 }
Beispiel #2
0
        public TerrainEditorDataContext()
        {
            Terrains.Add(new Terrain(new[]
            {
                new VertexInfo(-5, 5),
                new VertexInfo(5, 5),
                new VertexInfo(5, -5),
                new VertexInfo(-5, -5)
            })
            {
                UvMapping    = UvMapping.Mossy,
                FillMode     = FillMode.Fill,
                IsClosed     = true,
                SmoothFactor = 5
            });


            Urho.Application.Started += () =>
            {
                m_terrainNodes = ServiceLocator.Get <IUrho3DService>().Scene.CreateChild("TerrainNodes");

                var resource = ServiceLocator.Get <IResourceProviderService>().LoadResource(new FileInfo("Mossy.uvmapping"));
                SelectedTerrain.UvMapping = (UvMapping)resource;

                m_terrainNodes.AddChild(SelectedTerrain.MeshNode);

                new RecursivePropertyChangeListener(Terrains, nameof(Terrains)).PropertyChanged += (sender, args) =>
                {
                    m_terrainNodes.RemoveChildren(true, true, false);
                    m_terrainNodes.AddChild(SelectedTerrain.MeshNode);
                };
            };
            SelectedTerrain = Terrains[0];
        }
Beispiel #3
0
    static public float[] LoadPlanet1(Planet planet, StreamReader planetFile)
    {
        float[]    alts     = new float[planet.geometry.vertices.Length];
        Terrains[] terrains = new Terrains[planet.geometry.nmbrHexs];
        // get alts
        for (int v = 0; v < planet.geometry.nmbrHexs; v++)
        {
            string myString = planetFile.ReadLine();
            alts[v] = float.Parse(myString);
        }
        //get terrain types
        for (int v = 0; v < planet.geometry.nmbrHexs; v++)
        {
            string terrainString = planetFile.ReadLine();
            terrains[v] = TerrainTypeParse(terrainString);
        }
        string s = planetFile.ReadLine();

        s = planetFile.ReadLine();
        planet.turnCtr = int.Parse(s);
        s = planetFile.ReadLine();
        s = planetFile.ReadLine();
        planet.numberOfFactions = int.Parse(s);
        return(alts);
    }
Beispiel #4
0
 public static bool isGrass(Terrains tag)
 {
     return(tag == Terrains.Grass ||
            tag == Terrains.TallGrass ||
            tag == Terrains.UnderwaterGrass ||
            tag == Terrains.SootGrass);
 }
Beispiel #5
0
 public static void Register(TerrainGenerator t)
 {
     if (!Terrains.Contains(t) && t != null)
     {
         Terrains.Add(t);
     }
 }
 public void changerTerrain(Terrains t, bool cache)
 {
     if (cache) {
         SC_GenerateurPlanete.instance.changeHexagoneTextureCache (coordX,coordZ,t);
     } else {
         SC_GenerateurPlanete.instance.changeHexagoneTexture (coordX,coordZ,t);
     }
 }
 public Tile(
     TileName name,
     string displayName,
     string description,
     Terrains terrain,
     float movementCost,
     bool allowsBuilding) : base(name, displayName, description)
 {
     Terrain        = terrain;
     MovementCost   = movementCost;
     AllowsBuilding = allowsBuilding;
 }
Beispiel #8
0
        public static void CheckTerrainMapChanged(Texture2D tex)
        {
            Terrains.RemoveAll(t => t == null);
            for (int i = 0; i < Terrains.Count; ++i)
            {
                if (Terrains[i].HeightMap == null)
                {
                    continue;
                }

                if (IsPointingToSameTexture(Terrains[i].HeightMap, tex))
                {
                    TerrainsToUpdate.Add(Terrains[i]);
                }
            }
        }
    public void changeHexagoneTextureCache(int x, int z, Terrains typeTerrain)
    {
        //float[, ,] alphas = data.GetAlphamaps(0, 0, data.alphamapWidth, data.alphamapHeight);
        GameObject kase = GestionnaireDePartie.instance.obtenirCase (x, z).tuile;
        float cX = kase.transform.position.x;
        float cZ = kase.transform.position.z;
        float tX = terrain.transform.position.x;
        float tZ = terrain.transform.position.z;
        int patchMinX = (int) Mathf.Floor((cX - tX -(0.5f * lx)) / dx);
        int patchMinZ = (int) Mathf.Floor((cZ - tZ -(0.5f * lz)) / dz);
        int patchMaxX = (int) Mathf.Ceil((cX + (0.5f * lx) - tX) / dx);
        int patchMaxZ = (int) Mathf.Ceil((cZ + (0.5f * lz) - tZ) / dz);

        /*		Debug.Log("dx: " + dx);
        Debug.Log("dz: " + dz);
        Debug.Log("Position hexagone X: " + kase.transform.position.x);
        Debug.Log("Position hexagone Z: " + kase.transform.position.z);
        Debug.Log("Position terrain X: " + terrain.transform.position.x);
        Debug.Log("Position terrain Z: " + terrain.transform.position.z);
        Debug.Log("Position terrain patchMinX: " + patchMinX);
        Debug.Log("Position terrain patchMaxX: " + patchMaxX);
        Debug.Log("Position terrain patchMinZ: " + patchMinZ);
        Debug.Log("Position terrain patchMaxZ: " + patchMaxZ);*/

        //	for (int i = 0; i < data.alphamapWidth; i++) {
        //		for (int j = 0; j < data.alphamapHeight; j++) {
        //2*v*h – v*q2.x -h*q2.y
        float v = lz / 4.0f;
        float h = lx / 2.0f;
        for (int i = patchMinX; i < patchMaxX; i++) {
            for (int j = patchMinZ; j < patchMaxZ; j++) {
                float newX = Mathf.Abs((i*dx) + terrain.transform.position.x - kase.transform.position.x);
                float newZ = Mathf.Abs((j*dz) + terrain.transform.position.z - kase.transform.position.z);
                //	Debug.Log("i,j" + i + j + " nX, nZ : " + newX + " " + newZ);
                if (2*v*h - v*newZ - h*newX >= 0) {
                    foreach (Terrains t in Enum.GetValues(typeof(Terrains)))
                    {
                        cacheAlphamap[j, i, (int) t] = 0;
                    }
                    //		Debug.Log("Type ter : " + typeTerrain + " " + (int) typeTerrain);
                    cacheAlphamap[j, i, (int) typeTerrain] = 100;
                }

            }
        }
        //	data.SetAlphamaps(0, 0, alphas);
    }
Beispiel #10
0
        public Tile Get(int id)
        {
            if (TilePool.ContainsKey(id))
            {
                return(TilePool[id]);
            }

            object gameObjectConfiguration = Terrains.GetById(id);

            Type type = gameObjectConfiguration.GetType();

            string spriteSheetName     = type.GetProperty("spriteSheetName").GetValue(gameObjectConfiguration, null).ToString();
            string spriteSheetMappingX = type.GetProperty("spriteSheetMappingX").GetValue(gameObjectConfiguration, null).ToString();
            string spriteSheetMappingY = type.GetProperty("spriteSheetMappingY").GetValue(gameObjectConfiguration, null).ToString();

            return(new Tile(spriteSheetName, Int32.Parse(spriteSheetMappingX), Int32.Parse(spriteSheetMappingY)));
        }
Beispiel #11
0
        public TerrainEditorDataContext()
        {
            new PropertyChangeListener(Terrains).PropertyChanged += (sender, args) => OnPropertyChanged(nameof(TerrainsMeshes));

            Terrains.Add(new DynamicMesh(new[]
            {
                new VertexInfo(-5, 5),
                new VertexInfo(5, 5),
                new VertexInfo(5, -4),
                new VertexInfo(-5, -4)
            })
            {
                UvMapping             = UvMapping.Mossy,
                FillMode              = FillMode.Fill,
                IsClosed              = true,
                SplitCornersThreshold = 90,
                SmoothFactor          = 5
            });

            SelectedTerrain = Terrains[0];
        }
Beispiel #12
0
 public static float[] LoadPlanet1(Planet planet, StreamReader planetFile)
 {
     float[] alts = new float[planet.geometry.vertices.Length];
     Terrains[] terrains = new Terrains[planet.geometry.nmbrHexs];
     // get alts
     for (int v=0; v<planet.geometry.nmbrHexs; v++)
     {
         string myString = planetFile.ReadLine();
         alts[v] = float.Parse(myString);
     }
     //get terrain types
     for (int v=0; v<planet.geometry.nmbrHexs; v++)
     {
         string terrainString = planetFile.ReadLine();
         terrains[v] = TerrainTypeParse(terrainString);
     }
     string s = planetFile.ReadLine();
     s = planetFile.ReadLine();
     planet.turnCtr = int.Parse(s);
     s = planetFile.ReadLine();
     s = planetFile.ReadLine();
     planet.numberOfFactions = int.Parse(s);
     return alts;
 }
Beispiel #13
0
 /// <summary>
 /// The Poké Radar only works in these tiles
 /// </summary>
 /// <param name="tag"></param>
 /// <returns></returns>
 public static bool isJustGrass(Terrains tag)
 {
     return(tag == Terrains.Grass ||
            tag == Terrains.SootGrass);
 }
 // Token: 0x06004898 RID: 18584 RVA: 0x0011232C File Offset: 0x0011052C
 public void ODOCOQCCOC(Transform tr, ArrayList arr, string[] DOODQOQO, string[] OODDQOQO)
 {
     global::RoadObjectScript.version    = "2.4.6";
     global::RoadObjectScript.OODCDOQDCC = (GUISkin)UnityEngine.Resources.Load("ER3DSkin", typeof(GUISkin));
     global::RoadObjectScript.OQOOODODQD = (Texture2D)UnityEngine.Resources.Load("ER3DLogo", typeof(Texture2D));
     if (global::RoadObjectScript.objectStrings == null)
     {
         global::RoadObjectScript.objectStrings    = new string[3];
         global::RoadObjectScript.objectStrings[0] = "Road Object";
         global::RoadObjectScript.objectStrings[1] = "River Object";
         global::RoadObjectScript.objectStrings[2] = "Procedural Mesh Object";
     }
     this.obj        = tr;
     this.OOQQCODOCD = new OQCDQQDQCC();
     this.OODCCOODCC = this.obj.GetComponent <global::RoadObjectScript>();
     foreach (object obj in this.obj)
     {
         Transform transform = (Transform)obj;
         if (transform.name == "Markers")
         {
             this.OODDDCQCOC = transform;
         }
     }
     OQCDQQDQCC.terrainList.Clear();
     Terrain[] array = (Terrain[])Object.FindObjectsOfType(typeof(Terrain));
     foreach (Terrain terrain in array)
     {
         Terrains terrains = new Terrains();
         terrains.terrain = terrain;
         if (!terrain.gameObject.GetComponent <global::EasyRoads3DTerrainID>())
         {
             global::EasyRoads3DTerrainID easyRoads3DTerrainID = (global::EasyRoads3DTerrainID)terrain.gameObject.AddComponent("EasyRoads3DTerrainID");
             string text = Random.Range(100000000, 999999999).ToString();
             easyRoads3DTerrainID.terrainid = text;
             terrains.id = text;
         }
         else
         {
             terrains.id = terrain.gameObject.GetComponent <global::EasyRoads3DTerrainID>().terrainid;
         }
         this.OOQQCODOCD.OCDQQCDOQO(terrains);
     }
     ODCDDDDQQD.OCDQQCDOQO();
     if (this.roadMaterialEdit == null)
     {
         this.roadMaterialEdit = (Material)UnityEngine.Resources.Load("materials/roadMaterialEdit", typeof(Material));
     }
     if (this.objectType == 0 && GameObject.Find(base.gameObject.name + "/road") == null)
     {
         GameObject gameObject = new GameObject("road");
         gameObject.transform.parent = base.transform;
     }
     this.OOQQCODOCD.OODQOQCDCQ(this.obj, global::RoadObjectScript.OCQCDDDOCC, this.OODCCOODCC.roadWidth, this.surfaceOpacity, ref this.OOCCDCOQCQ, ref this.indent, this.applyAnimation, this.waveSize, this.waveHeight);
     this.OOQQCODOCD.ODDQCCDCDC       = this.ODDQCCDCDC;
     this.OOQQCODOCD.OOCQDOOCQD       = this.OOCQDOOCQD;
     this.OOQQCODOCD.OdQODQOD         = this.OdQODQOD + 1;
     this.OOQQCODOCD.OOQQQDOD         = this.OOQQQDOD;
     this.OOQQCODOCD.OOQQQDODOffset   = this.OOQQQDODOffset;
     this.OOQQCODOCD.OOQQQDODLength   = this.OOQQQDODLength;
     this.OOQQCODOCD.objectType       = this.objectType;
     this.OOQQCODOCD.snapY            = this.snapY;
     this.OOQQCODOCD.terrainRendered  = this.ODODCOCCDQ;
     this.OOQQCODOCD.handleVegetation = this.handleVegetation;
     this.OOQQCODOCD.raise            = this.raise;
     this.OOQQCODOCD.roadResolution   = this.roadResolution;
     this.OOQQCODOCD.multipleTerrains = this.multipleTerrains;
     this.OOQQCODOCD.editRestore      = this.editRestore;
     this.OOQQCODOCD.roadMaterialEdit = this.roadMaterialEdit;
     if (global::RoadObjectScript.backupLocation == 0)
     {
         OOCDQCOODC.backupFolder = "/EasyRoads3D";
     }
     else
     {
         OOCDQCOODC.backupFolder = "/Assets/EasyRoads3D/backups";
     }
     this.ODODQOQO    = this.OOQQCODOCD.OCDODCOCOC();
     this.ODODQOQOInt = this.OOQQCODOCD.OCCQOQCQDO();
     if (this.ODODCOCCDQ)
     {
         this.doRestore = true;
     }
     this.OOQODQOCOC();
     if (arr != null || global::RoadObjectScript.ODODQOOQ == null)
     {
         this.OOOOOOODCD(arr, DOODQOQO, OODDQOQO);
     }
     if (this.doRestore)
     {
         return;
     }
 }
Beispiel #15
0
 public static bool isJustWater(Terrains tag)
 {
     return(tag == Terrains.Water ||
            tag == Terrains.StillWater ||
            tag == Terrains.DeepWater);
 }
Beispiel #16
0
 public bool TryGetTerrain(string tag, out TerrainGraphic g)
 {
     return(Terrains.TryGetValue(tag, out g));
 }
Beispiel #17
0
 public static bool onlyWalk(Terrains tag)
 {
     return(tag == Terrains.TallGrass ||
            tag == Terrains.Ice);
 }
Beispiel #18
0
 public static bool isBridge(Terrains tag)
 {
     return(tag == Terrains.Bridge);
 }
Beispiel #19
0
 public Biome(Terrains terrain, int plant)
 {
     this.terrain = terrain;
     this.plant   = plant;
 }
 public SimpleVehicleFactory(Terrains terrain)
 {
     this._terrain = terrain;
 }
 public void Remove(Terrain.Terrain terrain)
 {
     ScreenObjects.Remove(terrain);
     Terrains.Remove(terrain);
 }
 public void Add(Terrain.Terrain terrain)
 {
     ScreenObjects.Add(terrain);
     Terrains.Add(terrain);
 }
Beispiel #23
0
 public static bool isLedge(Terrains tag)
 {
     return(tag == Terrains.Ledge);
 }
Beispiel #24
0
 public static bool isIce(Terrains tag)
 {
     return(tag == Terrains.Ice);
 }
    public void OODDQODCCQ(Transform tr, ArrayList arr, String[] DOODQOQO, String[] OODDQOQO)
    {
        version = "2.4.7";
        ODOOCDQODD = (GUISkin)Resources.Load("ER3DSkin", typeof(GUISkin));

        OQOCDODQOD = (Texture2D)Resources.Load("ER3DLogo", typeof(Texture2D));
        if(RoadObjectScript.objectStrings == null){
        RoadObjectScript.objectStrings = new string[3];
        RoadObjectScript.objectStrings[0] = "Road Object"; RoadObjectScript.objectStrings[1]="River Object";RoadObjectScript.objectStrings[2]="Procedural Mesh Object";
        }
        obj = tr;
        OCDQDOOOCO = new OQQCODDDQQ();
        OODQDDOOQC = obj.GetComponent<RoadObjectScript>();
        foreach(Transform child in obj){
        if(child.name == "Markers") OODDOCQDQO = child;
        }
        OQQCODDDQQ.terrainList.Clear();
        Terrain[] terrains = (Terrain[])FindObjectsOfType(typeof(Terrain));
        foreach(Terrain terrain in terrains) {
        Terrains t = new Terrains();
        t.terrain = terrain;
        if(!terrain.gameObject.GetComponent<EasyRoads3DTerrainID>()){
        EasyRoads3DTerrainID terrainscript = (EasyRoads3DTerrainID)terrain.gameObject.AddComponent<EasyRoads3DTerrainID>();
        string id = UnityEngine.Random.Range(100000000,999999999).ToString();
        terrainscript.terrainid = id;
        t.id = id;
        }else{
        t.id = terrain.gameObject.GetComponent<EasyRoads3DTerrainID>().terrainid;
        }
        OCDQDOOOCO.OCCCOCQQCO(t);
        }
        ODDQOOCDOC.OCCCOCQQCO();
        if(roadMaterialEdit == null){
        roadMaterialEdit = (Material)Resources.Load("materials/roadMaterialEdit", typeof(Material));
        }
        if(objectType == 0 && GameObject.Find(gameObject.name + "/road") == null){
        GameObject road = new GameObject("road");
        road.transform.parent = transform;
        }

        OCDQDOOOCO.OCOCQCCDCD(obj, ODQCOQQQOC, OODQDDOOQC.roadWidth, surfaceOpacity, out OQODOQQDDQ, out indent, applyAnimation, waveSize, waveHeight);
        OCDQDOOOCO.OQCOOCDOCO = OQCOOCDOCO;
        OCDQDOOOCO.OCQOCOCDOQ = OCQOCOCDOQ;
        OCDQDOOOCO.OdQODQOD = OdQODQOD + 1;
        OCDQDOOOCO.OOQQQDOD = OOQQQDOD;
        OCDQDOOOCO.OOQQQDODOffset = OOQQQDODOffset;
        OCDQDOOOCO.OOQQQDODLength = OOQQQDODLength;
        OCDQDOOOCO.objectType = objectType;
        OCDQDOOOCO.snapY = snapY;
        OCDQDOOOCO.terrainRendered = OQDDDOQQOC;
        OCDQDOOOCO.handleVegetation = handleVegetation;
        OCDQDOOOCO.raise = raise;
        OCDQDOOOCO.roadResolution = roadResolution;
        OCDQDOOOCO.multipleTerrains = multipleTerrains;
        OCDQDOOOCO.editRestore = editRestore;
        OCDQDOOOCO.roadMaterialEdit = roadMaterialEdit;
        OCDQDOOOCO.renderRoad = renderRoad;
        if(backupLocation == 0)OQDCCCDDCD.backupFolder = "/EasyRoads3D";
        else OQDCCCDDCD.backupFolder =  "/Assets/EasyRoads3D/backups";

        ODODQOQO = OCDQDOOOCO.OODQDQDDCC();
        ODODQOQOInt = OCDQDOOOCO.ODOOQODCQO();

        if(OQDDDOQQOC){

        doRestore = true;
        }

        OCCCQCDCDC();

        if(arr != null || ODODQOOQ == null) OOODOQCDDD(arr, DOODQOQO, OODDQOQO);

        if(doRestore) return;
    }
Beispiel #26
0
 public static bool hasReflections(Terrains tag)
 {
     return(tag == Terrains.StillWater ||
            tag == Terrains.Puddle);
 }
Beispiel #27
0
    public override void OnInspectorGUI()
    {
        GUIStyle styleFold = EditorStyles.foldout;

        styleFold.fontStyle = FontStyle.Bold;
        styleFold.fontSize  = 14;
        Terrains ter = (Terrains)target;

        serializedObject.Update();
        statusHeight = EditorGUILayout.Foldout(statusHeight, "Height Noise", styleFold);
        if (statusHeight)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightOctaves"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightFrequency"));
            EditorGUILayout.EndVertical();
        }

        statusHeightMap = EditorGUILayout.Foldout(statusHeightMap, "Height Map", styleFold);
        if (statusHeightMap)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("mountValue"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("deepValue"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightDeep"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightWater"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightBeach"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightGrass"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightForest"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heightRock"));
            EditorGUILayout.EndVertical();
        }
        statusHeat = EditorGUILayout.Foldout(statusHeat, "Heat Noise", styleFold);
        if (statusHeat)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heatOctaves"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("heatFrequency"));
            EditorGUILayout.EndVertical();
        }
        statusHeatMap = EditorGUILayout.Foldout(statusHeatMap, "Heat Map", styleFold);
        if (statusHeatMap)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("coldest"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("cold"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("warm"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("warmest"));
            EditorGUILayout.EndVertical();
        }
        statusMoinsture = EditorGUILayout.Foldout(statusMoinsture, "Moinsture Noise", styleFold);
        if (statusMoinsture)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("moinstureOctaves"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("moinstureFrequency"));
            EditorGUILayout.EndVertical();
        }
        statusMoinstureMap = EditorGUILayout.Foldout(statusMoinstureMap, "Moinsture Map", styleFold);
        if (statusMoinstureMap)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("dryest"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("dry"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("wet"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("wetter"));
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.PropertyField(serializedObject.FindProperty("textures"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("prefChunk"));
        serializedObject.ApplyModifiedProperties();
    }
Beispiel #28
0
 public static bool isSurfable(Terrains tag)
 {
     return(isWater(tag));
 }
Beispiel #29
0
 // Méthode pour ajouter un terrain
 public void AjouterTerrain(Terrain C)
 {
     Terrains.Add(C);
 }
Beispiel #30
0
 public void Add(TerrainGraphic g)
 {
     Terrains.Add(g.GraphicTag, g);
 }
Beispiel #31
0
    public void ODOCOQCCOC(Transform tr, ArrayList arr, string[] DOODQOQO, string[] OODDQOQO)
    {
        version    = "2.4.6";
        OODCDOQDCC = (GUISkin)Resources.Load("ER3DSkin", typeof(GUISkin));
        OQOOODODQD = (Texture2D)Resources.Load("ER3DLogo", typeof(Texture2D));
        if (objectStrings == null)
        {
            objectStrings = new string[] { "Road Object", "River Object", "Procedural Mesh Object" };
        }
        this.obj        = tr;
        this.OOQQCODOCD = new OQCDQQDQCC();
        this.OODCCOODCC = this.obj.GetComponent <RoadObjectScript>();
        IEnumerator enumerator = this.obj.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform current = (Transform)enumerator.Current;
                if (current.name == "Markers")
                {
                    this.OODDDCQCOC = current;
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable == null)
            {
            }
            disposable.Dispose();
        }
        OQCDQQDQCC.terrainList.Clear();
        Terrain[] terrainArray = (Terrain[])Object.FindObjectsOfType(typeof(Terrain));
        foreach (Terrain terrain in terrainArray)
        {
            Terrains t = new Terrains {
                terrain = terrain
            };
            if (terrain.gameObject.GetComponent <EasyRoads3DTerrainID>() == null)
            {
                EasyRoads3DTerrainID nid = (EasyRoads3DTerrainID)terrain.gameObject.AddComponent("EasyRoads3DTerrainID");
                string str = Random.Range(0x5f5e100, 0x3b9ac9ff).ToString();
                nid.terrainid = str;
                t.id          = str;
            }
            else
            {
                t.id = terrain.gameObject.GetComponent <EasyRoads3DTerrainID>().terrainid;
            }
            this.OOQQCODOCD.OCDQQCDOQO(t);
        }
        ODCDDDDQQD.OCDQQCDOQO();
        if (this.roadMaterialEdit == null)
        {
            this.roadMaterialEdit = (Material)Resources.Load("materials/roadMaterialEdit", typeof(Material));
        }
        if ((this.objectType == 0) && (GameObject.Find(base.gameObject.name + "/road") == null))
        {
            GameObject obj2 = new GameObject("road")
            {
                transform = { parent = base.transform }
            };
        }
        this.OOQQCODOCD.OODQOQCDCQ(this.obj, OCQCDDDOCC, this.OODCCOODCC.roadWidth, this.surfaceOpacity, out this.OOCCDCOQCQ, out this.indent, this.applyAnimation, this.waveSize, this.waveHeight);
        this.OOQQCODOCD.ODDQCCDCDC       = this.ODDQCCDCDC;
        this.OOQQCODOCD.OOCQDOOCQD       = this.OOCQDOOCQD;
        this.OOQQCODOCD.OdQODQOD         = this.OdQODQOD + 1;
        this.OOQQCODOCD.OOQQQDOD         = this.OOQQQDOD;
        this.OOQQCODOCD.OOQQQDODOffset   = this.OOQQQDODOffset;
        this.OOQQCODOCD.OOQQQDODLength   = this.OOQQQDODLength;
        this.OOQQCODOCD.objectType       = this.objectType;
        this.OOQQCODOCD.snapY            = this.snapY;
        this.OOQQCODOCD.terrainRendered  = this.ODODCOCCDQ;
        this.OOQQCODOCD.handleVegetation = this.handleVegetation;
        this.OOQQCODOCD.raise            = this.raise;
        this.OOQQCODOCD.roadResolution   = this.roadResolution;
        this.OOQQCODOCD.multipleTerrains = this.multipleTerrains;
        this.OOQQCODOCD.editRestore      = this.editRestore;
        this.OOQQCODOCD.roadMaterialEdit = this.roadMaterialEdit;
        if (backupLocation == 0)
        {
            OOCDQCOODC.backupFolder = "/EasyRoads3D";
        }
        else
        {
            OOCDQCOODC.backupFolder = "/Assets/EasyRoads3D/backups";
        }
        this.ODODQOQO    = this.OOQQCODOCD.OCDODCOCOC();
        this.ODODQOQOInt = this.OOQQCODOCD.OCCQOQCQDO();
        if (this.ODODCOCCDQ)
        {
            this.doRestore = true;
        }
        this.OOQODQOCOC();
        if ((arr != null) || (ODODQOOQ == null))
        {
            this.OOOOOOODCD(arr, DOODQOQO, OODDQOQO);
        }
        if (!this.doRestore)
        {
        }
    }
Beispiel #32
0
 public void ODOCOQCCOC(Transform tr, ArrayList arr, string[] DOODQOQO, string[] OODDQOQO)
 {
     RoadObjectScript.version = "2.4.6";
     RoadObjectScript.OODCDOQDCC = (GUISkin)UnityEngine.Resources.Load("ER3DSkin", typeof(GUISkin));
     RoadObjectScript.OQOOODODQD = (Texture2D)UnityEngine.Resources.Load("ER3DLogo", typeof(Texture2D));
     if (RoadObjectScript.objectStrings == null)
     {
         RoadObjectScript.objectStrings = new string[] { "Road Object", "River Object", "Procedural Mesh Object" };
     }
     this.obj = tr;
     this.OOQQCODOCD = new OQCDQQDQCC();
     this.OODCCOODCC = this.obj.GetComponent<RoadObjectScript>();
     IEnumerator enumerator = this.obj.GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             Transform current = (Transform)enumerator.Current;
             if (current.name != "Markers")
             {
                 continue;
             }
             this.OODDDCQCOC = current;
         }
     }
     finally
     {
         IDisposable disposable = enumerator as IDisposable;
         if (disposable == null)
         {
         }
         disposable.Dispose();
     }
     OQCDQQDQCC.terrainList.Clear();
     Terrain[] terrainArray = (Terrain[])UnityEngine.Object.FindObjectsOfType(typeof(Terrain));
     for (int i = 0; i < (int)terrainArray.Length; i++)
     {
         Terrain terrain = terrainArray[i];
         Terrains component = new Terrains()
         {
             terrain = terrain
         };
         if (terrain.gameObject.GetComponent<EasyRoads3DTerrainID>())
         {
             component.id = terrain.gameObject.GetComponent<EasyRoads3DTerrainID>().terrainid;
         }
         else
         {
             EasyRoads3DTerrainID easyRoads3DTerrainID = (EasyRoads3DTerrainID)terrain.gameObject.AddComponent("EasyRoads3DTerrainID");
             string str = UnityEngine.Random.Range(100000000, 999999999).ToString();
             easyRoads3DTerrainID.terrainid = str;
             component.id = str;
         }
         this.OOQQCODOCD.OCDQQCDOQO(component);
     }
     ODCDDDDQQD.OCDQQCDOQO();
     if (this.roadMaterialEdit == null)
     {
         this.roadMaterialEdit = (Material)UnityEngine.Resources.Load("materials/roadMaterialEdit", typeof(Material));
     }
     if (this.objectType == 0 && GameObject.Find(string.Concat(base.gameObject.name, "/road")) == null)
     {
         (new GameObject("road")).transform.parent = base.transform;
     }
     this.OOQQCODOCD.OODQOQCDCQ(this.obj, RoadObjectScript.OCQCDDDOCC, this.OODCCOODCC.roadWidth, this.surfaceOpacity, out this.OOCCDCOQCQ, out this.indent, this.applyAnimation, this.waveSize, this.waveHeight);
     this.OOQQCODOCD.ODDQCCDCDC = this.ODDQCCDCDC;
     this.OOQQCODOCD.OOCQDOOCQD = this.OOCQDOOCQD;
     this.OOQQCODOCD.OdQODQOD = this.OdQODQOD + 1;
     this.OOQQCODOCD.OOQQQDOD = this.OOQQQDOD;
     this.OOQQCODOCD.OOQQQDODOffset = this.OOQQQDODOffset;
     this.OOQQCODOCD.OOQQQDODLength = this.OOQQQDODLength;
     this.OOQQCODOCD.objectType = this.objectType;
     this.OOQQCODOCD.snapY = this.snapY;
     this.OOQQCODOCD.terrainRendered = this.ODODCOCCDQ;
     this.OOQQCODOCD.handleVegetation = this.handleVegetation;
     this.OOQQCODOCD.raise = this.raise;
     this.OOQQCODOCD.roadResolution = this.roadResolution;
     this.OOQQCODOCD.multipleTerrains = this.multipleTerrains;
     this.OOQQCODOCD.editRestore = this.editRestore;
     this.OOQQCODOCD.roadMaterialEdit = this.roadMaterialEdit;
     if (RoadObjectScript.backupLocation != 0)
     {
         OOCDQCOODC.backupFolder = "/Assets/EasyRoads3D/backups";
     }
     else
     {
         OOCDQCOODC.backupFolder = "/EasyRoads3D";
     }
     this.ODODQOQO = this.OOQQCODOCD.OCDODCOCOC();
     this.ODODQOQOInt = this.OOQQCODOCD.OCCQOQCQDO();
     if (this.ODODCOCCDQ)
     {
         this.doRestore = true;
     }
     this.OOQODQOCOC();
     if (arr != null || RoadObjectScript.ODODQOOQ == null)
     {
         this.OOOOOOODCD(arr, DOODQOQO, OODDQOQO);
     }
     if (this.doRestore)
     {
         return;
     }
 }
Beispiel #33
0
 public static void UnRegister(TerrainGenerator t)
 {
     Terrains.Remove(t);
 }
    public void ODOODDDODD(Transform tr, List <ODODDQQO> arr, String[] DOODQOQO, String[] OODDQOQO)
    {
        version    = "2.5.4";
        OODCOCOOCC = (GUISkin)Resources.Load("ER3DSkin", typeof(GUISkin));


        OQQOCCQOOC = (Texture2D)Resources.Load("ER3DLogo", typeof(Texture2D));
        if (RoadObjectScript.objectStrings == null)
        {
            RoadObjectScript.objectStrings    = new string[3];
            RoadObjectScript.objectStrings[0] = "Road Object"; RoadObjectScript.objectStrings[1] = "River Object"; RoadObjectScript.objectStrings[2] = "Procedural Mesh Object";
        }
        obj        = tr;
        OQCODQCQOC = new OCQCDCCDOC();
        ODOOCQDQCD = obj.GetComponent <RoadObjectScript>();
        foreach (Transform child in obj)
        {
            if (child.name == "Markers")
            {
                OCCQOQDDDO = child;
            }
        }
        RoadObjectScript[] rscrpts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
        OCQCDCCDOC.terrainList.Clear();
        Terrain[] terrains = (Terrain[])FindObjectsOfType(typeof(Terrain));
        foreach (Terrain terrain in terrains)
        {
            Terrains t = new Terrains();
            t.terrain = terrain;
            if (!terrain.gameObject.GetComponent <EasyRoads3DTerrainID>())
            {
                EasyRoads3DTerrainID terrainscript = (EasyRoads3DTerrainID)terrain.gameObject.AddComponent("EasyRoads3DTerrainID");
                string id = UnityEngine.Random.Range(100000000, 999999999).ToString();
                terrainscript.terrainid = id;
                t.id = id;
            }
            else
            {
                t.id = terrain.gameObject.GetComponent <EasyRoads3DTerrainID>().terrainid;
            }
            OQCODQCQOC.OQOOCOCDDQ(t);
        }
        OQCDOODQQQ.OQOOCOCDDQ();
        if (roadMaterialEdit == null)
        {
            roadMaterialEdit = (Material)Resources.Load("materials/roadMaterialEdit", typeof(Material));
        }
        if (objectType == 0 && GameObject.Find(gameObject.name + "/road") == null)
        {
            GameObject road = new GameObject("road");
            road.transform.parent = transform;
        }

        OQCODQCQOC.OQQDOCCQCD(obj, OCDQCCOCOC, ODOOCQDQCD.roadWidth, surfaceOpacity, out ODQQCDQDQD, out indent, applyAnimation, waveSize, waveHeight);
        OQCODQCQOC.ODDQODQCOO       = ODDQODQCOO;
        OQCODQCQOC.OCOCODCCDD       = OCOCODCCDD;
        OQCODQCQOC.OdQODQOD         = OdQODQOD + 1;
        OQCODQCQOC.OOQQQDOD         = OOQQQDOD;
        OQCODQCQOC.OOQQQDODOffset   = OOQQQDODOffset;
        OQCODQCQOC.OOQQQDODLength   = OOQQQDODLength;
        OQCODQCQOC.objectType       = objectType;
        OQCODQCQOC.snapY            = snapY;
        OQCODQCQOC.terrainRendered  = OOCQCCQOQQ;
        OQCODQCQOC.handleVegetation = handleVegetation;
        OQCODQCQOC.raise            = raise;
        OQCODQCQOC.roadResolution   = roadResolution;
        OQCODQCQOC.multipleTerrains = multipleTerrains;
        OQCODQCQOC.editRestore      = editRestore;
        OQCODQCQOC.roadMaterialEdit = roadMaterialEdit;
        OQCODQCQOC.renderRoad       = renderRoad;
        OQCODQCQOC.rscrpts          = rscrpts.Length;

        if (backupLocation == 0)
        {
            OOCDCOQDQC.backupFolder = "/EasyRoads3D";
        }
        else
        {
            OOCDCOQDQC.backupFolder = "/Assets/EasyRoads3D/backups";
        }

        ODODQOQO    = OQCODQCQOC.ODDDCOQDCC();
        ODODQOQOInt = OQCODQCQOC.OCDDCDCCQD();


        if (OOCQCCQOQQ)
        {
            doRestore = true;
        }


        ODDCCCQCOC();

        if (arr != null || ODODQOOQ == null)
        {
            OOCQQQQQQQ(arr, DOODQOQO, OODDQOQO);
        }


        if (doRestore)
        {
            return;
        }
    }
Beispiel #35
0
    public void ODOCOQCCOC(Transform tr, ArrayList arr, string[] DOODQOQO, string[] OODDQOQO)
    {
        RoadObjectScript.version    = "2.4.6";
        RoadObjectScript.OODCDOQDCC = (GUISkin)UnityEngine.Resources.Load("ER3DSkin", typeof(GUISkin));
        RoadObjectScript.OQOOODODQD = (Texture2D)UnityEngine.Resources.Load("ER3DLogo", typeof(Texture2D));
        if (RoadObjectScript.objectStrings == null)
        {
            RoadObjectScript.objectStrings = new string[] { "Road Object", "River Object", "Procedural Mesh Object" };
        }
        this.obj        = tr;
        this.OOQQCODOCD = new OQCDQQDQCC();
        this.OODCCOODCC = this.obj.GetComponent <RoadObjectScript>();
        IEnumerator enumerator = this.obj.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform current = (Transform)enumerator.Current;
                if (current.name != "Markers")
                {
                    continue;
                }
                this.OODDDCQCOC = current;
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable == null)
            {
            }
            disposable.Dispose();
        }
        OQCDQQDQCC.terrainList.Clear();
        Terrain[] terrainArray = (Terrain[])UnityEngine.Object.FindObjectsOfType(typeof(Terrain));
        for (int i = 0; i < (int)terrainArray.Length; i++)
        {
            Terrain  terrain   = terrainArray[i];
            Terrains component = new Terrains()
            {
                terrain = terrain
            };
            if (terrain.gameObject.GetComponent <EasyRoads3DTerrainID>())
            {
                component.id = terrain.gameObject.GetComponent <EasyRoads3DTerrainID>().terrainid;
            }
            else
            {
                EasyRoads3DTerrainID easyRoads3DTerrainID = (EasyRoads3DTerrainID)terrain.gameObject.AddComponent("EasyRoads3DTerrainID");
                string str = UnityEngine.Random.Range(100000000, 999999999).ToString();
                easyRoads3DTerrainID.terrainid = str;
                component.id = str;
            }
            this.OOQQCODOCD.OCDQQCDOQO(component);
        }
        ODCDDDDQQD.OCDQQCDOQO();
        if (this.roadMaterialEdit == null)
        {
            this.roadMaterialEdit = (Material)UnityEngine.Resources.Load("materials/roadMaterialEdit", typeof(Material));
        }
        if (this.objectType == 0 && GameObject.Find(string.Concat(base.gameObject.name, "/road")) == null)
        {
            (new GameObject("road")).transform.parent = base.transform;
        }
        this.OOQQCODOCD.OODQOQCDCQ(this.obj, RoadObjectScript.OCQCDDDOCC, this.OODCCOODCC.roadWidth, this.surfaceOpacity, out this.OOCCDCOQCQ, out this.indent, this.applyAnimation, this.waveSize, this.waveHeight);
        this.OOQQCODOCD.ODDQCCDCDC       = this.ODDQCCDCDC;
        this.OOQQCODOCD.OOCQDOOCQD       = this.OOCQDOOCQD;
        this.OOQQCODOCD.OdQODQOD         = this.OdQODQOD + 1;
        this.OOQQCODOCD.OOQQQDOD         = this.OOQQQDOD;
        this.OOQQCODOCD.OOQQQDODOffset   = this.OOQQQDODOffset;
        this.OOQQCODOCD.OOQQQDODLength   = this.OOQQQDODLength;
        this.OOQQCODOCD.objectType       = this.objectType;
        this.OOQQCODOCD.snapY            = this.snapY;
        this.OOQQCODOCD.terrainRendered  = this.ODODCOCCDQ;
        this.OOQQCODOCD.handleVegetation = this.handleVegetation;
        this.OOQQCODOCD.raise            = this.raise;
        this.OOQQCODOCD.roadResolution   = this.roadResolution;
        this.OOQQCODOCD.multipleTerrains = this.multipleTerrains;
        this.OOQQCODOCD.editRestore      = this.editRestore;
        this.OOQQCODOCD.roadMaterialEdit = this.roadMaterialEdit;
        if (RoadObjectScript.backupLocation != 0)
        {
            OOCDQCOODC.backupFolder = "/Assets/EasyRoads3D/backups";
        }
        else
        {
            OOCDQCOODC.backupFolder = "/EasyRoads3D";
        }
        this.ODODQOQO    = this.OOQQCODOCD.OCDODCOCOC();
        this.ODODQOQOInt = this.OOQQCODOCD.OCCQOQCQDO();
        if (this.ODODCOCCDQ)
        {
            this.doRestore = true;
        }
        this.OOQODQOCOC();
        if (arr != null || RoadObjectScript.ODODQOOQ == null)
        {
            this.OOOOOOODCD(arr, DOODQOQO, OODDQOQO);
        }
        if (this.doRestore)
        {
            return;
        }
    }