public void DrawInspector(EditorSkinPartsPropertry property)
        {
            SkinnerEditorUtility.ResetArray(property.objectReferenceValues, AnimationSample.ObjectLength);
            SkinnerEditorUtility.ResetArray(property.floatValues, AnimationSample.FloatLength);
            var gameObjectProperty    = property.objectReferenceValues.GetArrayElementAtIndex(AnimationSample.GameObjectIndex);
            var animationClipProperty = property.objectReferenceValues.GetArrayElementAtIndex(AnimationSample.AnimationClipIndex);
            var timeProperty          = property.floatValues.GetArrayElementAtIndex(AnimationSample.TimeIndex);

            gameObjectProperty.objectReferenceValue    = EditorGUILayout.ObjectField(SkinContent.RootGameObject, gameObjectProperty.objectReferenceValue, typeof(GameObject), true);
            animationClipProperty.objectReferenceValue = EditorGUILayout.ObjectField(SkinContent.AnimationClip, animationClipProperty.objectReferenceValue, typeof(AnimationClip), false);
            if (!animationClipProperty.hasMultipleDifferentValues && animationClipProperty.objectReferenceValue is AnimationClip)
            {
                var clip = animationClipProperty.objectReferenceValue as AnimationClip;
                EditorGUILayout.Slider(timeProperty, 0, clip.length, SkinContent.SampleTime);
            }
            else
            {
                bool showMixedValue = EditorGUI.showMixedValue;
                if (timeProperty.hasMultipleDifferentValues)
                {
                    EditorGUI.showMixedValue = true;
                }
                timeProperty.floatValue  = EditorGUILayout.FloatField(SkinContent.SampleTime, timeProperty.floatValue);
                EditorGUI.showMixedValue = showMixedValue;
            }
        }
예제 #2
0
        public void DrawInspector(EditorSkinPartsPropertry property)
        {
            SkinnerEditorUtility.ResetArray(property.objectReferenceValues, RawImageTexture.ObjectLength);
            var rawImageProperty = property.objectReferenceValues.GetArrayElementAtIndex(RawImageTexture.RawImageIndex);
            SerializedProperty textureProperty = property.objectReferenceValues.GetArrayElementAtIndex(RawImageTexture.Texture2DIndex);

            rawImageProperty.objectReferenceValue = EditorGUILayout.ObjectField(SkinContent.RawImage, rawImageProperty.objectReferenceValue, typeof(RawImage), true);
            textureProperty.objectReferenceValue  = EditorGUILayout.ObjectField(SkinContent.Texture2D, textureProperty.objectReferenceValue, typeof(Texture2D), false);
        }
        public void DrawInspector(EditorSkinPartsPropertry property)
        {
            SkinnerEditorUtility.ResetArray(property.objectReferenceValues, GraphicMaterial.ObjectLength);
            var graphicProperty  = property.objectReferenceValues.GetArrayElementAtIndex(GraphicMaterial.GraphicIndex);
            var materialProperty = property.objectReferenceValues.GetArrayElementAtIndex(GraphicMaterial.MaterialIndex);

            graphicProperty.objectReferenceValue  = EditorGUILayout.ObjectField(SkinContent.Graphic, graphicProperty.objectReferenceValue, typeof(Graphic), true);
            materialProperty.objectReferenceValue = EditorGUILayout.ObjectField(SkinContent.Material, materialProperty.objectReferenceValue, typeof(Material), false);
        }
예제 #4
0
        public void DrawInspector(EditorSkinPartsPropertry property)
        {
            SkinnerEditorUtility.ResetArray(property.objectReferenceValues, ImageSprite.ObjectLength);
            var imageProperty = property.objectReferenceValues.GetArrayElementAtIndex(ImageSprite.ImageIndex);
            SerializedProperty spriteProperty = property.objectReferenceValues.GetArrayElementAtIndex(ImageSprite.SpriteIndex);

            imageProperty.objectReferenceValue  = EditorGUILayout.ObjectField(SkinContent.Image, imageProperty.objectReferenceValue, typeof(Image), true);
            spriteProperty.objectReferenceValue = EditorGUILayout.ObjectField(SkinContent.Sprite, spriteProperty.objectReferenceValue, typeof(Sprite), false);
        }
