Search Unity

Multiplatform Runtime Level Editor

Discussion in 'Assets and Asset Store' started by FreebordMAD, Jun 10, 2014.

  1. musou0

    musou0

    Joined:
    Dec 2, 2015
    Posts:
    16
    Hi, thanks for the reply.
    When I try doing this, the script will have some errors, and I don't know why. Could you have a look? Thanks.

     
  2. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    "The type or namespace name 'XXX', could not be found..." means that you need a using directive.
    Please add to the top of your file (see docs under "Game"):
    Code (CSharp):
    1. using LE_LevelEditor.Core;
    The terrain TERRAIN_TEXTURE_CONFIG and the TERRAIN_LAYER are properties that need to be set in the inspector. Please add the following code to your GameLevelLoadManager class (see ExampleGame_Game script or docs under "Game"):
    Code (CSharp):
    1.  
    2.         [SerializeField]
    3.         private int TERRAIN_LAYER = 28;
    4.         [SerializeField]
    5.         private LE_TerrainTextureConfig TERRAIN_TEXTURE_CONFIG = null;
    In the inspector of your GameLevelLoadManager you have to assign the layer which you have used for your terrain (the same value that you have assigned in the TerrainLayer of the LE_ConfigTerrain in your editor scene).
    Additionally, you have to assign the same TerrainTextureConfig to the TERRAIN_TEXTURE_CONFIG property in the inspector as you have used in the TerrainTextureConfig property of the LE_ConfigTerrain in your editor scene. The asset is also called TerrainTextureConfig in the project, so you can simply search for it. Some more info about the terrain texture config:
     
  3. musou0

    musou0

    Joined:
    Dec 2, 2015
    Posts:
    16
    Hi, thanks for the reply.

    Right now I want to add a small function: In the editor scene, if the player didn't place the "player start position" object, then the level can't be saved. Any suggestions?
     
  4. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Simply replace the OnSave method of the ExampleGame_Editor class with the following code:
    Code (CSharp):
    1.  
    2.         private void OnSave(object p_sender, LE_SaveEvent p_args)
    3.         {
    4.             string errorMessage;
    5.             if (IsLevelPlayable(out errorMessage))
    6.             {
    7.                 m_lastSaveFrame = Time.frameCount;
    8.                 LE_ExtensionInterface.Save.Delegate(this, p_args.SavedLevelData, p_args.SavedLevelMeta, p_args.RemovedDuplicatesCount);
    9.             }
    10.             else
    11.             {
    12.                 ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup(POPUP_TEXT)).SetText("Game logic objects missing!", errorMessage).ShowButton("ok");
    13.             }
    14.         }
     
  5. ilmario

    ilmario

    Joined:
    Feb 16, 2015
    Posts:
    71
    Hi,
    First I'd like to say that I'm absolutely amazed at the features this asset provides - fantastic work! I'll be working on a project which very heavily relies on this editor. I have many questions / feature requests, but right now is not the best time to write about them for me..

    I also checked out your other assets and bought a few because I like this one so much.

    There doesn't seem to be a separate thread for "Prefab Material Quality Loader", but I'll add some comments about it here:
    - Great idea! I havent had the chance to test it properly yet though, but the documentation and logic are clear enough.
    - That asset doesnt seem to get any updates, probably hasnt been discovered much in the asset store..
    - A pretty annoying problem: adding "Prefab Material Quality Loader" to the scene added like 40Mb of useless clutter to my build (taking up more than 50% of the normal build). Another great asset, "Build Report Tool" told me that this was mainly caused by the Resources-folder under "Examples" of that project, and some references in them I guess.
    - This clutter is naturally because Unity always includes anything under folders named "Resources". Those folders can be renamed or sometimes removed to avoid the problem, but it is not evident to all Unity users. So maybe there could be a different way to make sure the Resources are available in the final build - or maybe just a note to delete the Example folder before doing production builds?

    The same "Resources"-folder logic applies to "Multiplatform Runtime Level Editor", and it also adds lots of stuff to the build size. I havent even read all of the massive documentation for it, so I dont know if there is info about bulking up the build and how to avoid it. But if not, maybe its worth a note? Most people want to keep their builds very small for mobile.

    Anyway, I salute you for making this level editor, I can see so many possibilities with it!
     
  6. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Hi, thanks for the feedback. You are right I should describe how the build size can be reduced for my tools in the documentations.

    Both the MRLE and the Prefab Quality Loader use the resource folders to be able to load assets dynamically on runtime. For the PQL you can simple delete the example assets folder. For the MRLE you have to remove those prefabs that you don't want to use from the Object Maps and also delete those assets and their icons from the resource folder.

    Unfortunately, placing the objects in another folder is not an option. Those assets have to be in the resource folder to be loaded later on runtime.
     
    ilmario likes this.
  7. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I'm thinking of acquiring this asset for my project, and have several presales questions.
    1. I read the documentation on how snap points work. Is it possible to define an allowable category of prefabs for each snap point, rather than a list of specific prefabs? For example, I would like to have assets of type "floor" that are interchangeable, and "wall", and so forth, and allow any of the "wall" types to snap to particular points on any of the "floor" types.
    2. Also on snap points, is there an ability to define snap points by their position and allowed snap category, without having to make each snap point a GameObject with all the overhead that implies?
    3. I read the documentation on loading, saving, and additional metadata. In my application, I need to take external control of the load/save process entirely, because I need very fine-grained control over the level data repository rather than just treating the level data as an SQL BLOB column. Given that you provide source code, I know this is "possible", but my question is, is it reasonably feasible to do (or have others already done this)?
    4. Can MRLE treat Terrains fully reactively? I'm using Terrain Composer to generate procedural terrains, and I need my in-game editor to treat those as read-only information. That is, MRLE is to query the realtime position of terrain height where the user is trying to place a prefab, but MRLE is not allowed to edit the terrain and must also respond to changes. I don't need it to respond during object placement, as terrain change will not be concurrent with prefab placement.
    Thanks for any info you can share! Overall I like what I see of the asset so far.

    UPDATE: Had to make a decision before the asset went off sale, so I proceeded. :)
     
    Last edited: Apr 21, 2016
  8. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    For webgl this plugin works?

    PS: The guide is very bad, there are no concrete examples and even video tutorials. For the asset cost these deficiencies are unacceptable. Furthermore objects can not be placed in "mid-air" but only in reference to an object or land already on the scene. Add prefab.
     
    Last edited: Apr 21, 2016
  9. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Unfortunately, the snapping functionality is not designed in a way that would allow categories to be used. To snap an object to another object the possible snap objects are shown in circles popping out from the "plus" button of the snap point, displaying more than 4-5 object would make the UI look messy. I fear that you will need to implement some custom logic working well with your game here. If you have questions on how to implement this, please don't hesitate to ask me!

    Same as above.

    Please take a look at the LE_SaveLoad class, especially at the SaveCurrentLevelDataToByteArray and the LoadLevelDataFromByteArray methods. You can change the code here and save single level objects, parts of the terrain or anything else you need.

    The object placement will raycast the terrain, therefore any change will be noted and taken into account. If you want the terrain snapped objects to stick with the terrain, while the terrain is changed, then simply call LE_EventInterface.OnChangeLevelData after every terrain modification. [EDIT:] You need to pass LE_ELevelDataChangeType.TERRAIN_HEIGHTS in the event.
    [EDIT2:]You can simply disable the terrain editing by setting is IS_TERRAIN_EDITOR take a look at this page: http://www.freebord-game.com/index....e-level-editor/documentation/hide-editor-tabs

    I'm glad to hear that! :)
     
    Last edited: Apr 21, 2016
  10. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    The MRLE should also work in WebGL, but it was not tested with it.

    Please be more precise here, I'm willing to improve the documentation, but you need to tell me what you didn't understand.

    Please be more precise, which deficiencies?

    You can drag and drop an object to the terrain (or any other object), then move it up. You can also drag and drop objects on invisible colliders. Please explain in more detail what you mean with "mid-air". Maybe you have tried to place a terrain snapped object like a tree in the air?
     
  11. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Fair enough, and thanks for the reply. No matter which asset I use (I bought yours and another and plan to try them both), I'll need some custom logic. No surprise. :)

    Good, that's what I was hoping was the answer. What I probably need to do is just look at how your save class dissects, and your load class reassembles, then implement my own version of what happens with the object-level data. No problem, I can do that.

    Both upward and downward, I assume?

    That should work fine. Obviously my code will know if it has generated a procedural terrain editing action, so I simply need to remember to propagate that action to your event system.

    Doh! How did I miss that? RTFM, /me!
     
  12. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Exactly ;)
     
  13. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Can i use this also for 2D games on mobile and do the load and save addon also work on mobiles?
     
  14. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes, the save file selection also works on mobile. You can restrict the movement to the axis that you use in your 2d game, e.g. X and Y. The same works with rotation and scaling.
     
  15. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    is there any chance you could share it with us mere mortals or even purchase as an expansion module? :p
     
  16. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    1 - Documentation:

    No example with regard to:

    - Customizing the UI (at the very least indicating where the mother script in a video) are located

    - Capture events on a proprietary script as the click of a prop or moving this

    - Save a scene

    - Load a scene

    - The entire process to follow to insert new objects, create categories etc

    Practically the ABCs of how to use the plugin.

    2 - Deficiencies

    What was said just above.

    3 - Object mid-air

    Meant the positioning of an object in the scene exactly as is done in unity, that is, without reference collider such as land, other objects etc.

    4 - Bug?

    In UMyGui_TabBox I changed the selectedIndex to 1 to be able to immediately see the selection of objects, but when I try to put an object in the scene (on collider) simply does not work. If tab change and return to the object at that point I everything works properly. How can I solve and make it all work already leave?
     
  17. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    You are right that there are no video tutorials. However, I try to invest my limited time resources into new features. Nevertheless, everything is documented in the text doc. If something is missing, then please tell me what you need and I will write an article. Below you will find links to the docs:

    http://www.freebord-game.com/index.php/multiplatform-runtime-level-editor/documentation/custom-ui
    http://www.freebord-game.com/index....vel-editor/documentation/add-button-level-tab
    http://www.freebord-game.com/index....time-level-editor/documentation/add-left-menu
    http://www.freebord-game.com/index....e-level-editor/documentation/hide-editor-tabs

    http://www.freebord-game.com/index.php/multiplatform-runtime-level-editor/documentation/events

    http://www.freebord-game.com/index.php/multiplatform-runtime-level-editor/documentation/save

    http://www.freebord-game.com/index.php/multiplatform-runtime-level-editor/documentation/load

    http://www.freebord-game.com/index....time-level-editor/documentation/level-objects
    http://www.freebord-game.com/index....evel-editor/documentation/count-level-objects

    This is indeed not yet possible. However, the MRLE has open source. You can change the code as you want. Take a look at the UpdateNewObjectDragAndDrop method in the LE_GUI3dObject class. There you will find the following code:
    Code (CSharp):
    1.  
    2.                 // check if the icon is being dragged and the cursor is over something
    3.                 else if (IsCursorOverSomething)
    You could override the implementation of IsCursorOverSomething and set it to be always true. If there is nothing to raycast, then you could set the hitpoint to a certain position in front of the camera.

    Please take into account that I'm not rebuilding the Unity Editor to work on runtime. My asset is designed to be simple and easy to understand. The target group are not developers, but players.

    Simply add the script below to your scene and link the right menu tab box (RightNav_BG object) to the TabBox property of the script.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using LE_LevelEditor.UI;
    4. using uMyGUI;
    5.  
    6. public class Test : MonoBehaviour
    7. {
    8.     [SerializeField]
    9.     private uMyGUI_TabBox TabBox;
    10.  
    11.     private void LateUpdate()
    12.     {
    13.         TabBox.SelectTab(1);
    14.         LE_GUIInterface.Instance.OnEditModeBtn(1);
    15.         enabled = false;
    16.     }
    17. }
    18.  
    The problem here was that you have changed the UI only, but not the editor mode.
     
    FaberVi likes this.
  18. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    @FreebordMAD

    You can instantiate an object directly by dragging an object from the list to the scene? (Without having to go through the preview pane)
     
  19. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes, just drag an object from the list clicking on its icon. For the thing that you have said before, about examples in the event interface section of the documentation:
    As you can see in the docs the most important events have articles linked with examples. However, I still need to write examples for all events.
     
  20. Hatod13

    Hatod13

    Joined:
    May 3, 2016
    Posts:
    3
    Hi,
    Short dummy question please, I am running the editor and I am able to change the terrain, I am able to save/load it which is great. Is it possible to "see" the same terrain in Unity ? ( the one which I am modifying in the editor? ) Thanks.
     
  21. Aizat-Musa

    Aizat-Musa

    Joined:
    Feb 25, 2016
    Posts:
    8
    Hi, what i am trying to do was while on LE_EventInterface.OnObjectDragged event, if the dragged object hit certain object, it will rotate according to that object rotation, is there any way to detect the dragged object collision with other objects other than using cursorHitInfo? also how to rotate the object while in the OnObjectDragged event?

    I notice that object collision detection only works on OnObjectPlaced event.
     
  22. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Do you mean like this:
    MRLE_terrain.png
    Just open the scene view and take a look at the Terrain object. You can also modify the terrain object with the built-in Unity Editor Terrain tools, then save the level and keep all your changes (height and paint).


    Yes, you can get the dragged object collision only with LE_ObjectDragEvent.CursorHitInfo.collider. The reason for this is that all rigidbodies are removed from the preview instance. This way only other objects having a collider and a rigidbody can detect collision with a preview instance, but the preview instance cannot detect a collision with another object without the other object having a rigidbody. Can you explain your use case in a little more detail, maybe I can help you here.

    Take a look at the code below. It will rotate the preview instance so that it matches the rotation of the object that is currently under the mouse pointer. Take into account that you have to disable Snap and also Is Normal Oriented Placement for the LE_Object that needs to get its rotation set in OnObjectDragged. Otherwise, those options could overwrite your rotation.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Test : MonoBehaviour
    5. {
    6.     private void Update()
    7.     {
    8.         LE_LevelEditor.Events.LE_EventInterface.OnObjectDragged += OnObjectDragged;
    9.         enabled = false;
    10.     }
    11.  
    12.     private void OnObjectDragged (object p_sender, LE_LevelEditor.Events.LE_ObjectDragEvent p_args)
    13.     {
    14.         if (p_args.IsObjectPlaceable && p_args.ObjectPreview != null && p_args.CursorHitInfo.collider != null)
    15.         {
    16.             p_args.ObjectPreview.transform.rotation = p_args.CursorHitInfo.collider.transform.rotation;    
    17.         }
    18.     }
    19. }
    [EDIT]: p.s.: guys if you like the MRLE, then it would be super awesome to see this in a review!
     
    Last edited: May 4, 2016
  23. Aizat-Musa

    Aizat-Musa

    Joined:
    Feb 25, 2016
    Posts:
    8
    collison.png
    the use case is I set a row of objects(cells) in different size and I set dragged object(crane) only is placeable on top of it and it will set position and rotation to the cell that is currently under the mouse pointer. the crane is bigger than the cells and if two cranes are next to each other, it will collide. that is when I want to set the crane not placeable when it collide while still dragging.
     
  24. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    If I apply the dragging of an object from the list it follows the mouse position but is not instantiated in the scene once released. I tried to study a little bit the operation of the preview pane but can not emulate the same comportamente directly in the list. Could you help me out? At the moment I'm stuck.

    I assume can also serve other users (Maybe it would be better to insert already an option to enable or disable this behavior already in the interface prefab)
     
  25. Hatod13

    Hatod13

    Joined:
    May 3, 2016
    Posts:
    3
    Hi,
    Thank you, yes, my problem is that as soon as I press again the "play" button ( I exit this mode )everything is reset and nothing got saved. Indeed, I can save the terrain while the editor is running ... I can even load it back without a problem, but, only when the editor is running. As soon as the editor is no longer in "play" mode ... the terrain is back to it's original state.
     
  26. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I see these two solutions, that you can use to find out if two cranes collide in OnObjectDragged:
    1. The simplest solution would be to give your crane objects a tag. Then search all instances of your cranes with GameObject.FindGameObjectsWithTag. If there is another crane instance within a certain distance to the crane that is being dragged, then it is not placeable. You could optimize this with a script that holds all instances of your cranes, because calling GameObject.FindGameObjectsWithTag would be too expensive in means of performance if you level has many objects.

    2. Use some physics functions like Physics.CheckBox.
    Here you would place the cranes in a special layer. You could call this layer CheckCollisionOnDrag. Then you would call Physics.CheckBox with the size of your crane and the rotation of your crane.
     
  27. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Could you please make short video explaining your problem or a sequence of screenshots? I cannot reproduce this on my end. I can drag and drop objects directly from the listing.
     
  28. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Ok, I see. This is the intended behaviour. To save the terrain you could use this call while your game is running in the Unity Editor:
    Code (CSharp):
    1. UnityEditor.AssetDatabase.CreateAsset(Terrain.activeTerrain.terrainData, "Assets/WorkingTerrainData.asset");
    This code will save the currently active terrain in the WorkingTerrainData asset in your project root.
    You can simply drag and drop the WorkingTerrainData into the scene, then a new terrain with this data will be created.
    If you have multiple terrains in your scene, then you should pass the right terrain to the CreateAsset method.
     
  29. Hatod13

    Hatod13

    Joined:
    May 3, 2016
    Posts:
    3
    Thank you very much!
     
    FreebordMAD likes this.
  30. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    I sent you an email with the video attached. You can also hook up an event when you delete an object? In the documentation I found nothing
     
    FreebordMAD likes this.
  31. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Thank you for the detailed information in your e-mail. I have found the bug. The problem here is that I have not expected any objects in the root of the tree view. Please apply the following fix to the SetObjects method of the LE_GUIInterface_uGUIimpl class or the *uGUIimpl class that you use. Please let me know if this fix has solved your problem!
    Code (CSharp):
    1.     private void SetObjects(LE_ObjectMap p_objectMap)
    2.      {
    3.        if (OBJECT_BROWSER != null)
    4.        {
    5.          OBJECT_BROWSER.OnInnerNodeClick += (object p_object, uMyGUI_TreeBrowser.NodeClickEventArgs p_args)=>
    6.          {
    7.            AddButtonClickSoundsToGeneratedUI(OBJECT_BROWSER.transform as RectTransform);
    8.          };
    9.          OBJECT_BROWSER.OnLeafNodePointerDown += (object p_object, uMyGUI_TreeBrowser.NodeClickEventArgs p_args)=>
    10.          {
    11.            LE_Object selectedObj;
    12.            string selectedResourcePath;
    13.            if (!m_nodeToObject.TryGetValue(p_args.ClickedNode, out selectedObj))
    14.            {
    15.              Debug.LogError("LE_GUIInterface_uGUIimplDungeon: could not find selected node's object!");
    16.            }
    17.            if (!m_nodeToResourcePath.TryGetValue(p_args.ClickedNode, out selectedResourcePath))
    18.            {
    19.              Debug.LogError("LE_GUIInterface_uGUIimplDungeon: could not find selected node's path!");
    20.            }
    21.            if (selectedObj != null && selectedResourcePath != null)
    22.            {
    23.              LE_GUIInterface.Instance.OnObjectSelectDraggable(selectedObj, selectedResourcePath);
    24.            }
    25.          };
    26.          OBJECT_BROWSER.OnNodeInstantiate += (object p_object, uMyGUI_TreeBrowser.NodeInstantiateEventArgs p_args)=>
    27.          {
    28.            // drag for leaf items
    29.            if (p_args.Node.Children == null || p_args.Node.Children.Length == 0)
    30.            {
    31.              // use GetComponentsInChildren instead of GetComponentInChildren as this is the only way to get inactive components in all Unity versions
    32.              uMyGUI_Draggable[] draggable = p_args.Instance.GetComponentsInChildren<uMyGUI_Draggable>(true);
    33.              if (draggable.Length > 0 && draggable[0] != null)
    34.              {
    35.                RawImage[] image = draggable[0].GetComponentsInChildren<RawImage>(true);
    36.                m_treeBrowserLeafNodes.Add(new LeafNodeInstance(draggable[0], image.Length > 0 ? image[0] : null));
    37.              }
    38.            }
    39.          };
    40.          OBJECT_BROWSER.BuildTree(SetObjectsRecursive(p_objectMap, 0));
    41.          AddButtonClickSoundsToGeneratedUI(OBJECT_BROWSER.transform as RectTransform);
    42.        }
    43.        else
    44.        {
    45.          Debug.LogError("LE_GUIInterface_uGUIimplDungeon: SetObjects: OBJECT_BROWSER is not set in inspector!");
    46.        }
    47.      }
    48.  
     
    Last edited: May 11, 2016
  32. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    FIXED! Thanks! :)

    To capture the event resulted from the elimination of an object how can I do? Thanks again!
     
  33. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    You're welcome!

    Simply listen for the LE_EventInterface.OnChangeLevelData. The change type in the arguments will be LE_ELevelDataChangeType.OBJECT_DELETE.
     
    FaberVi likes this.
  34. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Hey!
    is there a way to achieve some kind of mass or group placement?
    for example: i have 1 cube in my object list but i wanna place 10 of them next to each other. would be the only way to do this drag and drop 10 of them each at a time?
    Iam thinking about something like put in a number how many cubes should be placed and then drop them.
     
  35. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    This is not yet possible... You could create a prefab with some special UI. For example, with a button like the object snap button.
     
  36. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    Just bought this package and I must say it is wonderful and saved me a lot of time programming it myself. The object placement is a great bonus too! I havent really had much time to mess around with it yet but is it possible to load in a custom heightmap? If not would it be possible to implement in future updates?
     
  37. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Hello, I'm glad that you like the MRLE so far! Hearing this in a short review would be super awesome!

    Please give me some more details about the custom heightmaps that you need. If you want to have a custom terrain that the user can start with, then take a look at the terrain only editor. It has a 9 patch terrain with the center terrain being editable.
    Or do you want the user to be able to import a raw heightmap from a file on runtime?
     
  38. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    @FreebordMAD I'm back to ask other questions :p .. I wanted to know if it was possible when I click on my UI remove any present focus on an object 3d clicked previously on stage (and thus disable the other buttons normally turned off when no object is selected)

    PS: How can I check the lost focus of an object?
     
    Last edited: May 18, 2016
  39. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Please use the LE_EventInterface.OnObjectSelectedInScene (doc link) event to get informed when an object is selected or deselected.

    To remove the selection you can call the LE_GUI3dObject.RemoveSelection method. See example code below:
    Code (CSharp):
    1.             LE_GUI3dObject gui3d = Object.FindObjectOfType<LE_GUI3dObject>();
    2.             if (gui3d != null)
    3.             {
    4.                 gui3d.RemoveSelection();
    5.             }
     
  40. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    Writing a review now! I would like to be able to load a .raw file from the file system at runtime, similar to how you would at design time on a normal terrain. It would definitely put this package over the top for me.
     
  41. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Perfect, but to remove focus on a 3D object? I used this method:

    Object.GetComponent <LE_Object> (). IsSelected = false;

    But the scene still remain the "positioning arrows"
     
  42. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Object.GetComponent<LE_Object>().IsSelected removes the outline of the object, but does not more than this. The editor is not informed that the object is deselected, the LE_Object.EditMode is not changed. You have to use LE_GUI3dObject.RemoveSelection to deselect the object properly.


    Thanks!

    As you can see here it is not a complicated task to load a .raw file into a terrain.
    What would consume a lot of my time is the UI that needs to be done here. I'm thinking about creating a new extension for around 10$ which would allow loading .raw data.
    However, we should first agree how the UI should look like. Please tell me what you plans are.
    Here is what I could suggest:
    1. "Load .raw file" button in the bottom of the terrain create tab
    2. "Load .raw file" + "Save .raw file" buttons in the bottom of the terrain edit tab
    3. The same import and export settings as in the Unity Editor (see screenshot below)
    Clipboard02.png

    [EDIT]: the next week I'm on a business trip. I will not be able to do it this week. So it could take a while until I find the time for this.
     
    FaberVi likes this.
  43. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    @FreebordMAD I can customize the size of the items in the list? (Preview image and Text)
     
  44. Karmeck

    Karmeck

    Joined:
    May 26, 2016
    Posts:
    2
    then you move an object out to the map you can move it around freely, but as soon as you placed it you can no longer move it freely with out using the axis. Can it be made so the object stay free to move even after you placed it?
     
  45. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    Maybe have a load button at the bottom of the terrain tab and once the file is chosen have a pop-out that has the depth, width and height resolutions, as well as the byte order.
     
  46. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes, simply customize the width and height of the ObjectLeafPrefab and ObjectCategoryPrefab prefabs and their children.

    This is already on the todo list. It will be an additional edit mode where you can drag n' drop objects that were already placed. Unfortunately, this is not possible at the moment.

    Ok, which platform are you planning to release on?
     
    FaberVi likes this.
  47. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Perfect! Fixed :) .. For the case you can also customize the size of the arrows "gizmo" to the displacement of an object? In my case I have an object a small, arrows appear to be rated according to it (this, however, makes it difficult to use them).

    "then you move an object out to the map you can move it around freely, but as soon as you placed it you can no longer move it freely with out using the axis. Can it be made so the object stay free to move even after you placed it?"

    It would take me too this feature!
     
  48. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    PC, Mac, and probably Linux.
     
  49. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I'm on a business trip right now. I don't have access to my code, therefore I cannot provide any code examples or asset names...

    The edit handles should have the same size for all objects, they are scaled in screen space and should have the same size on the screen independent of the distance to the objects. Could it be that you have scaled the root of you LE_Object? If this is the problem, then you should use an empty, unscaled GameObject with the LE_Object script attached and your scaled object added as child.

    Ok, so this is on the list, but I cannot promise anything about the release date. The drag n' drop movement mode is now requested by 4 customers, so this will be the next feature.
     
    FaberVi likes this.
  50. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    That's totally fine with me. We are still early in development so its not something I need right away so take your time.