Ejemplo n.º 1
0
 void SetObjectScript()
 {
     objectScript = transform.parent.parent.GetComponent <RoadObjectScript>();
     if (objectScript.OOOOODODCQ == null)
     {
         List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
         objectScript.ODODCDOOQC(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
     }
 }
Ejemplo n.º 2
0
    static public void OQODCQDDCO(RoadObjectScript target)
    {
        OCDQDCQOCQ.OCQCDDOCDQ(target.transform);

        List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);

        target.OCODODQDDO(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
        Transform mySideObject = OQOQOODCDD(target);

        ODQQOQDCDO(target.OOOOODODCQ, target.transform, target.OOCCOOODOO(), target.OOQDOOQQ, target.OOQQQOQO, target.raise, target, mySideObject);



        target.ODODDDOO = true;
    }
Ejemplo n.º 3
0
    public static bool GetEasyRoads3DObjects()
    {
        RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
        bool flag = false;

        foreach (RoadObjectScript script in scripts)
        {
            if (script.OOOOODODCQ == null)
            {
                List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
                script.OCQOQOCQDC(script.transform, arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
            }
            flag = true;
        }
        return(flag);
    }
Ejemplo n.º 4
0
    void DoGUI()
    {
        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(60);
        if (GUILayout.Button("Apply", GUILayout.Width(65)))
        {
            ODQDODDCQO.ODCCOQDCOC();
            instance.Close();
        }
        if (GUILayout.Button("Close", GUILayout.Width(65)))
        {
            instance.Close();
        }
        EditorGUILayout.EndHorizontal();
        GUILayout.Space(5);
        if (so_editor.isChanged == false)
        {
            GUI.enabled = false;
        }
        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(60);
        if (GUILayout.Button("Update Scene", GUILayout.Width(135)))
        {
            so.nodeList.Clear();
            if (so_editor.closed)
            {
                so_editor.OQCDQOCDOQ.Add(so_editor.OQCDQOCDOQ[0]);
            }
            so.nodeList.AddRange(so_editor.OQCDQOCDOQ);
            so_editor.isChanged = false;
            OOCQCOCDOQ.OQQODQDDQQ(OOCQCOCDOQ.selectedObject);
            OOCQCOCDOQ.OQQDDQQQQQ();

            List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
            RoadObjectScript.ODODOQQO = OCDQDCQOCQ.OQQQOOOOOC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                if (scr.OOOOODODCQ == null)
                {
                    List <ODODDQQO> arr1 = OCDQDCQOCQ.OQOODCQQCO(false);
                    scr.ODODCDOOQC(arr1, OCDQDCQOCQ.OQQQOOOOOC(arr1), OCDQDCQOCQ.OQODCCCCCD(arr1));
                }
                scr.OCODODQDDO(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
                if (scr.OQCCDOOOCC == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + so.name);


                    if (go != null)
                    {
                        ODDOQODQCQ.OODODODOOD((sideObjectScript)go.GetComponent(typeof(sideObjectScript)), sideObject, scr, go.transform);
                    }
                }
            }
        }
        EditorGUILayout.EndHorizontal();
        GUI.enabled = true;
        if (GUI.changed)
        {
            so_editor.isChanged = true;
        }
        Handles.color = Color.black;
        Handles.DrawLine(new Vector2(stageSelectionGridWidth, 0), new Vector2(stageSelectionGridWidth, Screen.height));

        Handles.DrawLine(new Vector2(stageSelectionGridWidth - 1, 0), new Vector2(stageSelectionGridWidth - 1, Screen.height));
    }
Ejemplo n.º 5
0
    public void OnGUI()
    {
        if (ODQQDOOOOO.extensionPath == "")
        {
            ODQQDOOOOO.extensionPath = GetExtensionPath();
        }
        if (titleContent.text == "ObjectManager")
        {
            titleContent = new GUIContent("EasyRoads3D Object Manager");
        }
        if (!isStarted)
        {
            OOCQCOCDOQ.OCDQQDQOCD();
            isStarted = true;
        }
        strArr     = null;
        sosArr     = null;
        returnType = 0;
        OOCQCOCDOQ.OOOQCQQQDC(ref strVar, ref intVar, ref goVar, ref soVar, ref strArr, ref sosArr, ref returnType);


        if (returnType == 2)
        {
            ProceduralObjectsEditor editor = null;
            if (ProceduralObjectsEditor.instance == null)
            {
                editor = (ProceduralObjectsEditor)ScriptableObject.CreateInstance(typeof(ProceduralObjectsEditor));
            }
            else
            {
                editor = ProceduralObjectsEditor.instance;
            }
            editor.position = new Rect(editor.position.x, editor.position.y, 500, 400);

//editor.title = strVar;
            editor.titleContent = new GUIContent(strVar);


            ODODDQQO so = soVar;


            editor.DisplayNodes(intVar, so, goVar);
            editor.Show();
        }
        else if (returnType == 4)
        {
            List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
            RoadObjectScript.ODODOQQO = OCDQDCQOCQ.OQQQOOOOOC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                scr.OCODODQDDO(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
            }
            if (ProceduralObjectsEditor.instance != null)
            {
                ProceduralObjectsEditor.instance.Close();
            }
            instance.Close();
        }
        else if (returnType == 1)
        {
            SideObjectImporter ieditor = (SideObjectImporter)ScriptableObject.CreateInstance(typeof(SideObjectImporter));
            SideObjectImporter.sideobjects = strArr;
            SideObjectImporter.flags       = new bool[intVar];

            SideObjectImporter.importedSos = sosArr;
            ieditor.ShowUtility();
        }
        else if (returnType == 3)
        {
            List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
            RoadObjectScript.ODODOQQO = OCDQDCQOCQ.OQQQOOOOOC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                List <ODODDQQO> arr1 = OCDQDCQOCQ.OQOODCQQCO(false);
                if (scr.OOOOODODCQ == null)
                {
                    scr.ODODCDOOQC(arr1, OCDQDCQOCQ.OQQQOOOOOC(arr1), OCDQDCQOCQ.OQODCCCCCD(arr1));
                }
                scr.OCODODQDDO(arr1, OCDQDCQOCQ.OQQQOOOOOC(arr1), OCDQDCQOCQ.OQODCCCCCD(arr1));
                if (scr.OQCCDOOOCC == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + strVar);

                    if (go != null)
                    {
                        ODDOQODQCQ.OODODODOOD((sideObjectScript)go.GetComponent(typeof(sideObjectScript)), intVar, scr, go.transform);
                    }
                }
            }
        }
    }
