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 - Tama

Pages: [1]
1
NGUI 3 Support / Crash adding to atlas in 3.5.6
« on: January 13, 2015, 03:27:48 AM »
When I try to add to my "GUI_atlas" it crashes Unity 4.6.1p2. NGUI version is 3.5.6
I've "fixed" the problem for now by adding it to my "button_atlas" instead. Settings for both atlases is identical; and the image should fit in either easily.
Error logs are listed in order of occurence (reverse order as they are shown in Console window)


MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Texture.get_width () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/TextureBindings.cs:48)
UIAtlasMaker.PackTextures (UnityEngine.Texture2D tex, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:147)
UIAtlasMaker.UpdateTexture (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:561)
UIAtlasMaker.UpdateAtlas (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:676)
UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:659)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
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)


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
NGUIEditorTools:ImportTexture(Texture, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:525)
UIAtlasMaker:ExtractSprites(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:517)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:649)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
UIAtlasMaker:UpdateTexture(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:570)
UIAtlasMaker:UpdateAtlas(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:676)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:659)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
NGUIEditorTools:ImportTexture(Texture, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:525)
UIAtlasMaker:ExtractSprites(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:517)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:649)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()

2
NGUI 3 Support / uilabel won't update
« on: January 12, 2015, 08:17:15 AM »
I've added a sprite, added a label with resizeHeight as overflow option, anchored to the sprite on all sides except the bottom.

One would think that the vertical position would then be fixed to however I set it. However, if I add text to it in Start() of an attached script, the vertical position is all wrong. If I then select it in the editor and add/remove text, the position moves towards the position I set the top to in the editor.

The hackaround is to add a for loop that adds and removes a space at the end of the text 10 times, and then enables the gameobject.

3
NGUI 3 Support / Crash adding to atlas in 3.5.6
« on: January 07, 2015, 04:55:03 AM »
When I try to add to my "GUI_atlas" it crashes Unity 4.6.1p2. NGUI version is 3.5.6
I've "fixed" the problem for now by adding it to my "button_atlas" instead. Settings for both atlases is identical; and the image should fit in either easily.
Error logs are listed in order of occurence (reverse order as they are shown in Console window)


MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Texture.get_width () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/TextureBindings.cs:48)
UIAtlasMaker.PackTextures (UnityEngine.Texture2D tex, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:147)
UIAtlasMaker.UpdateTexture (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:561)
UIAtlasMaker.UpdateAtlas (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:676)
UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:659)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
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)


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
NGUIEditorTools:ImportTexture(Texture, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:525)
UIAtlasMaker:ExtractSprites(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:517)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:649)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
UIAtlasMaker:UpdateTexture(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:570)
UIAtlasMaker:UpdateAtlas(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:676)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:659)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()


importer.GetNPOTScale() == TextureImporter::kNPOTKeep
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
NGUIEditorTools:ImportTexture(Texture, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:525)
UIAtlasMaker:ExtractSprites(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:517)
UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:649)
UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1005)
UnityEditor.DockArea:OnGUI()

4
NGUI 3 Support / Re: Progressbar with rounded corners
« on: July 31, 2014, 02:12:03 AM »
Has this changed in the past two years?

5
NGUI 3 Support / can betterlist be re-tested?
« on: July 09, 2014, 07:07:25 AM »
I have a UITable subclass that overrides Sort. When changing UITable to UIGrid, I was amazed to find their sort functions different.

UITable:Sort (List<Transform> list)
UIGrid:Sort (BetterList<Transform> list)

So I had to investigate what this "BetterList" is. According to this post:
http://www.tasharen.com/forum/index.php?topic=1265.0
BetterList hasn't been tested since Unity 3.5
Do you think it could be re-evaluated to find out whether it is still necessary? It seems silly using both BetterList and List in the same codebase.

Besides changing the parameter type for my Sort override, I also had to change the comparitor type from Comparison<Transform> to BetterList<Transform>.CompareFunc
Why can't BetterList use Comparison<T> as its compare function?

6
NGUI 3 Support / Button with arguments
« on: July 04, 2014, 09:27:47 AM »
I'm trying to make a set of buttons that call the same function but with a different argument value. I saw that back in 2012, someone had the same problem here:
http://www.tasharen.com/forum/index.php?topic=2353.0
and never solved it. I can see that if I add a button and put in a method that takes parameters, the button inspector shows an "Arg 0" field, but that seems to want me to drag in a gameobject. I want to be able to pass a string or int, for instance, not a gameobject.

I know I can make different methods that just differ in what value they pass on, and then attach each button to one of these methods, but I was wondering if there was a neater solution?

7
NGUI 3 Support / bug - pivot incorrectly updated
« on: June 16, 2014, 05:04:01 AM »
If you have a sprite set to pivot "bottom", then open sprite editor and drag the point around, click apply. The pivot is now set to 0.5, 0.5 instead of the values you selected (but these DO appear in the sprite editor as the current setting). My fix at the moment is to drag the point around again and apply again.

8
NGUI 3 Support / Re: Scrollview with slider
« on: June 10, 2014, 03:10:17 AM »
The worst part about it is that the OnValueChanged event is no longer triggered. Even without changing the code, if you make a copy of UISlider, rename it, put it into the scene with an event listener on value changed, it will not fire.

So I've solved this issue for now in the ugliest way possible; by changing UISlider itself... *shudder*
I hope you can help me figure out how to do this properly.

9
NGUI 3 Support / Re: Scrollview example page out of date
« on: June 10, 2014, 03:03:09 AM »
I solved my problem with the ugliest code I've ever written. I didn't want to change code in NGUI because it would be overwritten when we update, and because UISlider:OnDragBackground() is not virtual, that meant I had to copy and rename that whole class to override the one function. This allowed me to implement it so that it passes on the value if it is more vertical than horizontal:

protected void OnDragBackground (GameObject go, Vector2 delta)
   {
      if (UICamera.currentScheme == UICamera.ControlScheme.Controller) return;
      mCam = UICamera.currentCamera;
      if ( Math.Abs(delta.y) > Math.Abs(delta.x) ) {
         parentScroller.currentMomentum = new Vector3(0.0f, delta.y*0.003f, 0.0f);

         return;
      }
      value = ScreenToValue(UICamera.lastTouchPosition);
   }

parentScroller is a UIScrollView. It works, but it's a really ugly solution.

10
NGUI 3 Support / Re: Scrollview example page out of date
« on: June 06, 2014, 09:43:09 AM »
Thanks. However all I could find in there was a simple scrollview example, without any kind of interactive component within.
I'm actually trying to make a scrollview with sliders in it, so that you can move either or both at the same time. (they are restricted to orthogonal directions of course)

11
NGUI 3 Support / Scrollview with slider
« on: June 04, 2014, 07:14:25 AM »
The example page for NGUI scrollviews http://www.tasharen.com/?page_id=4444
refers to some components that don't seem to exist, such as "UIDraggablePanel".

I found a tutorial made in 2013 that addresses this. http://funcodegames.blogspot.nl/2013/08/creating-ngui-scroll-view-with-clipped.html
Sadly, this one also refers to missing component "Draggable Panel"

Could someone show how to make a draggable panel? Preferably demonstrating how buttons work within it as well?

Pages: [1]