예제 #5
0
 /// <summary>
 /// <see cref="SkinPartsPropertry">を<see cref="EditorSkinPartsPropertry"/>にマップする
 /// </summary>
 /// <param name="mapTarget">マップ対象となるオブジェクト</param>
 /// <param name="mapSource">マップ元となるオブジェクト</param>
 public static void MapRuntimePropertyFromEditorProperty(EditorSkinPartsPropertry mapTarget, SkinPartsPropertry mapSource)
 {
     MapEditorFromRuntimeSingleProperty(mapTarget.objectReferenceValues, mapSource.objectReferenceValues, (v, p) => p.objectReferenceValue = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.boolValues, mapSource.boolValues, (v, p) => p.boolValue          = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.colorValues, mapSource.colorValues, (v, p) => p.colorValue       = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.floatValues, mapSource.floatValues, (v, p) => p.floatValue       = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.intValues, mapSource.intValues, (v, p) => p.intValue             = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.vector4Values, mapSource.vector4Values, (v, p) => p.vector4Value = v);
     MapEditorFromRuntimeSingleProperty(mapTarget.stringValues, mapSource.stringValues, (v, p) => p.stringValue    = v);
 }
예제 #6
0
 public void CleanupFields(EditorSkinPartsPropertry property)
 {
     SkinnerEditorUtility.CleanArray(property.objectReferenceValues, RawImageTexture.ObjectLength);
     SkinnerEditorUtility.CleanObject <RawImage>(property.objectReferenceValues, RawImageTexture.RawImageIndex);
     SkinnerEditorUtility.CleanObject <Texture2D>(property.objectReferenceValues, RawImageTexture.Texture2DIndex);
     SkinnerEditorUtility.CleanArray(property.boolValues);
     SkinnerEditorUtility.CleanArray(property.colorValues);
     SkinnerEditorUtility.CleanArray(property.floatValues);
     SkinnerEditorUtility.CleanArray(property.intValues);
     SkinnerEditorUtility.CleanArray(property.vector4Values);
     SkinnerEditorUtility.CleanArray(property.stringValues);
 }
 public void CleanupFields(EditorSkinPartsPropertry property)
 {
     SkinnerEditorUtility.CleanArray(property.objectReferenceValues, GraphicMaterial.ObjectLength);
     SkinnerEditorUtility.CleanObject <Graphic>(property.objectReferenceValues, GraphicMaterial.GraphicIndex);
     SkinnerEditorUtility.CleanObject <Material>(property.objectReferenceValues, GraphicMaterial.MaterialIndex);
     SkinnerEditorUtility.CleanArray(property.boolValues);
     SkinnerEditorUtility.CleanArray(property.colorValues);
     SkinnerEditorUtility.CleanArray(property.floatValues);
     SkinnerEditorUtility.CleanArray(property.intValues);
     SkinnerEditorUtility.CleanArray(property.vector4Values);
     SkinnerEditorUtility.CleanArray(property.stringValues);
 }