Ejemplo n.º 6
0
    public static void  FinalizeRoads()
    {
        bool destroyTerrainScript = true;

        if (EditorUtility.DisplayDialog("Build EasyRoads3D Objects", "This process includes destroying all EasyRoads3D control objects. Did you make a backup of the Scene? Do you want to continue?\n\nDepending on the number of EasyRoads3D objects in the Scene and used side objects, this process may take a while. Please be patient. ", "Yes", "No"))
        {
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript script in scripts)
            {
                bool renderflag        = true;
                bool renderAlreadyDone = false;
                int  num = 0;
                if (!script.displayRoad)
                {
                    num = EditorUtility.DisplayDialogComplex("Disabled EasyRoads3D Object Detected:", script.gameObject.name + " is currently not displayed.\n\nWould you like to activate and finalize this object, destroy this object or skip it in this finalize procedure?", "Finalize", "Destroy", "Skip");
                    if (num == 0)
                    {
                        script.displayRoad = true;
                        if (script.OOOOODODCQ == null)
                        {
                            List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
                            script.ODODCDOOQC(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
                        }
                        script.OOOOODODCQ.OOQCQOCOOC(script.displayRoad, script.OCCOCOOOCC);
                    }
                    if (num == 1)
                    {
                        renderflag = false;
                    }
                    if (num == 2)
                    {
                        renderflag           = false;
                        destroyTerrainScript = false;
                    }
                }
                if (script.transform != null && renderflag && !script.OQCCDOOOCC)
                {
                    if (script.OOOOODODCQ == null)
                    {
                        List <ODODDQQO> arr = OCDQDCQOCQ.OQOODCQQCO(false);
                        script.ODODCDOOQC(arr, OCDQDCQOCQ.OQQQOOOOOC(arr), OCDQDCQOCQ.OQODCCCCCD(arr));
                    }

                    if (RoadObjectScript.erInit == "")
                    {
                        RoadObjectScript.erInit = OQCOQQCOQO.OQDODODOQD(RoadObjectScript.version);
                        OOQCOQOQQD.erInit       = RoadObjectScript.erInit;
                    }

                    if (script.OOOOODODCQ == null)
                    {
                        script.OCQOQOCQDC(script.transform, null, null, null);
                    }
                    OOQCOQOQQD.OQDQQQCDQQ = true;
                    if (!script.OQCCDOOOCC)
                    {
                        script.geoResolution = 0.5f;
                        script.OQOQQQCDOQ();
                        if (script.objectType < 2)
                        {
                            OQCOOCDODD(script);
                        }
                        script.OOOOODODCQ.terrainRendered = true;
                        script.ODCDQOOOQC();
                    }
                    if (script.displayRoad && script.objectType < 2)
                    {
                        if (script.objectType == 1)
                        {
                            SetWaterScript(script);
                        }
                        script.OOOOODODCQ.road.transform.parent = null;
                        script.OOOOODODCQ.road.layer            = 0;
                        script.OOOOODODCQ.road.name             = script.gameObject.name;
                    }
                    else if (script.OOOOODODCQ.road != null)
                    {
                        DestroyImmediate(script.OOOOODODCQ.road);
                    }



                    bool flag = false;
                    for (int i = 0; i < script.ODODQQOD.Length; i++)
                    {
                        if (script.ODODQQOD[i])
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        ODDOQODQCQ.OQODCQDDCO(script);
                    }
                    foreach (Transform child in script.transform)
                    {
                        if (child.name == "Side Objects")
                        {
                            child.name   = script.gameObject.name + " - Side Objects ";
                            child.parent = null;
                        }
                    }
                }
                else if (script.OQCCDOOOCC)
                {
                    renderAlreadyDone    = true;
                    destroyTerrainScript = false;
                }
                if ((script.displayRoad || num != 2) && !renderAlreadyDone)
                {
                    DestroyImmediate(script.gameObject);
                }
            }

            if (destroyTerrainScript)
            {
                EasyRoads3DTerrainID[] terrainscripts = (EasyRoads3DTerrainID[])FindObjectsOfType(typeof(EasyRoads3DTerrainID));
                foreach (EasyRoads3DTerrainID script in terrainscripts)
                {
                    DestroyImmediate(script);
                }
            }
        }
    }