コード例 #1
0
        //private vp_DamageInfo.DamageType _damage_type;
        public override void OnInspectorGUI()
        {
            ICECreatureTPCAdapter _adapter = (ICECreatureTPCAdapter)target;
            ICECreatureControl    _control = _adapter.GetComponent <ICECreatureControl>();

            EditorGUILayout.Separator();
            _adapter.UseCreatureDamage = ICEEditorLayout.ToggleLeft("Creature Damage", "", _adapter.UseCreatureDamage, true);
            if (_adapter.UseCreatureDamage)
            {
                EditorGUI.indentLevel++;
                _adapter.UseAdvanced = ICEEditorLayout.ToggleLeft("Use Advanced", "", _adapter.UseAdvanced, true);
                if (_adapter.UseAdvanced)
                {
                    CreatureObjectEditor.DrawInfluenceDataObject(_adapter.Influences, EditorHeaderType.FOLDOUT_ENABLED_BOLD, _control.Creature.Status.UseAdvanced);
                }
                EditorGUI.indentLevel--;
                EditorGUILayout.Separator();
            }

            _adapter.UsePlayerDamage = ICEEditorLayout.ToggleLeft("Player Damage", "", _adapter.UsePlayerDamage, true);
            if (_adapter.UsePlayerDamage)
            {
                EditorGUI.indentLevel++;

                _adapter.UseMultiplePlayerDamageHandler = ICEEditorLayout.Toggle("Use Multiple Damage Handler", "", _adapter.UseMultiplePlayerDamageHandler, "");
                if (_adapter.UseMultiplePlayerDamageHandler)
                {
                    foreach (ICECreaturePlayerDamageObject _damage in _adapter.PlayerDamages)
                    {
                        ICEEditorLayout.BeginHorizontal();
                        ICEEditorLayout.Label(_damage.DamageBehaviourModeKey, true);
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button(new GUIContent("X", "Delete"), ICEEditorStyle.CMDButton))
                        {
                            _adapter.PlayerDamages.Remove(_damage);
                            return;
                        }
                        ICEEditorLayout.EndHorizontal();

                        DrawPlayerDamage(_control, _damage);
                    }

                    ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1);
                    ICEEditorLayout.BeginHorizontal();
                    _damage_behaviour = Popups.BehaviourPopup(_control, _damage_behaviour);

                    EditorGUI.BeginDisabledGroup(_damage_behaviour.Trim() == "");
                    if (GUILayout.Button(new GUIContent("ADD", "Adds a new damage handler"), ICEEditorStyle.CMDButtonDouble))
                    {
                        _adapter.AddPlayerDamage(_damage_behaviour);
                    }
                    EditorGUI.EndDisabledGroup();
                    ICEEditorLayout.EndHorizontal();
                }
                else
                {
                    DrawPlayerDamage(_control, _adapter.SimpleDamage);
                }

                EditorGUI.indentLevel--;
            }

            EditorGUI.indentLevel++;
            EditorGUILayout.Separator();
        }