예제 #1
0
 void SetObjectScript()
 {
     objectScript = transform.parent.parent.GetComponent <RoadObjectScript>();
     if (objectScript.OQQCDCOCQO == null)
     {
         List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
         objectScript.OQDCDCOODC(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
     }
 }
예제 #2
0
    static public Transform ODDQDODCCQ(RoadObjectScript target)
    {
        GameObject go = new GameObject("Side Objects");

        go.transform.parent = target.transform;
        List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);

        for (int i = 0; i < target.OOQQQOQO.Length; i++)
        {
            ODODDQQO so = (ODODDQQO)arr[target.OOQQQOQO[i]];
            OQDQQDODCD(so.name, go.transform, so, target.OOQQQOQO[i], target);
        }
        return(go.transform);
    }
예제 #3
0
    static public void OQODOCQQCO(OOCOOCQQDQ OQQCDCOCQO, Transform obj, List <SideObjectParams> param, bool OOQDOOQQ, int[] activeODODDQQO, float raise, RoadObjectScript target, Transform mySideObject)
    {
        List <OCQODDOCQD> pnts = target.OQQCDCOCQO.ODDODQOCQO;
        List <ODODDQQO>   arr  = OCOQDQCQDO.OOOCODQOOQ(false);

        for (int i = 0; i < activeODODDQQO.Length; i++)
        {
            ODODDQQO so = (ODODDQQO)arr[activeODODDQQO[i]];

            GameObject goi = null;
            if (so.OCDDCOQDOD != "")
            {
                goi = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OCDDCOQDOD), typeof(GameObject));
            }
            GameObject ODQDDDDCQD = null;
            if (so.OQCCDQOCQQ != "")
            {
                ODQDDDDCQD = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OQCCDQOCQQ), typeof(GameObject));
            }
            GameObject OQQDQOOCQO = null;
            if (so.OOQODOQQDC != "")
            {
                OQQDQOOCQO = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OOQODOQQDC), typeof(GameObject));
            }
            OCOQDQCQDO.OOCDCQCCCO(so, pnts, obj, OQQCDCOCQO, param, OOQDOOQQ, activeODODDQQO[i], raise, goi, ODQDDDDCQD, OQQDQOOCQO);
            if (so.terrainTree > 0)
            {
                if (EditorUtility.DisplayDialog("Side Objects", "Side Object " + so.name + " in " + target.gameObject.name + " includes an asset part of the terrain vegetation data.\n\nWould you like to add this side object to the terrain vegetation data?", "yes", "no"))
                {
                    foreach (Transform child in mySideObject)
                    {
                        if (child.gameObject.name == so.name)
                        {
                            OCOQDQCQDO.OOQQCDCODQ(activeODODDQQO[i], child);
                            MonoBehaviour.DestroyImmediate(child.gameObject);
                            break;
                        }
                    }
                }
            }
            foreach (Transform child in mySideObject)
            {
                if (child.gameObject.GetComponent(typeof(sideObjectScript)) != null)
                {
                    MonoBehaviour.DestroyImmediate(child.gameObject.GetComponent(typeof(sideObjectScript)));
                }
            }
        }
    }
예제 #4
0
    static public void ODCOCCQCCC(RoadObjectScript target)
    {
        OCOQDQCQDO.OOOOOOOCQO(target.transform);

        List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);

        target.OQQODDQCQD(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
        Transform mySideObject = ODDQDODCCQ(target);

        OQODOCQQCO(target.OQQCDCOCQO, target.transform, target.OQOOQQDCQC(), target.OOQDOOQQ, target.OOQQQOQO, target.raise, target, mySideObject);



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

        foreach (RoadObjectScript script in scripts)
        {
            if (script.OQQCDCOCQO == null)
            {
                List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
                script.OCODQDOCOC(script.transform, arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
            }
            flag = true;
        }
        return(flag);
    }
예제 #6
0
    static public void OOOQDQCCDQ(sideObjectScript scr, int index, RoadObjectScript target, Transform go)
    {
        string    n = go.gameObject.name;
        Transform p = go.parent;

        if (go != null)
        {
            MonoBehaviour.DestroyImmediate(go.gameObject);
        }
        List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
        ODODDQQO        so  = (ODODDQQO)arr[index];

        OQDQQDODCD(n, p, so, index, target);

        GameObject goi = null;

        if (so.OCDDCOQDOD != "")
        {
            goi = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OCDDCOQDOD), typeof(GameObject));
        }
        GameObject ODQDDDDCQD = null;

        if (so.OQCCDQOCQQ != "")
        {
            ODQDDDDCQD = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OQCCDQOCQQ), typeof(GameObject));
        }
        GameObject OQQDQOOCQO = null;

        if (so.OOQODOQQDC != "")
        {
            OQQDQOOCQO = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(so.OOQODOQQDC), typeof(GameObject));
        }

        OCOQDQCQDO.OOODCQDOQO(target.OQQCDCOCQO, target.transform, target.OQOOQQDCQC(), target.OOQDOOQQ, index, target.raise, goi, ODQDDDDCQD, OQQDQOOCQO);
        arr = null;
    }
    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.OQQCDCOCQO == null)
                        {
                            List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
                            script.OQDCDCOODC(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
                        }
                        script.OQQCDCOCQO.OQOOCOOCQC(script.displayRoad, script.ODOQCQDDCQ);
                    }
                    if (num == 1)
                    {
                        renderflag = false;
                    }
                    if (num == 2)
                    {
                        renderflag           = false;
                        destroyTerrainScript = false;
                    }
                }
                if (script.transform != null && renderflag && !script.OCDCCDOOOD)
                {
                    if (script.OQQCDCOCQO == null)
                    {
                        List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
                        script.OQDCDCOODC(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
                    }

                    if (RoadObjectScript.erInit == "")
                    {
                        RoadObjectScript.erInit = ODDOCDCOCQ.OOOOCOCQCD(RoadObjectScript.version);
                        OOCOOCQQDQ.erInit       = RoadObjectScript.erInit;
                    }

                    if (script.OQQCDCOCQO == null)
                    {
                        script.OCODQDOCOC(script.transform, null, null, null);
                    }
                    OOCOOCQQDQ.OCDOOODQDO = true;
                    if (!script.OCDCCDOOOD)
                    {
                        script.geoResolution = 0.5f;
                        script.OOCOOQCQQD();
                        if (script.objectType < 2)
                        {
                            OCCOQDCDQC(script);
                        }
                        script.OQQCDCOCQO.terrainRendered = true;
                        script.ODCOQQDDDQ();
                    }
                    if (script.displayRoad && script.objectType < 2)
                    {
                        if (script.objectType == 1)
                        {
                            SetWaterScript(script);
                        }
                        script.OQQCDCOCQO.road.transform.parent = null;
                        script.OQQCDCOCQO.road.layer            = 0;
                        script.OQQCDCOCQO.road.name             = script.gameObject.name;
                    }
                    else if (script.OQQCDCOCQO.road != null)
                    {
                        DestroyImmediate(script.OQQCDCOCQO.road);
                    }



                    bool flag = false;
                    for (int i = 0; i < script.ODODQQOD.Length; i++)
                    {
                        if (script.ODODQQOD[i])
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        OCCQCCODDD.ODCOCCQCCC(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.OCDCCDOOOD)
                {
                    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);
                }
            }
        }
    }