예제 #8
0
 public void CleanupFields(EditorSkinPartsPropertry property)
 {
     SkinnerEditorUtility.CleanArray(property.objectReferenceValues, ImageSprite.ObjectLength);
     SkinnerEditorUtility.CleanObject <Image>(property.objectReferenceValues, ImageSprite.ImageIndex);
     SkinnerEditorUtility.CleanObject <Sprite>(property.objectReferenceValues, ImageSprite.SpriteIndex);
     SkinnerEditorUtility.CleanArray(property.boolValues);
     SkinnerEditorUtility.CleanArray(property.colorValues);
     SkinnerEditorUtility.CleanArray(property.floatValues);
     SkinnerEditorUtility.CleanArray(property.intValues);
     SkinnerEditorUtility.CleanArray(property.vector4Values);
     SkinnerEditorUtility.CleanArray(property.stringValues);
 }
        protected override void DrawOptionProperty(EditorSkinPartsPropertry property)
        {
            var  vector4Property = property.vector4Values.GetArrayElementAtIndex(TransformRotation.VectorIndex);
            bool showMixedValue  = EditorGUI.showMixedValue;

            if (vector4Property.hasMultipleDifferentValues)
            {
                EditorGUI.showMixedValue = true;
            }
            vector4Property.vector4Value = EditorGUILayout.Vector3Field(SkinContent.LocalRotation, vector4Property.vector4Value);
            EditorGUI.showMixedValue     = showMixedValue;
        }
예제 #10
0
 public void CleanupFields(EditorSkinPartsPropertry property)
 {
     SkinnerEditorUtility.CleanArray(property.objectReferenceValues, AnimationSample.ObjectLength);
     SkinnerEditorUtility.CleanObject <GameObject>(property.objectReferenceValues, AnimationSample.GameObjectIndex);
     SkinnerEditorUtility.CleanObject <AnimationClip>(property.objectReferenceValues, AnimationSample.AnimationClipIndex);
     SkinnerEditorUtility.CleanArray(property.boolValues);
     SkinnerEditorUtility.CleanArray(property.colorValues);
     SkinnerEditorUtility.CleanArray(property.floatValues, AnimationSample.FloatLength);
     SkinnerEditorUtility.CleanArray(property.intValues);
     SkinnerEditorUtility.CleanArray(property.vector4Values);
     SkinnerEditorUtility.CleanArray(property.stringValues);
 }
예제 #11
0
 protected override void DrawOptionProperty(EditorSkinPartsPropertry property)
 {
     EditorGUILayout.PropertyField(property.colorValues.GetArrayElementAtIndex(OutlineColor.ColorIndex), SkinContent.Color);
 }
 protected override void DrawOptionProperty(EditorSkinPartsPropertry property)
 {
     EditorGUILayout.Slider(property.floatValues.GetArrayElementAtIndex(CanvasGroupAlpha.FloatIndex), 0, 1, SkinContent.Alpha);
 }
예제 #13
0
 protected override void DrawOptionProperty(EditorSkinPartsPropertry property)
 {
     EditorGUILayout.PropertyField(property.boolValues.GetArrayElementAtIndex(GraphicEnable.BoolIndex), SkinContent.Enabled);
 }
예제 #14
0
 public void CleanupFields(EditorSkinPartsPropertry property)
 {
     SkinnerEditorUtility.CleanObjectReferenceArrayWithFlexibleSize <T>(property.objectReferenceValues, DefaultArrayLength);
     CleanupFieldsOtherThanObjectReference(property);
 }
