Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            proxy = (SpriteDeformerBlendShapeAnimatorProxy)this.target;
            if (proxy.spriteDeformerBlendShape == null)
            {
                EditorGUILayout.LabelField("Sprite deformer blendShape is not found");
                return;
            }
            float count = proxy.spriteDeformerBlendShape.countOfShapes;

            if (count > 20)
            {
                count = 20;
            }
            for (int i = 0; i < count; i++)
            {
                float value = EditorGUILayout.Slider(proxy.getValueByIndex(i), 0, 1);
                proxy.setValueByIndex(i, value);
            }
            if (GUI.changed)
            {
                EditorUtility.SetDirty(proxy);
                EditorUtility.SetDirty(proxy.spriteDeformerBlendShape);
            }

            //base.OnInspectorGUI();
        }
        public override void OnInspectorGUI()
        {
            proxy = (SpriteDeformerBlendShapeAnimatorProxy)this.target;
            if (proxy.spriteDeformerBlendShape == null)
            {
                EditorGUILayout.LabelField("Sprite deformer blendShape is not found");
                return;
            }
            float count = proxy.spriteDeformerBlendShape.countOfShapes;
            if (count > 20) count = 20;
            for (int i = 0; i < count; i++)
            {
                float value =  EditorGUILayout.Slider(proxy.getValueByIndex(i),0,1);
                proxy.setValueByIndex(i, value);
                
            }
            if (GUI.changed)
            {
                EditorUtility.SetDirty(proxy);
                EditorUtility.SetDirty(proxy.spriteDeformerBlendShape);
            }

            //base.OnInspectorGUI();
        }