Example #1
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));
    }
Example #2
0
    public void OnGUI()
    {
        if (titleContent.text == "SideObjectImporter")
        {
            titleContent = new GUIContent("Import Side Objects");
        }
        bool sel = false;

        foreach (bool flag in flags)
        {
            if (flag)
            {
                sel = true;
                break;
            }
        }
        scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
        int i = 0;

        foreach (String so in sideobjects)
        {
            flags[i] = EditorGUILayout.Toggle(flags[i]);
            GUILayout.Space(-20);
            GUILayout.Label("    " + so, GUILayout.Width(150));
            i++;
        }
        EditorGUILayout.EndScrollView();
        if (!sel)
        {
            GUI.enabled = false;
        }
        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Import", GUILayout.Width(125), GUILayout.Height(25)))
        {
            List <string> comboValues = new List <string>();
            for (i = 0; i < OOCQCOCDOQ.roadObjects.Length; i++)
            {
                comboValues.Add(OOCQCOCDOQ.roadObjects[i]);
            }



            for (i = 0; i < flags.Length; i++)
            {
                if (flags[i])
                {
                    ODODDQQO thisso = (ODODDQQO)importedSos[i];
                    if (CheckExists(thisso))
                    {
                    }
                    else
                    {
                        thisso.name = CheckName(thisso.name);
                        comboValues.Add(thisso.name);
                        OOCQCOCDOQ.ODCOQOCDCD.Add(thisso);
                    }
                }
            }

            OOCQCOCDOQ.roadObjects = comboValues.ToArray();
            OOCQCOCDOQ.OQDDOCQDDQ();
            ObjectManager.instance.Repaint();
            instance.Close();
        }
        EditorGUILayout.EndHorizontal();
    }
Example #3
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);
                    }
                }
            }
        }
    }