Exemplo n.º 1
0
    public static void  CreateEasyRoads3DObject()
    {
        RoadObjectScript[] scrpts = (RoadObjectScript[])FindObjectsOfType(typeof(RoadObjectScript));
        if (scrpts.Length >= 1)
        {
            EditorUtility.DisplayDialog("Alert", "The Free version supports only one road editor object in the scene!\n\nPlease finalize or delete the current road object or upgrade to the full version before creating a new road object.", "Close");
            Selection.activeGameObject = scrpts[0].gameObject;
            return;
        }

        Terrain[] terrains = (Terrain[])FindObjectsOfType(typeof(Terrain));
        if (terrains.Length == 0)
        {
            EditorUtility.DisplayDialog("Alert", "No Terrain objects found! EasyRoads3D objects requires a terrain object to interact with. Please create a Terrain object first", "Close");
            return;
        }



        if (NewEasyRoads3D.instance == null)
        {
            NewEasyRoads3D window = (NewEasyRoads3D)ScriptableObject.CreateInstance(typeof(NewEasyRoads3D));
            window.ShowUtility();
        }
    }
Exemplo n.º 2
0
    public static void  CreateEasyRoads3DObject()
    {
        Terrain[] terrains = (Terrain[])FindObjectsOfType(typeof(Terrain));
        if (terrains.Length == 0)
        {
            EditorUtility.DisplayDialog("Alert", "No Terrain objects found! EasyRoads3D objects requires a terrain object to interact with. Please create a Terrain object first", "Close");
            return;
        }



        if (NewEasyRoads3D.instance == null)
        {
            NewEasyRoads3D window = (NewEasyRoads3D)ScriptableObject.CreateInstance(typeof(NewEasyRoads3D));
            window.ShowUtility();
        }
    }