コード例 #1
0
        public override void OnInspectorGUI()
        {
            if (bPrefab)
            {
                base.DrawDefaultInspector();
                return;
            }

            serializedObject.Update();

            EditorGUILayout.Separator();

            if (_iExternSortingAdd.intValue != 0)
            {
                EditorGUILayout.LabelField("Extern Sorting Order : ", _iExternSortingAdd.intValue.ToString());
            }

            bool bCorruptedSortingOrder = _target.IsCorrupted_LastSortingOrder();

            using (new EditorGUI.DisabledGroupScope(bCorruptedSortingOrder))
            {
                if (!bCorruptedSortingOrder)
                {
                    var basis = _target.GetISOBasis();
                    Util.CustomEditorGUI.NewParagraph(string.Format("[SortingOrder {0}]", _target.CalcSortingOrder(true)));
                    if (basis != null)
                    {
                        EditorGUILayout.ObjectField("Modified by", basis, typeof(ISOBasis), allowSceneObjects: true);
                    }
                    EditorGUI.indentLevel = 0;
                }
                else
                {
                    EditorGUILayout.LabelField("Sorting Order was Corrupted or Disabled");
                }
            }

            EditorGUI.BeginChangeCheck();

            using (new EditorGUI.DisabledGroupScope(IsoMap.IsNull || !IsoMap.instance.bUseIsometricSorting))
            {
                EditorGUILayout.PropertyField(_iParticleSortingAdd, new GUIContent("iAdd for ParticleSorting : "));
            }

            bool bUpdated = EditorGUI.EndChangeCheck();

            serializedObject.ApplyModifiedProperties();

            if (bUpdated)
            {
                _target.Update_SortingOrder(true);
            }
        }