Hello Guest

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

Pages: [1]
1
Support / When should I update my custom Advanced Colliders?
« on: July 09, 2014, 02:33:12 pm »
Hi,

I'm trying to use your advanced colliders system and it works very well. But I'd like to know what is the best strategy to update them at runtime. Should I do that in the regular Update() loop, or would it be more suited to do it during LateUpdate() to get in sync with the spriteAnimator or even in a FixedUpdate() to match the physics?


2
Thanks guys for sharing this script.

Here is an improved version.

Code: [Select]
using System;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Reflection;

[CanEditMultipleObjects()]
[CustomEditor(typeof(MeshRenderer))]
public class MeshRendererSortingLayersEditor : Editor
{
    Renderer renderer;
    string[] sortingLayerNames;
    int selectedOption;

    void OnEnable()
    {
        sortingLayerNames = GetSortingLayerNames();
        renderer = (target as Renderer).gameObject.renderer;

        for (int i = 0; i<sortingLayerNames.Length;i++)
        {
            if (sortingLayerNames[i] == renderer.sortingLayerName)
                selectedOption = i;
        }
    }

    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

if (!renderer) return;

EditorGUILayout.BeginHorizontal();
        selectedOption = EditorGUILayout.Popup("Sorting Layer", selectedOption, sortingLayerNames);
        if (sortingLayerNames[selectedOption] != renderer.sortingLayerName)
        {
            Undo.RecordObject(renderer, "Sorting Layer");
renderer.sortingLayerName = sortingLayerNames[selectedOption];
            EditorUtility.SetDirty(renderer);
        }
  EditorGUILayout.LabelField("(Id:" + renderer.sortingLayerID.ToString() + ")", GUILayout.MaxWidth(40));
EditorGUILayout.EndHorizontal();

        int newSortingLayerOrder = EditorGUILayout.IntField("Order in Layer", renderer.sortingOrder);
        if (newSortingLayerOrder != renderer.sortingOrder)
        {
            Undo.RecordObject(renderer, "Edit Sorting Order");
            renderer.sortingOrder = newSortingLayerOrder;
            EditorUtility.SetDirty(renderer);
        }
    }

    // Get the sorting layer names
    public string[] GetSortingLayerNames()
    {
        Type internalEditorUtilityType = typeof(InternalEditorUtility);
        PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic);
        return (string[])sortingLayersProperty.GetValue(null, new object[0]);
    }
}

3
Releases / Re: 2D Toolkit UI 0.9 Alpha Preview 1
« on: March 13, 2013, 08:45:05 am »
Wow! This is an amazing add-on to 2DToolkit. Thanks so much.  :)

4
Support / Number of frames and CPU charge
« on: November 09, 2012, 11:07:33 am »
Hey,

I use 2D Toolkit intensively in my game project and I'm very happy with this tool. So, I'd like to thank you for your work.
Then, my questions...

I'd like to know if the number of frames used in an animation has an impact on the cpu charge.
1- Will 100 simultaneously active sprites with 24 frames be more heavy on the CPU than the same sprites with only 5 frames for the same animation?
2- What in your opinion is the best strategy to display sprites only when necessary (when they're inside the camera bounds)?

And finally, that leads me to a feature request: I'd like to have an option on tk2dAnimatedSprite to choose between several culling types (Always Animate, Based On Renderers, Based On User Bounds...).

5
Support / Re: Error: The name "AssetDatabase" does not exist
« on: October 22, 2012, 02:47:02 pm »
yep, I did it.

6
Support / Re: Error: The name "AssetDatabase" does not exist
« on: October 22, 2012, 01:22:43 pm »
I just found other errors when using javascript:
tk2RuntimeSpriteCollection, tk2dResource and tk2dSystem should be moved to the Plugins folder.

7
Support / Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
« on: July 25, 2012, 07:43:16 pm »
If I replace sprite.isPlaying() with sprite.Playing(), I get this error message:
It is not possible to invoke an expression of type 'boolean'.

What did I do wrong?

8
Support / Re: PoolManager + Animated Sprites from 2D Toolkit
« on: July 25, 2012, 02:52:14 pm »
Any update about this issue?

9
Support / 'tk2dAnimatedSprite.isPlaying()' is obsolete
« on: July 25, 2012, 02:09:21 pm »
With the previous versions of 2DTK, I was using this kind of code :

Code: [Select]
if (sprite.isPlaying() && sprite.clipId == 1)
{
DoSomething()
}

Now that tk2dAnimatedSprite.isPlaying() is obsolete, what should I use to get a similar result while staying compliant with your new API?

10
Support / Re: Atlas quality problem on iOS platform
« on: April 06, 2012, 09:32:02 am »
I tried to switch from PC/MAC to iOS with Unity 3.4.2 and I got the same issue too.
So this issue is not related specifically to Unity 3.5. I don't have any older version to check if this behavior always happened.

Unfortunately it seems we'll have to stick to 1024 textures on iOS until a workaround or a real solution is found by the Unity team.
I'm gonna post a message on Unity Support forum...

11
Support / Re: Atlas quality problem on iOS platform
« on: April 05, 2012, 10:59:35 pm »
I did everything you said (no platform texture override, full res, applied the atlas texture onto a cube), and I got the same result.
It seems that the larger texture size you use, the more it is displayed downsized.

So, if I understand well, this issue is not related to 2DTK but to Unity...

It would be interesting to know if this bug was already happening in previous Unity releases. I never noticed it before, but I never used textures larger than 1024 pixels wide before. So, I can't really say...

12
Support / Re: Atlas quality problem on iOS platform
« on: April 05, 2012, 07:45:58 pm »
What parameters were used for this (dicing / multiatlas / etc)? Also does this happen within the viewport when iOS is selected as the platform? Also, why are there "tile" outlines in your image?

Only dicing is used. No multiatlas... Look at the screenshots for more info.
And what you're calling the "tile" outlines is the grid in the scene editor.

13
Support / Atlas quality problem on iOS platform
« on: April 05, 2012, 04:29:15 pm »
As you can see on the attached screenshot, the larger size i use for the Atlas texture, the uglier the sprites are becoming.
This behavior happens when the selected platform is iOS but if I switch to PC/MAC, the quality remains the same whatever Atlas size is used.
I'm using Unity 3.5 with the latest 2DTK release 1.60 patch1 with following settings:
Target Height : 768
Target Ortho Size : 1
Orthographic Camera Size : 384

I tried with different settings but always I ended with the same behavior.
I checked the quality settings too and the texture is set to full resolution on each platform.
I also checked the Atlas generated by 2DTK, but it looks perfect, whatever its size. It seems that the problem is only affecting the sprites display.

14
Support / Use sprite dicing and scroll UVs
« on: March 05, 2012, 06:25:23 pm »
I'm currently using 2D the dicing feature to split large textures and make them fit into smaller spritesheets. But I'd like to scroll some of these diced textures, using the scrolling UVs technique. Would there be one way to keep the benefits of this feature while making it work as wanted, or is it completely impossible to achieve such a thing?

Pages: [1]