예제 #15
0
        public void DrawInspector(EditorSkinPartsPropertry property)
        {
            SkinnerEditorUtility.ResetArray(property.objectReferenceValues, DefaultArrayLength, false);
            ResetArrayOtherThanObjectReference(property);

            var componentInfo = SkinnerEditorUtility.GetComponentInfos(typeof(T));


            for (int iz = 0; iz < property.objectReferenceValues.arraySize; iz++)
            {
                EditorGUILayout.BeginHorizontal();
                SerializedProperty gameObjectProperty = property.objectReferenceValues.GetArrayElementAtIndex(iz);
                m_FieldNumberTitle.text = string.Format(EditorConst.FieldNumberTitle, iz);
                gameObjectProperty.objectReferenceValue = EditorGUILayout.ObjectField(m_FieldNumberTitle, gameObjectProperty.objectReferenceValue, typeof(T), true);
                if (componentInfo.isComponent && componentInfo.allowMultiplyComponent)
                {
                    T        c = gameObjectProperty.objectReferenceValue as T;
                    int      componentIndex = -1;
                    List <T> componentList  = null;
                    if (c)
                    {
                        componentList  = (c as Component).gameObject.GetComponents <T>().ToList();
                        componentIndex = componentList.IndexOf(c);
                    }
                    bool guiEnabled = GUI.enabled;
                    if (componentIndex < 0)
                    {
                        componentIndex = 0;
                        GUI.enabled    = false;
                    }
                    int editIndex = EditorGUILayout.IntField(GUIContent.none, componentIndex, EditorConst.ComponentIndexFieldMaxWidth);
                    if (editIndex != componentIndex)
                    {
                        editIndex = Mathf.Clamp(editIndex, 0, componentList.Count - 1);
                        gameObjectProperty.objectReferenceValue = componentList[editIndex];
                        gameObjectProperty.serializedObject.ApplyModifiedProperties();
                    }
                    GUI.enabled = guiEnabled;
                }
                if (SkinnerEditorUtility.DrawAddButton(EditorConst.RemoveFieldButtonTitle, () => {
                    property.objectReferenceValues.GetArrayElementAtIndex(iz).objectReferenceValue = null;
                    property.objectReferenceValues.DeleteArrayElementAtIndex(iz);
                    property.objectReferenceValues.serializedObject.ApplyModifiedProperties();
                }))
                {
                    return;
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.BeginHorizontal();

            DrawOptionProperty(property);

            m_AddFieldButtonTitle.text = string.Format(EditorConst.AddFieldButtonTitle, SkinnerEditorUtility.GetEditorName(typeof(T).Name));

            bool isClicked = SkinnerEditorUtility.DrawAddButton(m_AddFieldButtonTitle, () => {
                property.objectReferenceValues.InsertArrayElementAtIndex(property.objectReferenceValues.arraySize);
                property.objectReferenceValues.serializedObject.ApplyModifiedProperties();
            });

            if (isClicked)
            {
                return;
            }
            EditorGUILayout.EndHorizontal();
        }
예제 #16
0
 protected abstract void DrawOptionProperty(EditorSkinPartsPropertry property);
 protected override void DrawOptionProperty(EditorSkinPartsPropertry property)
 {
     property.boolValues.GetArrayElementAtIndex(ObjectSetActives.BoolIndex).boolValue =
         EditorGUILayout.Toggle(SkinContent.IsActive, property.boolValues.GetArrayElementAtIndex(ObjectSetActives.BoolIndex).boolValue);
 }
예제 #18
0
 /// <summary>
 /// <see cref="EditorSkinPartsPropertry">を<see cref="SkinPartsPropertry"/>にマップする
 /// </summary>
 /// <param name="mapTarget">マップ対象となるオブジェクト</param>
 /// <param name="mapSource">マップ元となるオブジェクト</param>
 public static void MapRuntimePropertyFromEditorProperty(SkinPartsPropertry mapTarget, EditorSkinPartsPropertry mapSource)
 {
     mapTarget.Clear();
     MapRuntimeFromEditorSingleProperty(mapTarget.objectReferenceValues, mapSource.objectReferenceValues, (p) => p.objectReferenceValue);
     MapRuntimeFromEditorSingleProperty(mapTarget.boolValues, mapSource.boolValues, (p) => p.boolValue);
     MapRuntimeFromEditorSingleProperty(mapTarget.colorValues, mapSource.colorValues, (p) => p.colorValue);
     MapRuntimeFromEditorSingleProperty(mapTarget.floatValues, mapSource.floatValues, (p) => p.floatValue);
     MapRuntimeFromEditorSingleProperty(mapTarget.intValues, mapSource.intValues, (p) => p.intValue);
     MapRuntimeFromEditorSingleProperty(mapTarget.vector4Values, mapSource.vector4Values, (p) => p.vector4Value);
     MapRuntimeFromEditorSingleProperty(mapTarget.stringValues, mapSource.stringValues, (p) => p.stringValue);
 }