Search Unity

DMMap Minimap System 2.0! Procedural, Multilayer & Vector-like maps, uGUI! NOW FREE and OPEN SOURCE

Discussion in 'Assets and Asset Store' started by DMeville, Aug 8, 2014.

  1. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Sorry, just noticed one missing feature:
    For a multilevel map, icons don't have label specifications, which mean that they will show up on all layers. They will need a label field like the Map Shapes.
     
  2. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi @DMeville, how do I modify the map icons to appear on specific layers for a multilevel set up?
     
  3. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Yep, you're right. It looks like that was something I overlooked during the last update, however it should be trivial to add and I'll get you a build with that fixed. Shoot me an email (info@dylanmeville.com) with your invoice number and I'll send it over!
     
  4. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    Did anyone else have their maps turn white after the latest Unity update? My DMMaps in every scene in my game show as a white circle now.
     
  5. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Aww man, did Unity 5.2 break something? :(
    I haven't updated yet, but I'll grab it and see what's up.
     
  6. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @breakspirit I've just confirmed everything is working as it should with the Unity 5.2: http://i.imgur.com/89uOuhr.png
    If you'd like you can send me a small project where this is happening and I can take a look! (info@dylanmeville.com)
     
  7. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    Thanks for checking it out. I'll look into it on my own to make sure I didn't mess anything up before I waste any more of your time.
     
  8. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    It turns out I was unknowingly running an old version of DMMap and it didn't want to work with the new version of Unity. I updated and all's well.

    While I have your attention, I'd like to suggest some changes. DMMap makes the assumption that the user will always have a scene containing both the map and the target.
    My game has scenes that contain no map and the map target gets dynamically added to the scene at runtime.
    I modified your scripts to work for me, but it would be awesome if you had options to account for that.
    In DMMapIcon Start() method, all I do is check for DMMap.instance being null. If it is, I return. That prevents errors when the player moves to scenes without a map set up.
    In DMMap, I hardcode the Setup() method to do FindGameObjectWithTag on my player's tag. It would be cool if you added a tag selector in the editor to allow DMMap to dynamically find its target at runtime based on a given tag.

    Thanks.
     
  9. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @breakspirit thanks for the suggestions!

    - Icons existing in a scene with no map is definitely a problem I overlooked! I'll make it so it fails silently in these cases (without throwing a ton of errors)

    - I'd advise against changing around too much stuff in the DMMap classes, as it might break compatibility on updates. Additionally I like to leave things somewhat open ended for the user to use as they like, rather than adding in too many options many people will not use - however there are a few ways around this.

    The target (among other things) is set up so you can easily assign it in any Start() functions or later, from anywhere using "DMMap.instance.configs[configNum].objectToFocusOn = gameObject.transform"

    What I would suggest is creating a script that you place on your character prefab that gets spawned in, and does something like this, which is quick and easy, and saves you an expensive FindObjectWithTag call ;)

    Code (CSharp):
    1. //AssignMapFocus.cs
    2. //Included in DMMap 2.2
    3.  
    4. using UnityEngine;
    5. using DMM;
    6.  
    7. namespace DMM {
    8.     public class AssignMapFocus : MonoBehaviour {
    9.         void Start() {
    10.             if (DMMap.instance != null) {
    11.                 DMMap.instance.configs[0].objectToFocusOn = this.transform;
    12.             }
    13.         }
    14.     }
    15. }
     
  10. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    -= DMMap 2.2=-
    Status: Accepted!


    Changes:
    • Icons
      • Icons now have an additional "Layer" parameter - this defines that layer of the map the icon renders with (for multi-level maps). -1 corresponds to every layer, 0+ corresponds to the map layer with the same value. Assigning the icon layer value of 3, will have the icon only render with map layer 3.
      • If no map is present in a scene, icons can still exist on your prefabs without throwing errors. All behaviours just exit if DMMap.instance == null.
    • Misc
      • DMMap now throws an error if the Layer "DMMap" is missing.
      • DMMap automagically detects which layer it should be on at startup and sets the DMMapCamera.culling mask accordingly. This means if you change your DMMap layer (from user defined 8, to anything else) all changes will be reflected and just work.
      • All warnings were (finally) cleaned up.
      • New AssignMapFocus.cs script, which when assigned to a gameobject will set up DMMap to follow this object. Useful for characters spawned at runtime!
     
    Last edited: Sep 21, 2015
  11. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    69
    This looks super awesome, but are there any plans for fog of war ?
     
  12. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @superjay Thanks!

    Short answer is no; long answer is kinda.

    Fog of War was on todo-list for DMMap V1, and I even had a simple prototype working but it didn't perform well and was super slow. Fog of War is a tricky beast to conquer, and not a small undertaking. I haven't figured an appropriate and quick way to do this that is a drag-and-drop solution, that works well for the different types of map configurations DMMap offers.

    That being said, it is something I play with whenever I have the time or a free weekend (as DMMap is a weekend endeavour, and I have personal game projects I like to work on, too!), but I don't want to make promises I can't keep if this is something that never makes it to DMMap. I know it would be cool, and I would love to add it in, but no promises. Sorry!

    I'll try my best though :)
     
    Last edited: Sep 15, 2015
  13. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Hi, is there a way to add an image as the background for the map instead of a solid color?

     
  14. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @alardaen There isn't currently. But I can whip up a shader that allows for this. So after a bit of work we have this.
    Screen Shot 2015-09-20 at 7.18.32 PM.png

    1- Download the DMMap2.shader attached to this post, import it into your project.
    2 - Right click the DMMap2.shader and choose Create > Material. This will create a new material using this shader named DMMap2.mat
    3 - Select the DMMap > Canvas > Map object in the hierarchy. Replace the Material property on the Raw Image component to the new material we just created.
    4 - Press play to see it in action. You will need to change the Map Background Color's alpha on the DMMap component's Configs to 0 before your texture shows up (as it's rendered behind). Changing the opacity slider on the DMMap config changes the opacity of the MAP only (not the background). You can change the Background Tex and Background Text Opacity properties on the new material. Play with those until you find some combination of opacities that work.

    Hope that works for ya!

    Additionally, looks like Unity UI materials have been fixed, which means I can use shaderforge for them. Few months ago when I tried this it didn't work, so that's nice :)

    (This was tested on Unity 5.2, may not work on older versions because of the bug mentioned above)
     

    Attached Files:

    Last edited: Sep 21, 2015
  15. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Excellent it works like a charm.
     
  16. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @alardaen Glad to hear it!

    On a side note DMMap 2.2 was just accepted! Woohoo!

    If you like DMMap, and think I'm doing a good job with the product and support, PLEASE take a moment to rate or leave a review on the asset store. :)
     
    Last edited: Sep 22, 2015
  17. IndieGameHustle

    IndieGameHustle

    Joined:
    Jul 25, 2012
    Posts:
    66
    Is there a way to have the Mini Map follow the player using a tag instead of its transform? I am switching characters mid scene in and out and it seems to break the connection.
     
  18. IndieGameHustle

    IndieGameHustle

    Joined:
    Jul 25, 2012
    Posts:
    66
    Nevemind...:) I didn't place my code in the Update :)

    Code (CSharp):
    1.     // Update is called once per frame
    2.     void Update () {
    3.  
    4.  
    5.         DMMap.instance.configs[0].objectToFocusOn = GameObject.FindWithTag("Player").transform;
    6.  
    7.         DMMap.instance.configs[1].objectToFocusOn = GameObject.FindWithTag("Player").transform;
    8.  
    9.  
    10.     }
    11. }
     
    Last edited: Oct 14, 2015
    DMeville likes this.
  19. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Finally purchased DMMap and glad I did. I could feel a lot of my frustrations lift when I deleted the other asset from my project.

    Some thoughts / experiences / etc. using version 2.2:
    - How would you disable all maps, so none are being viewed at all? Loading configuration 0, 1, etc. makes sense for switching between map views, and that is awesome... reminds me of many games such as Torchlight, etc. where you can switch between the map views on your screen.
    - A lot of demos didn't work completely: dropping waypoints, map creation after procedural generating a map, multilevel movement. Regardless, the demos were helpful and I presume they just were broken on some Unity / DMMap update.
    - Make the DMM.DMMapIcon RotateIcon() method virtual. I made an override for my wonky-as-heck player rotation.
    - Tweening the zoom in/out levels would be awesome. I'll probably get to this when I have time, which might be never, but using LeanTween or something would be awesome.
    - It took me a while to realize that you were overriding any changes I made to the size of the overlay, etc. all to fit within the rectTransform for the specific map. On one hand, this is awesome, on the other... if my overlay has any translucency on the edges of its texture, you can see the map underneath as it moves. Perhaps a setting for 'padding' the edge of the map in case your texture has some shading/transparency near the edges. I was going to go a mess with the code to make it do this, but just used a different texture. The option would be nice.
    - The asset store picture has a version as the bottom, which is the wrong version.

    Side note: the fact that my rotation woes took less than an hour to fix by finding the rotation part of the icon and changing it to my needs was more than awesome. It took me multiple hours in many, many different parts of the code for other map assets.

    That's it for now. Back to playing with the map.
     
    DMeville likes this.
  20. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @Yukichu Thanks for the comments!
    -What version of Unity are you using? All the the demos _should_ be working. I just tested with 5.2.1f4 and all the demos work properly in a new project out of the box (after adding in the DMMap layer in the layer tabs, which is the only setup step). The only issue I found was movement isn't working on the multi-level demo for some reason. What issues were you seeing?

    -If you want to disable all the maps (but still leave the map "area", overlay etc) still visible you should be able to just disable the Mesh object. Otherwise you should be able to just disable the entire DMMap object without issues to remove it all temporarily Here's some code you can paste into the DMMap.cs, and can call via DMMap.instance.
    Code (CSharp):
    1. /// <summary>
    2.         /// Disables the map rendering (map + icons) while still keeping the overlay, and other map areas visible
    3.         /// </summary>
    4.         /// <returns></returns>
    5.         public void DisableMap() {
    6.             meshContainer.SetActive(false);
    7.             iconContainer.SetActive(false);
    8.         }
    9.         /// <summary>
    10.         /// Enables the map rendering.
    11.         /// </summary>
    12.         /// <returns></returns>
    13.         public void EnableMap() {
    14.             meshContainer.SetActive(true);
    15.             iconContainer.SetActive(true);
    16.         }
    Good ideas on the other points, adding tweening on the zooming should be pretty trivial (adding a new float and using that to control the zoom that slowly moves towards the normal zoom variable, using some easing method or animation curves), I'm not sure about adding in another package to DMMap, but I'm sure I can add something to make the process slightly easier.

    It might be easier to just add the padding to the image in photoshop rather than adding another (possibly confusing) property and aligning things on the rect transforms in the editor, but it's an interesting idea.

    I need to update the asset store images :p
     
  21. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Why it never occurred to me to just make the mask texture smaller so the map image would be smaller... I don't know. Yeah, forget my padding idea.

    Y'know, I probably did forget to add the DMMap layer to the demo scenes. I'll open it up and check again.

    Everything else is working splendidly. Thanks!
     
  22. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Very correct about the demos. I forgot to add the DMMap layer, oops. They appear to work fine.
     
  23. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    I finally figured out why my layers were not using any other shaders.

    When you startup DMMap and there are no DMMapShapes, it says there are no shapes, highest layer is 0, and well, it all goes bunk. I was using Generate() each time I changed a scene, but Generate() doesn't call UpdateMeshMaterials() so they were never updating when I did get to a scene where there actually are map shapes, layers, etc.

    On the bright side, I understand how it works better. Maybe have Generate() use a boolean as to whether we want to update the materials or not. Trivial to do, I know, the hard part was just figuring out why for me :)

    Other issue... I think XY overhead, now I may be crazy, but XY overhead sorting for the layers is wrong. XY overhead is viewed from the 'back' of the object. Maybe it's just my project, but 2DToolKit, Box2D, and well..if you hit the 2D button on the scene view in Unity, you'll see it's using the 3D "back" view, which means negative Z = closer to the camera, positive Z = further away. Anyhow, just posting this in the forum might be good enough if anyone else runs into this problem.

    This was easy to find. I just had to change the DMMap.cs line 541 to:
    meshObject.gameObject.transform.position = new Vector3(0f, 0f, -1f * layer);
     
    Last edited: Oct 24, 2015
    DMeville likes this.
  24. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    So I've managed to create icons I can click on, they create a tooltip when hovered over, rotation working very nicely, and overall just working well. I have a question if you might be able to help...

    You're currently create a waypoint by clicking in worldspace and then it shows up on the map. How could I click on the actual map and create a waypoint? I have the map registering click locations using callbacks on the map image texture, but... ugh...

    *thinking* Because you're using gameobjects in the actual worldspace for things such as this, I *think* I'd need to find the worldspace location from the map click and instantiate a waypoint object. Easy enough other than not sure how to get that value from the map click location.

    If it's too much trouble, I'll figure it out, but figured I'd ask as you might just know the answer faster than me spending a while playing with it.

    Thanks!
     
  25. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    @DMeville I'm having some serious issues with DMMap on Android devices. Whenever the screen orientation changes or the game is sent to background and then resumed, the map goes fullscreen covering everything but the Screen Space UI. This only happens with Multithreaded Rendering enabled, though and can be easily reproduced by running any of the demo scenes with screen orientation set to Auto.

    Could you look into it when you have a chance? Thanks
     
  26. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418

    You can already do this! The TopDown demo scene has a DMMapWaypointDemo script attached to it, hover over the minimap and press "Q" to create a waypoint in that location on the minimap. There's also some helper functions in DMMap to convert between map-space and world-space. (DMmap.instance.WorldToUI, UIToWorld, CreateWaypoint). Additionally, you can create waypoints by also creating an object at some world position, and if it has a DMMapIcon on it it will register on the map.

    Hope that helps! :D
     
  27. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    I'm afraid I don't have any mobile devices to test on :(
    If you want to send me an email at info@dylanmeville.com with a video/screenshots of what's happening, I can try and help you sort this out as best I can.
     
  28. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Question: How did you get curves in your example images for Angry Bots? Did you just use a whole lot of points on a shape, or... not entirely sure, which is why I ask.

    Request: Have the CreateWaypoint method return the gameobject. Yeah I can edit it myself, and I did, but some people will want to have only a single waypoint on the map, cache the returned object, destroy it when you create another.

    Other: The waypoint thing works well, though I had an issue that I've been trying to resolve independently which is... if you click anywhere on the map object bounds, you can set a waypoint, which is weird. Since it's a rectangle, there corners are available to set a waypoint, while... not really important, it is... weird. After much searching for how to determine if you're clicking within a mask texture, I gave up and did a different solution.

    Create/Attach a script to the icons object to detect mouse clicks via UI event system.
    Attach 2D collider(s) to icons object to match the mask shape.
    Add canvasgroup to overlay object, turn off block raycasts.
    During OnPointerDown, 2D raycast and determine if you hit the 2D collider. If yes, allow creating waypoint (or other logic)

    I had the same issue for doing anything with icons. The icons still exist behind the mask, so if I have logic to respond to clicking on them, hovering over them, they still respond while behind the mask. Using the same above steps fixes that issue.

    Also, yeah, in case anyone else was playing with it, the canvasgroup on the overlay to allow raycasts to hit the icons is essential for icon-mouse responses.
     
  29. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Yep, exactly.

    Yeah, that makes sense. Good idea!

    Hmm. I'm not sure what the best way to do this would be. A quick google leads me to this thread and eventually to this script, which seems to test the pixel alpha to see if the point is masked or not, might be helpful. I'll have to take a look at this a bit more in depth potentially this weekend and see if I can make the system a bit more user friendly. Initially the icons were not planned to be able to have behaviours added to them, until I realized it would be a very useful thing. So things were overlooked like this issue of responding to events while clipped by the mask.. hmm

    You might be able to use that script and when any events are triggered (OnPointerDown) check to see if you're inside or outside the mask area, and if you are not exit out early. Maybe.

    Your collider idea seems good though, although it does have an extra setup step (matching the collider to the mask) and throwing a bunch of raycasts, well there might be a more optimized solution.
     
  30. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    I spent forever searching for info like that. Apparently I didn't know what keywords I really wanted. Anyhow, his script seems a whole lot more complicated than my solution, though adding another setup step will likely break too many brains.

    Anyhow, I found out 2D raycast wasn't quite right, as up/down/left/right are 2D space and err... yeah just doesn't work. Physics2D.Circlecast with a small radius (1 or 2) or Physics2D.OverlapPoint seem to be working well.

    Well, whether you add it or not, there's a semi-decent solution in this thread for anyone else. I changed the icon creation to add some scripts to the gameobject to detect clicks / hover, and it's working fabulously. Now I have it so the corners don't respond anymore while you can't see the icons and it's golden. I presume the Box2D physics checks don't create too much overhead because, well, you have to hit the event first from the UI before it even begins checking stuff.
     
    DMeville likes this.
  31. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    So apparently this was a bug with unity's multithreaded rendering rather than the DMMap asset. For some reason the map camera would lose reference to the render texture on orientation change. Since orientation only changes when the application is sent to background in our game, adding the following hack to DMMap.cs fixed the issue:

    Code (CSharp):
    1. IEnumerator OnApplicationPause (bool status)
    2.         {
    3.             yield return new WaitForEndOfFrame ();
    4.             if (!status && DMMapCamera.targetTexture == null && mainRenderTexture != null)
    5.                 DMMapCamera.targetTexture = mainRenderTexture;
    6.         }
     
    DMeville likes this.
  32. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    There is a big demand on Steam for the ability to write a short note on the minimap like a console note. Is there anyway you could add that feature? Doesn't have to be more than a word or two.
     
  33. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hey! As of version 2.1, DMMap can have any uGUI elements included on the map (including text). Is this what you're after? If not let me know exactly (with an image, perhaps) and I can see what I can do!
     
  34. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Yes. But how do you make it so the player can input a short note and it saves? I'm not a coder although am learning C# as fast as I can

    If you could let me know how to allow a player to make a short text note on your minimap using uGui and it saves that would be very helpful. I'm happy to learn whatever I need to in order to do that. This is very exciting.

    My dream would be for a minimap somehow to save the player's progress so that if you left a scene, it would save some sort of graphic of where you've been. I've been googling my heart out to find out how to do that in Unity but no real luck so far.

    Nevertheless if I can place text on a minimap, that's fantastic. As mentioned before, Steam players almost demand it.
     
    Last edited: Jan 5, 2016
  35. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @catacomber

    Unfortunately I think something as robust as that is a bit beyond the scope of what I'd like to include in this asset. I can understand how it could be useful, but there is already hooks to make it pretty easy, and as every developer might have different needs it's difficult to cover it all.

    Anywho here's a quick rundown of how you might want to do it.

    1) Create an input field to grab input from the player. http://docs.unity3d.com/Manual/script-InputField.html
    2) Create an (empty) prefab, add a DMMapIcon component to it without any icon. Also add a DMMapIconLabel component.
    3) Click on the minimap (via some event or if(Input.GetMouseDown(1) in update or something) to get the world position of where the text should go. Grab the return value of DMMap.instance.UITOWorld(Input.mousePosition).
    4) Create a new instance of your prefab from step 2 with Instantiate(prefabName), and assign it's transform.position to the value from step 3. Assign the prefabInstance.GetComponent<DMMapIconLabel>().text value to whatever the player input in the input field.

    DMMap will automatically pick it up now and start rendering it on the minimap at the corresponding position!

    Regarding loading; You'll have to save the (world, transform.position) position of the prefabInstance along with the text/colour/font somewhere. Perhaps http://docs.unity3d.com/ScriptReference/PlayerPrefs.html. Then when the scene loads up (after Awake()) check to see if there's any saved notes in playerPrefs and if there is redo step 4 but use the saved values for position/text string.

    Regarding "saving some sort of graphic of where you've been". If you create all your DMMapShapes with different layers for every room, using a trigger volume in that room you can detect when a player enter/exits, and additionally the layer identifier for that room's DMMapShape. You could store all the rooms you've been in in a list and save them similarly to outlined above, and when the game is loaded read that list and show the appropriate rooms.
    Looking at the DMMap.cs code, you'd have to make one tiny edit of duplicating the SetActiveLayer function so there's an option that doesn't disable all layers. Then on reload you can just call:

    Code (CSharp):
    1. DMMap.instance.DisableAllLayers();
    2. List<int> discoveredRooms = new List<int>{0, 1, 2, 3};
    3. for(int i =0; i < discoveredRooms.Cout; i++){
    4. DMMap.instance.SetActiveLayerWithoutDisable(i)
    5. }
    6.  
    Included with the asset are a few demo scenes. Take a look at the topdown demo which has text that follows the player on the fullscreen minimap, and also the waypoint creator in that demo.
    Hope that's helpful!
     
    Last edited: Jan 5, 2016
  36. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    DMeville likes this.
  37. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Cool, happy to help!

    That link explains how to create an input textfield using the legacy (< 4.6 unity GUI), you need to use the new uGUI with DMMap :)

    Here's a link explaining how to do something similar with uGUI: http://answers.unity3d.com/questions/780097/how-to-use-the-new-input-field.html
     
  38. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Thanks. : D Left stars and review. I really like the flexibility of your map. One of your reviewers put up an image of how they used your system that is really useful to a player of their game and also very artistic. I think players appreciate that. They used it not only for an in-game minimap but for something more--I looked up their game and found it on Steam and GOG.
     

    Attached Files:

    • Map.jpg
      Map.jpg
      File size:
      125.2 KB
      Views:
      843
    Last edited: Jan 7, 2016
    DMeville likes this.
  39. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Found vague bug. On DMMapIcon, during OnDestroy callback, you then call DestroyImmediate() which... it's already being destroyed and now you're asking it to do it twice. So... yeah it makes an error. Nothing game breaking.

    Could use some cleanup too, generates a lot of garbage, which mobile users may not like. Not sure if anyone even used it on mobile? Just need to cache some references really.
     
    DMeville likes this.
  40. AlienTheory

    AlienTheory

    Joined:
    Feb 9, 2016
    Posts:
    5
    Hi DMeville, i just bought DMap, it works nicely in the editor.
    I have a issue when i build on windows target.
    When I set on both camera the same Depth to 0, on windows on the map is display on fuul screen mode:

    upload_2016-3-1_11-52-31.png

    And when i Set main camera depth to 1 and DMap camera depth to 0 there's a pink display:
    upload_2016-3-1_11-53-30.png

    Help please...
     
  41. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @AlienTheory Hmm that is very odd. Everything works in the editor correctly, but just doesn't work in a windows build? I'll take a look at this right now.

    In the meantime you could try building one of the demo scenes and see if the error happens there too. If it doesn't it must be something to do with changing the camera depths or something.
     
  42. AlienTheory

    AlienTheory

    Joined:
    Feb 9, 2016
    Posts:
    5
    Yes the demo scenes run like a charm on windows.
    Thanks for your response, this must be something around camera depth or shader on my project.
    I'll find the issue later, i'm sure it's my own project issue and not your's ;-).

    Thanks.
     
  43. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @AlienTheory Hmm that's super weird. I just tried to reproduce it and I couldn't. Everything seems to be working fine for me with every combination of camera depths I've tried. Sorry I can't be of more help!
     
  44. AlienTheory

    AlienTheory

    Joined:
    Feb 9, 2016
    Posts:
    5
    SOLVED !!!!

    DMeville, i found the issue and now it works very well !
    In my project i use a FPS component witch display framecount on OnGUI() (code that i silly copy on the web).
    When i disable this component everything display well, i think then OnGUI() or DoMyWindow() function is not well coded or something like that:

    void OnGUI()
    {
    if (!m_ShowFramerate)
    return;

    // Copy the default label skin, change the color and the alignement
    if (style == null)
    {
    style = new GUIStyle(GUI.skin.label);
    style.normal.textColor = Color.white;
    style.alignment = TextAnchor.MiddleCenter;
    }

    GUI.color = Color.green;
    startRect = GUI.Window(0, startRect, DoMyWindow, "");
    }

    void DoMyWindow(int windowID)
    {
    string formatedFramerate = string.Format("{0:0.00} fps", FPSManager.Instance.m_CurrentFramerate);
    GUI.Label(new Rect(0, 0, startRect.width, startRect.height), formatedFramerate, style);
    if (allowDrag) GUI.DragWindow(new Rect(0, 0, Screen.width, Screen.height));
    }

    Anyway, thank you very much for your time and sorry for this silly issue.
    Have a nice day and thank you again for DMMap witch is very cool and cheap.
     
    DMeville likes this.
  45. maynardkl

    maynardkl

    Joined:
    Nov 20, 2015
    Posts:
    6
    Hi Dylan,
    I just got some bug, maybe
    When I run the build (windowed) and I do Alt+Enter, the UI gone strange, can't back to normal view.
    here the screenshot dmmap.PNG

    Can u help to solve this?
    Thankyou before
     
  46. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
  47. loliconest

    loliconest

    Joined:
    Sep 21, 2015
    Posts:
    31
    Hello, are you gonna add FOW?

    If you are, when?

    I wonder if I can use your product to do a moba type game.
     
  48. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @loliconest Sorry, no plans for FOW any time soon. See this post: http://forum.unity3d.com/threads/re...e-maps-ugui-25-off.261178/page-3#post-2295873

    If it does happen, it will be a separate asset because of the complexity. If we're talking about FOW in games like starcraft, it's not something that only happens on the minimap, but on the entire game world too, and this is the kind of FOW I'd like to create. (Which would of course extend to the minimap as well, and DMMap would integrate easily with it)
     
  49. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Hello,

    Let me ask you something concerned about 'objectToFocusOn'.

    What I want to do is that:

    1) A player is always located on the center of the minimap
    2) When a player is rotated, only the player icon which is specified with DMMapIcon is rotate not a whole minimap is rotated.
    3) When a player moves, the player icon still remains on the center on the minimap but the minimap moves.

    I've set objectToFocusOn as the following:

    Code (csharp):
    1.  
    2. DMM.DMMap.instance.configs[0].objectToFocusOn = modelObj.transform;
    3.  
    With the specifying above code, whenever the player is move or rotate, the minimap also moves and rotates.

    How can I make the map only moves but not rotate?

    I'm using DMMap 2.2, the latest version on the Assetstore with Unity 5.3.3f1.

    Thanks,

    -Kim
     
  50. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @kimsama Yep this is doable. DMMap config has a Rotate bool, toggling this off will make it so the map does not rotate with when the focused object is rotated. Next in order to get the player icon to rotate toggle on the Rotate bool on the DMMapIcon.

    Hope that helps!