Ejemplo n.º 1
0
 public ObjectManager()
 {
     if (instance != null)
     {
     }
     instance = this;
     title    = "EasyRoads3D Object Manager";
     position = new Rect((Screen.width - 550.0f) / 2.0f, (Screen.height - 400.0f) / 2.0f, 550.0f, 400.0f);
     minSize  = new Vector2(550.0f, 400.0f);
     maxSize  = new Vector2(550.0f, 400.0f);
     OCDOQOCDCC.OOQCODCQDO();
 }
Ejemplo n.º 2
0
    public void OnGUI()
    {
        if (OQOCDDCOQO.extensionPath == "")
        {
            OQOCDDCOQO.extensionPath = GetExtensionPath();
        }
        strArr     = null;
        sosArr     = null;
        returnType = 0;
        OCDOQOCDCC.OQQOQDOQOD(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 = ODCDDQQDDC.OCDOQDQCOQ(false);
            RoadObjectScript.ODODOQQO = ODCDDQQDDC.OCQCOCOODC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                scr.OODDDQDCDC(arr, ODCDDQQDDC.OCQCOCOODC(arr), ODCDDQQDDC.ODQQOQCDOC(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 = ODCDDQQDDC.OCDOQDQCOQ(false);
            RoadObjectScript.ODODOQQO = ODCDDQQDDC.OCQCOCOODC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                List <ODODDQQO> arr1 = ODCDDQQDDC.OCDOQDQCOQ(false);
                if (scr.ODQQOCODOC == null)
                {
                    scr.OODQOODDCO(arr1, ODCDDQQDDC.OCQCOCOODC(arr1), ODCDDQQDDC.ODQQOQCDOC(arr1));
                }
                scr.OODDDQDCDC(arr1, ODCDDQQDDC.OCQCOCOODC(arr1), ODCDDQQDDC.ODQQOQCDOC(arr1));
                if (scr.OCOOQDQCQC == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + strVar);

                    if (go != null)
                    {
                        OCODOCOQQD.OOCQCCDOQQ((sideObjectScript)go.GetComponent(typeof(sideObjectScript)), intVar, scr, go.transform);
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    public void OnGUI()
    {
        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 < OCDOQOCDCC.roadObjects.Length; i++)
            {
                comboValues.Add(OCDOQOCDCC.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);
                        OCDOQOCDCC.ODDOOOCODD.Add(thisso);
                    }
                }
            }

            OCDOQOCDCC.roadObjects = comboValues.ToArray();
            OCDOQOCDCC.OQQQQODCOC();
            ObjectManager.instance.Repaint();
            instance.Close();
        }
        EditorGUILayout.EndHorizontal();
    }
Ejemplo n.º 4
0
    void DoGUI()
    {
        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(60);
        if (GUILayout.Button("Apply", GUILayout.Width(65)))
        {
            OQOODCDCDO.ODCODCOOOC();
            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.OCOOCCODQQ.Add(so_editor.OCOOCCODQQ[0]);
            }
            so.nodeList.AddRange(so_editor.OCOOCCODQQ);
            so_editor.isChanged = false;
            OCDOQOCDCC.OCOQOOCCQD(OCDOQOCDCC.selectedObject);
            OCDOQOCDCC.ODQDDQDOQC();

            List <ODODDQQO> arr = ODCDDQQDDC.OCDOQDQCOQ(false);
            RoadObjectScript.ODODOQQO = ODCDDQQDDC.OCQCOCOODC(arr);
            RoadObjectScript[] scripts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
            foreach (RoadObjectScript scr in scripts)
            {
                if (scr.ODQQOCODOC == null)
                {
                    List <ODODDQQO> arr1 = ODCDDQQDDC.OCDOQDQCOQ(false);
                    scr.OODQOODDCO(arr1, ODCDDQQDDC.OCQCOCOODC(arr1), ODCDDQQDDC.ODQQOQCDOC(arr1));
                }
                scr.OODDDQDCDC(arr, ODCDDQQDDC.OCQCOCOODC(arr), ODCDDQQDDC.ODQQOQCDOC(arr));
                if (scr.OCOOQDQCQC == true || scr.objectType == 2)
                {
                    GameObject go = GameObject.Find(scr.gameObject.name + "/Side Objects/" + so.name);


                    if (go != null)
                    {
                        OCODOCOQQD.OOCQCCDOQQ((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));
    }