예제 #8
0
    void DoGUI()
    {
        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(60);
        if (GUILayout.Button("Apply", GUILayout.Width(65)))
        {
            OODCCQQQCC.OOODOOOOOC();
            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.ODQCCCQDDQ.Add(so_editor.ODQCCCQDDQ[0]);
            }
            so.nodeList.AddRange(so_editor.ODQCCCQDDQ);
            so_editor.isChanged = false;
            ODOCDDOOCC.OOCOQQOQCD(ODOCDDOOCC.selectedObject);
            ODOCDDOOCC.OOOODODOQQ();

            List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
            RoadObjectScript.ODODOQQO = OCOQDQCQDO.ODOCQDDCCD(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                if (scr.OQQCDCOCQO == null)
                {
                    List <ODODDQQO> arr1 = OCOQDQCQDO.OOOCODQOOQ(false);
                    scr.OQDCDCOODC(arr1, OCOQDQCQDO.ODOCQDDCCD(arr1), OCOQDQCQDO.ODCOCCOQCQ(arr1));
                }
                scr.OQQODDQCQD(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(arr));
                if (scr.OCDCCDOOOD == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + so.name);


                    if (go != null)
                    {
                        OCCQCCODDD.OOOQDQCCDQ((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));
    }
예제 #9
0
    public void OnGUI()
    {
        if (OCQQOCDCCD.extensionPath == "")
        {
            OCQQOCDCCD.extensionPath = GetExtensionPath();
        }
        strArr     = null;
        sosArr     = null;
        returnType = 0;
        ODOCDDOOCC.OCCCCCQQQD(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;



            ODODDQQO so = soVar;


            editor.DisplayNodes(intVar, so, goVar);
            editor.Show();
        }
        else if (returnType == 4)
        {
            List <ODODDQQO> arr = OCOQDQCQDO.OOOCODQOOQ(false);
            RoadObjectScript.ODODOQQO = OCOQDQCQDO.ODOCQDDCCD(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                scr.OQQODDQCQD(arr, OCOQDQCQDO.ODOCQDDCCD(arr), OCOQDQCQDO.ODCOCCOQCQ(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 = OCOQDQCQDO.OOOCODQOOQ(false);
            RoadObjectScript.ODODOQQO = OCOQDQCQDO.ODOCQDDCCD(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                List <ODODDQQO> arr1 = OCOQDQCQDO.OOOCODQOOQ(false);
                if (scr.OQQCDCOCQO == null)
                {
                    scr.OQDCDCOODC(arr1, OCOQDQCQDO.ODOCQDDCCD(arr1), OCOQDQCQDO.ODCOCCOQCQ(arr1));
                }
                scr.OQQODDQCQD(arr1, OCOQDQCQDO.ODOCQDDCCD(arr1), OCOQDQCQDO.ODCOCCOQCQ(arr1));
                if (scr.OCDCCDOOOD == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + strVar);

                    if (go != null)
                    {
                        OCCQCCODDD.OOOQDQCCDQ((sideObjectScript)go.GetComponent(typeof(sideObjectScript)), intVar, scr, go.transform);
                    }
                }
            }
        }
    }