Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Amitloaf

Pages: [1] 2 3
1
NGUI 3 Support / Re: OnPostProcessAllAssets fails atlas creation
« on: August 24, 2014, 05:34:50 AM »
I agree. But we're creating the version for mobiles and we don't want to have major changes between different versions. So the workstations are configured to whichever platform (one of the several) and if someone edits an atlas on a PC configured workstation, we don't want him to ruin the atlases for the mobile version.

2
NGUI 3 Support / Re: OnPostProcessAllAssets fails atlas creation
« on: August 21, 2014, 01:57:56 AM »
Right but the max size is 4096 right? I need it at 2048..

3
NGUI 3 Support / Re: OnPostProcessAllAssets fails atlas creation
« on: August 20, 2014, 03:40:55 AM »
Ok... So I never saw any indication when my atlas is bigger than 2048x2048...
I'll update NGUI. How is the indication showing?

4
NGUI 3 Support / Re: OnPostProcessAllAssets fails atlas creation
« on: August 19, 2014, 02:43:19 AM »
3.5.9
Where is that check? How can I enable this?

5
NGUI 3 Support / OnPostProcessAllAssets fails atlas creation
« on: August 18, 2014, 06:15:07 AM »
I have a small script which checks whether atlases are too big by mistake. The script works well but when adding or updating an image in an atlas - it crashes. The error is:
  1. MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
  2. Your script should either check if it is null or you should not destroy the object.
  3. UnityEngine.Texture.get_width () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/TextureBindings.cs:48)
  4. UIAtlasMaker.PackTextures (UnityEngine.Texture2D tex, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:147)
  5. UIAtlasMaker.UpdateTexture (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:561)
  6. UIAtlasMaker.UpdateAtlas (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:676)
  7. UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:659)
  8. UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
  9. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
  10.  

The script itself is:
  1. public class AtlasChecker : MonoBehaviour {
  2.  
  3.     [MenuItem("Archon/Check Atlas Sizes")]
  4.     static void CheckAtlasesMenuCommand()
  5.     {
  6.         CheckAtlases();
  7.     }
  8.  
  9.     public static void CheckAtlases()
  10.     {
  11.         string[] assets = Directory.GetFiles(".\\Assets\\Graphics\\Atlases");
  12.         int curDirLen = 2;// Directory.GetCurrentDirectory().Length + 1;
  13.         float count = 0;
  14.         foreach (string asset in assets)
  15.         {
  16.             count++;
  17.             EditorUtility.DisplayProgressBar("Checking atlases", "Please wait...", (count / assets.Length));
  18.             if (Path.GetExtension(asset) == ".png")
  19.             {
  20.                 Texture2D atlas = AssetDatabase.LoadAssetAtPath(asset.Substring(curDirLen).Replace('\\','/'), typeof(Texture2D)) as Texture2D;
  21.  
  22.                 if (atlas != null)
  23.                 {
  24.                     if (atlas.height > 2048 || atlas.width > 2048)
  25.                     {
  26.                         Debug.LogWarning("<color=yellow>Atlas \"" + atlas.name + "\" is too big (" + atlas.width + "x" + atlas.height + ")!\nMight cause game to crash on iPad.</color>");
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.         EditorUtility.ClearProgressBar();
  32.     }
  33. }
  34.  
  35. class AutoCheckAtlases : AssetPostprocessor
  36. {
  37.     private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
  38.     {
  39.         AtlasChecker.CheckAtlases();
  40.     }
  41. }
  42.  

Any idea why that happens or how to work around it?

6
NGUI 3 Support / Pixelation on retina display for ipad
« on: July 17, 2014, 11:10:50 AM »
We had some pixelation when using a fixed ui root size of 1536 for the ipad retina.
This was solved when changing the atlas image to texture mode Advanced and removing the tick from Generate Mip Maps.
You might want to automate it, i don't see a reason why not.

7
NGUI 3 Support / Re: Bug in UIAnchor
« on: January 29, 2014, 12:31:45 PM »
Oh thanks!
I didn't know I can't just add a "UIWidget" script to whatever. I thought you needed to actually have a widget there. Thanks.

8
NGUI 3 Support / Re: Bug in UIAnchor
« on: January 29, 2014, 10:59:19 AM »
Ok but UIGrid doesn't have the new anchor, so how do I keep it anchored?

9
NGUI 3 Support / Bug in UIAnchor
« on: January 29, 2014, 09:12:08 AM »
One of them is easy for me to reproduce. The other.. is not.
Let's start with the first:
1) I have a UIPanel with a horizontal stretch. Under it, there's a child with a UIGrid and an Anchor to the left (to make it snap to the left side on creation so it will always be anchored to the left, no matter the resolution) but because the panel father is also a UIScrollView, I made it so the Anchor is set to Run Only Once.
In theory it should work as it will snap the anchor in the beginning and every screenchange. In practice it doesn't. I can see by debugging that it does actually calls update but it doesn't step. Moreover, if I turn the anchor on and then off again manually, it does snap. So I guess it's a bug in the Run Once Only. Maybe it does the calculations before the screen parameters it works by actually change.
To work around it, whenever I change screensize or something I just enable the anchor and it disables it by itself on Update and it fixes it.

10
NGUI 3 Support / Re: Weird bug (Transform not found for)
« on: April 11, 2013, 06:51:48 AM »
Found the cause - see EDIT below.

It continues to happen to me everywhere. For example:
I am disabling a panel and activating a new one. The new panel has a Checkbox with UICheckboxControlledObject.
The checkbox is unselected.
Throws this error:
No transform found for "UI Root (2D)/Camera/Workshop/Inventory/Bottom/Torso Checkbox/Background"
UnityEngine.Debug:LogError(Object, Object)
UIPanel:Fill(Material) (at Assets/NGUI/Scripts/UI/UIPanel.cs:931)
UIPanel:LateUpdate() (at Assets/NGUI/Scripts/UI/UIPanel.cs:993)
UIPanel:Refresh() (at Assets/NGUI/Scripts/UI/UIPanel.cs:1013)
UICheckboxControlledObject:OnActivate(Boolean) (at Assets/NGUI/Scripts/Interaction/UICheckboxControlledObject.cs:31)
UICheckboxControlledObject:OnEnable() (at Assets/NGUI/Scripts/Interaction/UICheckboxControlledObject.cs:22)
UnityEngine.GameObject:SetActive(Boolean)
MiniPanelManager:SwitchTo(UIPanel) (at Assets/Scripts/Management/Panels/MiniPanelManager.cs:30)
MiniPanelSwitch:OnClick() (at Assets/Scripts/Management/Panels/MiniPanelSwitch.cs:14)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:644)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1147)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:906)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:761)

