public override void OnInspectorGUI() { MagicaAvatar scr = target as MagicaAvatar; // データ状態 EditorInspectorUtility.DispVersionStatus(scr); EditorInspectorUtility.DispDataStatus(scr); serializedObject.Update(); //Undo.RecordObject(scr, "CreateBoneCloth"); // メイン MainInspector(); // モニターボタン //EditorInspectorUtility.MonitorButtonInspector(); //DrawDefaultInspector(); // パーツリスト if (EditorApplication.isPlaying) { if (DrawPartsList()) { serializedObject.ApplyModifiedProperties(); } } // イベント Events(); serializedObject.ApplyModifiedProperties(); }
void DrawVirtualDeformerInspector() { MagicaVirtualDeformer scr = target as MagicaVirtualDeformer; serializedObject.Update(); //EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.renderDeformerList"), true); EditorInspectorUtility.DrawObjectList <MagicaRenderDeformer>( serializedObject.FindProperty("deformer.renderDeformerList"), scr.gameObject, true, true ); EditorGUILayout.Space(); EditorGUILayout.LabelField("Reduction Setting", EditorStyles.boldLabel); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.mergeVertexDistance")); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.mergeTriangleDistance")); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.sameSurfaceAngle")); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.useSkinning")); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.maxWeightCount")); EditorGUILayout.PropertyField(serializedObject.FindProperty("deformer.weightPow")); serializedObject.ApplyModifiedProperties(); }
//========================================================================================= void MainInspector() { MagicaBoneCloth scr = target as MagicaBoneCloth; EditorGUILayout.LabelField("Main Setup", EditorStyles.boldLabel); // ルートリスト EditorInspectorUtility.DrawObjectList <Transform>( serializedObject.FindProperty("clothTarget.rootList"), scr.gameObject, false, true ); //EditorGUILayout.Space(); // ブレンド率 UserBlendInspector(); // アニメーション連動 //scr.ClothTarget.IsAnimationBone = EditorGUILayout.Toggle("Is Animation Bones", scr.ClothTarget.IsAnimationBone); //scr.ClothTarget.IsAnimationPosition = EditorGUILayout.Toggle("Is Animation Position", scr.ClothTarget.IsAnimationPosition); //scr.ClothTarget.IsAnimationRotation = EditorGUILayout.Toggle("Is Animation Rotation", scr.ClothTarget.IsAnimationRotation); // ポイント選択 DrawInspectorGUI(scr); EditorGUILayout.Space(); }
//========================================================================================= void MainInspector() { MagicaBoneCloth scr = target as MagicaBoneCloth; EditorGUILayout.LabelField("Main Setup", EditorStyles.boldLabel); // ルートリスト EditorInspectorUtility.DrawObjectList <Transform>( serializedObject.FindProperty("clothTarget.rootList"), scr.gameObject, false, true ); //EditorGUILayout.Space(); // 接続モード EditorGUILayout.PropertyField(serializedObject.FindProperty("clothTarget.connection"), new GUIContent("Connection Mode")); if (scr.ClothTarget.Connection == BoneClothTarget.ConnectionMode.Mesh) { EditorGUILayout.PropertyField(serializedObject.FindProperty("clothTarget.sameSurfaceAngle"), new GUIContent("Same Surface Angle")); } // ブレンド率 UserBlendInspector(); // アニメーション連動 //scr.ClothTarget.IsAnimationBone = EditorGUILayout.Toggle("Is Animation Bones", scr.ClothTarget.IsAnimationBone); //scr.ClothTarget.IsAnimationPosition = EditorGUILayout.Toggle("Is Animation Position", scr.ClothTarget.IsAnimationPosition); //scr.ClothTarget.IsAnimationRotation = EditorGUILayout.Toggle("Is Animation Rotation", scr.ClothTarget.IsAnimationRotation); // ポイント選択 DrawInspectorGUI(scr); EditorGUILayout.Space(); }
public override void OnInspectorGUI() { MagicaAvatarParts scr = target as MagicaAvatarParts; // データ状態 //EditorInspectorUtility.DispVersionStatus(scr); EditorInspectorUtility.DispDataStatus(scr); //DrawDefaultInspector(); }
void ColliderInspector() { MagicaMeshCloth scr = target as MagicaMeshCloth; EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Collider List", EditorStyles.boldLabel); EditorInspectorUtility.DrawObjectList <ColliderComponent>( serializedObject.FindProperty("teamData.colliderList"), scr.gameObject, true, true ); }
/// <summary> /// コライダー設定インスペクタ /// </summary> protected void ColliderInspector() { PhysicsTeam scr = target as PhysicsTeam; EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Collider", EditorStyles.boldLabel); EditorGUILayout.PropertyField(serializedObject.FindProperty("teamData.mergeAvatarCollider")); EditorInspectorUtility.DrawObjectList <ColliderComponent>( serializedObject.FindProperty("teamData.colliderList"), scr.gameObject, true, true ); }
public override void OnInspectorGUI() { MagicaVirtualDeformer scr = target as MagicaVirtualDeformer; //DrawDefaultInspector(); serializedObject.Update(); // データ検証 if (EditorApplication.isPlaying == false) { VerifyData(); } // データ状態 EditorInspectorUtility.DispVersionStatus(scr); EditorInspectorUtility.DispDataStatus(scr); Undo.RecordObject(scr, "CreateVirtualDeformer"); // モニターボタン EditorInspectorUtility.MonitorButtonInspector(); DrawVirtualDeformerInspector(); // データ作成 if (EditorApplication.isPlaying == false) { EditorGUILayout.Space(); GUI.backgroundColor = Color.red; if (GUILayout.Button("Create")) { Undo.RecordObject(scr, "CreateVirtualMeshData"); CreateData(scr); } GUI.backgroundColor = Color.white; serializedObject.ApplyModifiedProperties(); } }
public override void OnInspectorGUI() { MagicaMeshCloth scr = target as MagicaMeshCloth; // データ状態 EditorInspectorUtility.DispVersionStatus(scr); EditorInspectorUtility.DispDataStatus(scr); serializedObject.Update(); // データ検証 if (EditorApplication.isPlaying == false) { VerifyData(); } // モニターボタン EditorInspectorUtility.MonitorButtonInspector(); // メイン MainInspector(); // コライダー ColliderInspector(); // パラメータ EditorGUILayout.Space(); EditorGUILayout.Space(); EditorPresetUtility.DrawPresetButton(scr, scr.Params); { var cparam = serializedObject.FindProperty("clothParams"); if (EditorInspectorUtility.RadiusInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Radius); } if (EditorInspectorUtility.MassInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Mass); } if (EditorInspectorUtility.GravityInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Gravity); } if (EditorInspectorUtility.ExternalForceInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.ExternalForce); } if (EditorInspectorUtility.DragInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Drag); } if (EditorInspectorUtility.MaxVelocityInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.MaxVelocity); } if (EditorInspectorUtility.WorldInfluenceInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.WorldInfluence); } if (EditorInspectorUtility.DistanceDisableInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.DistanceDisable); } if (EditorInspectorUtility.ClampDistanceInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.ClampDistance); } if (EditorInspectorUtility.ClampPositionInspector(cparam, false)) { scr.Params.SetChangeParam(ClothParams.ParamType.ClampPosition); } if (EditorInspectorUtility.ClampRotationInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.ClampRotation); } if (EditorInspectorUtility.RestoreDistanceInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.RestoreDistance); } if (EditorInspectorUtility.RestoreRotationInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.RestoreRotation); } if (EditorInspectorUtility.TriangleBendInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.TriangleBend); } //if (EditorInspectorUtility.VolumeInspector(cparam)) // scr.Params.SetChangeParam(ClothParams.ParamType.Volume); if (EditorInspectorUtility.CollisionInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.ColliderCollision); } if (EditorInspectorUtility.PenetrationInspector(serializedObject, cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Penetration); } //if (EditorInspectorUtility.BaseSkinningInspector(serializedObject, cparam)) // scr.Params.SetChangeParam(ClothParams.ParamType.BaseSkinning); if (EditorInspectorUtility.RotationInterpolationInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.RotationInterpolation); } } serializedObject.ApplyModifiedProperties(); // データ作成 if (EditorApplication.isPlaying == false) { EditorGUI.BeginDisabledGroup(CheckCreate() == false); EditorGUILayout.Space(); EditorGUILayout.Space(); GUI.backgroundColor = Color.red; if (GUILayout.Button("Create")) { Undo.RecordObject(scr, "CreateMeshCloth"); CreateData(); } GUI.backgroundColor = Color.white; EditorGUI.EndDisabledGroup(); } else { EditorGUILayout.Space(); EditorGUILayout.Space(); GUI.backgroundColor = Color.blue; if (GUILayout.Button("Reset Position")) { scr.ResetCloth(); } GUI.backgroundColor = Color.white; } EditorGUILayout.Space(); }
void DebugOption() { EditorGUI.BeginChangeCheck(); EditorInspectorUtility.Foldout("Cloth Team Gizmos", "Cloth Team Gizmos", () => { EditorGUI.BeginDisabledGroup(!drawCloth); using (new EditorGUI.IndentLevelScope()) { alwaysClothShow = EditorGUILayout.Toggle("Always Show", alwaysClothShow); drawClothVertex = EditorGUILayout.Toggle("Particle Position", drawClothVertex); drawClothRadius = EditorGUILayout.Toggle("Particle Radius", drawClothRadius); drawClothDepth = EditorGUILayout.Toggle("Particle Depth", drawClothDepth); drawClothBase = EditorGUILayout.Toggle("Particle Base", drawClothBase); drawClothAxis = EditorGUILayout.Toggle("Particle Axis", drawClothAxis); drawClothCollider = EditorGUILayout.Toggle("Collider", drawClothCollider); drawClothStructDistanceLine = EditorGUILayout.Toggle("Struct Distance Line", drawClothStructDistanceLine); drawClothBendDistanceLine = EditorGUILayout.Toggle("Bend Distance Line", drawClothBendDistanceLine); drawClothNearDistanceLine = EditorGUILayout.Toggle("Near Distance Line", drawClothNearDistanceLine); drawClothRotationLine = EditorGUILayout.Toggle("Rotation Line", drawClothRotationLine); drawClothTriangleBend = EditorGUILayout.Toggle("Triangle Bend", drawClothTriangleBend); drawClothPenetration = EditorGUILayout.Toggle("Penetration", drawClothPenetration); //drawClothBaseSkinning = EditorGUILayout.Toggle("Base Skinning", drawClothBaseSkinning); #if MAGICACLOTH_DEBUG drawClothVertexNumber = EditorGUILayout.Toggle("[D] Particle Number", drawClothVertexNumber); drawClothVertexIndex = EditorGUILayout.Toggle("[D] Particle Index", drawClothVertexIndex); drawClothFriction = EditorGUILayout.Toggle("[D] Particle Friction", drawClothFriction); drawClothDepthNumber = EditorGUILayout.Toggle("[D] Particle Depth", drawClothDepthNumber); //drawClothVolume = EditorGUILayout.Toggle("Volume", drawClothVolume); //drawAdjustRotationLine = EditorGUILayout.Toggle("Adjust Rotation Line", drawAdjustRotationLine); #endif } EditorGUI.EndDisabledGroup(); }, (sw) => { drawCloth = sw; }, drawCloth ); EditorInspectorUtility.Foldout("Deformer Gizmos", "Deformer Gizmos", () => { EditorGUI.BeginDisabledGroup(!drawDeformer); using (new EditorGUI.IndentLevelScope()) { alwaysDeformerShow = EditorGUILayout.Toggle("Always Show", alwaysDeformerShow); drawDeformerVertexPosition = EditorGUILayout.Toggle("Vertex Position", drawDeformerVertexPosition); drawDeformerVertexAxis = EditorGUILayout.Toggle("Vertex Axis", drawDeformerVertexAxis); drawDeformerLine = EditorGUILayout.Toggle("Line", drawDeformerLine); drawDeformerTriangle = EditorGUILayout.Toggle("Triangle", drawDeformerTriangle); #if MAGICACLOTH_DEBUG drawDeformerVertexNumber = EditorGUILayout.Toggle("[D] Vertex Number", drawDeformerVertexNumber); debugDrawDeformerVertexNumber = EditorGUILayout.IntField("[D] Vertex Number", debugDrawDeformerVertexNumber); drawDeformerTriangleNormal = EditorGUILayout.Toggle("[D] Triangle Normal", drawDeformerTriangleNormal); drawDeformerTriangleNumber = EditorGUILayout.Toggle("[D] Triangle Number", drawDeformerTriangleNumber); debugDrawDeformerTriangleNumber = EditorGUILayout.IntField("[D] Triangle Number", debugDrawDeformerTriangleNumber); #endif } EditorGUI.EndDisabledGroup(); }, (sw) => { drawDeformer = sw; }, drawDeformer ); EditorInspectorUtility.Foldout("Wind Gizmos", "Wind Gizmos", () => { EditorGUI.BeginDisabledGroup(!drawWind); using (new EditorGUI.IndentLevelScope()) { alwaysWindShow = EditorGUILayout.Toggle("Always Show", alwaysWindShow); } EditorGUI.EndDisabledGroup(); }, (sw) => { drawWind = sw; }, drawWind ); if (EditorGUI.EndChangeCheck()) { // Sceneビュー更新 SceneView.RepaintAll(); } }
public override void OnInspectorGUI() { MagicaMeshSpring scr = target as MagicaMeshSpring; // データ状態 EditorInspectorUtility.DispVersionStatus(scr); EditorInspectorUtility.DispDataStatus(scr); serializedObject.Update(); Undo.RecordObject(scr, "CreateMeshSpring"); // データ検証 if (EditorApplication.isPlaying == false) { VerifyData(); } // モニターボタン EditorInspectorUtility.MonitorButtonInspector(); EditorGUI.BeginChangeCheck(); // メイン MainInspector(); // パラメータ EditorGUILayout.Space(); EditorGUILayout.Space(); EditorPresetUtility.DrawPresetButton(scr, scr.Params); { var cparam = serializedObject.FindProperty("clothParams"); if (EditorInspectorUtility.GravityInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Gravity); } if (EditorInspectorUtility.ExternalForceInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.ExternalForce); } if (EditorInspectorUtility.DragInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.Drag); } if (EditorInspectorUtility.MaxVelocityInspector(cparam)) { scr.Params.SetChangeParam(ClothParams.ParamType.MaxVelocity); } if (EditorInspectorUtility.WorldInfluenceInspector(cparam, scr.HasChangedParam(ClothParams.ParamType.WorldInfluence))) { scr.Params.SetChangeParam(ClothParams.ParamType.WorldInfluence); } if (EditorInspectorUtility.DistanceDisableInspector(cparam, scr.HasChangedParam(ClothParams.ParamType.DistanceDisable))) { scr.Params.SetChangeParam(ClothParams.ParamType.DistanceDisable); } if (EditorInspectorUtility.ClampPositionInspector(cparam, true, scr.HasChangedParam(ClothParams.ParamType.ClampPosition))) { scr.Params.SetChangeParam(ClothParams.ParamType.ClampPosition); } if (EditorInspectorUtility.FullSpringInspector(cparam, scr.HasChangedParam(ClothParams.ParamType.Spring))) { scr.Params.SetChangeParam(ClothParams.ParamType.Spring); } if (EditorInspectorUtility.AdjustRotationInspector(cparam, scr.HasChangedParam(ClothParams.ParamType.AdjustRotation))) { scr.Params.SetChangeParam(ClothParams.ParamType.AdjustRotation); } } serializedObject.ApplyModifiedProperties(); // データ作成 if (EditorApplication.isPlaying == false) { EditorGUI.BeginDisabledGroup(CheckCreate() == false); EditorGUILayout.Space(); EditorGUILayout.Space(); GUI.backgroundColor = Color.red; if (GUILayout.Button("Create")) { Undo.RecordObject(scr, "CreateMeshSpringData"); CreateData(); } GUI.backgroundColor = Color.white; EditorGUI.EndDisabledGroup(); } else { EditorGUILayout.Space(); EditorGUILayout.Space(); GUI.backgroundColor = Color.blue; if (GUILayout.Button("Reset Position")) { scr.ResetCloth(); } GUI.backgroundColor = Color.white; } EditorGUILayout.Space(); if (EditorGUI.EndChangeCheck()) { // Sceneビュー更新 SceneView.RepaintAll(); } }