Note: Background is the target of UICheckboxControlledObject and it's on Inverse.
The activation happens on the SwitchTo in MiniPanelManager.

EDIT: Found what causes this. UICheckboxControlledObject uses panel.Refresh() - and this one throws the exception when the panel is inactive - this throws an exception. Commenting that line out solves this.

11
NGUI 3 Support / Re: CenterOnChild with Draggable Camera
« on: April 09, 2013, 02:02:14 PM »
Found it and tried to use it but it just makes the image disappear. Well nevermind - guess i'll stick to the camera. Don't know enough on shaders to try and fix it :)
thanks!

12
NGUI 3 Support / Re: CenterOnChild with Draggable Camera
« on: April 09, 2013, 08:40:49 AM »
Another question. Can I use a shader that will allow me to use the soft clipping on the non NGUI thing? I couldn't find which material/shader NGUI is using (it's well hidden if there even is one). It will make everything prettier and easier.

13
NGUI 3 Support / Re: CenterOnChild with Draggable Camera
« on: April 09, 2013, 08:24:06 AM »
Will do. Just wanted to make sure i'm not missing anything. Thank you for your help! :)

14
NGUI 3 Support / CenterOnChild with Draggable Camera
« on: April 09, 2013, 06:25:27 AM »
I wanted to create a clipped panel but I need to use items in it which are not NGUI so clipping doesn't work here on the normal clipped panel. I decided to use the clipped camera which works but lacks much of the stuff draggable panel can do, like telling me when the drag is over and stuff. I tried to copy UICenterOnChild and change some stuff when I found out all the missing stuff.
Now I understand from the code that I just need to create a SpringPosition with Begin on the Draggable Camera to the position I need. But I don't know when the drag is over.
Is there a simple way to do that or do I need to throw that event from all the UIDragCamera objects that are connected to that camera?

15
NGUI 3 Support / Re: Weird bug (Transform not found for)
« on: April 09, 2013, 06:20:45 AM »
I'm disabling the whole panel. Then changing the spriteName of a sprite inside to a different existing sprite. Then i'm enabling the panel again. In that point it happens to me.

Pages: [1] 2 3