Beispiel #1
0
        private void DrawPlayerDamage(ICECreatureControl _control, ICECreaturePlayerDamageObject _damage)
        {
            EditorGUI.indentLevel++;
            _damage.Damage = ICEEditorLayout.Slider("Damage", "", _damage.Damage, 0.05f, 0, 100);
            //_damage.Type =  (DamageType)ICEEditorLayout.EnumPopup( "Damage Type", "", _damage.Type );
            EditorGUILayout.Separator();
            _damage.DamageBehaviourModeKey = BehaviourEditor.BehaviourSelect(_control, "Trigger Behaviour", "", _damage.DamageBehaviourModeKey, "ATTACK");

            _damage.Range = ICEEditorLayout.MaxDefaultSlider("Trigger Range", "", _damage.Range, 0.05f, 0, ref _damage.RangeMax, 2, "");
            ICEEditorLayout.MinMaxGroup("Trigger Interval", "", ref _damage.IntervalMin, ref _damage.IntervalMax, 0, 60, 0.05f, "");
            ICEEditorLayout.MinMaxGroup("Trigger Interruption Interval", "", ref _damage.InterruptionIntervalMin, ref _damage.InterruptionIntervalMax, 0, 60, 0.05f, "");
            ICEEditorLayout.MinMaxGroup("Trigger Limiter", "", ref _damage.LimitMin, ref _damage.LimitMax, 0, 60, 1, "");
            _damage.Force         = ICEEditorLayout.DefaultSlider("Force", "", _damage.Force, 0.25f, 0, 100, 20.0f, "");
            _damage.MuzzleFlash   = (Renderer)EditorGUILayout.ObjectField("Muzzle Flash", _damage.MuzzleFlash, typeof(Renderer), true);
            _damage.Sound         = (AudioClip)EditorGUILayout.ObjectField("Fire Sound", _damage.Sound, typeof(AudioClip), false);
            _damage.FxRandonPitch = ICEEditorLayout.DefaultSlider("Fire Fx Randon Pitch", "", _damage.FxRandonPitch, 0.001f, -1, 1, 0.86f, "");
            EditorGUI.indentLevel--;
        }
        //********************************************************************************
        // OnInspectorGUI
        //********************************************************************************
        public override void OnInspectorGUI()
        {
            Info.Reset(m_creature_control);

            if (m_creature_debug != null)
            {
                m_creature_control.Display.ShowDebug = m_creature_debug.enabled;
            }
            else
            {
                m_creature_control.Display.ShowDebug = false;
            }

            GUI.changed = false;

            EditorGUILayout.Separator();

            // COCKPIT
            DisplayEditor.Print(m_creature_control);
            InfoEditor.Print(m_creature_control);

            // WIZARD
            //EditorWizard.Print( m_creature_control );

            // ESSENTIALS
            EssentialsEditor.Print(m_creature_control);

            // STATUS
            StatusEditor.Print(m_creature_control);

            // MISSIONS
            MissionsEditor.Print(m_creature_control);

            // INTERACTION
            InteractionEditor.Print(m_creature_control);

            // ENVIRONMENT
            EnvironmentEditor.Print(m_creature_control);

            //BEHAVIOURS
            BehaviourEditor.Print(m_creature_control);

            EditorGUILayout.LabelField(" - ICECreatureControl v" + Info.Version + " - ", EditorStyles.centeredGreyMiniLabel);

            if (m_creature_control.Display.ShowDebug)
            {
                if (m_creature_debug == null)
                {
                    m_creature_debug = m_creature_control.gameObject.AddComponent <ICECreatureControlDebug>();
                }
                else if (m_creature_debug.enabled == false)
                {
                    m_creature_debug.enabled = true;
                }
            }
            else if (m_creature_debug != null)
            {
                m_creature_debug.enabled = false;

                /*
                 * DestroyImmediate( m_creature_control.GetComponent<ICECreatureControlDebug>() );
                 * EditorGUIUtility.ExitGUI();*/
            }

            MarkSceneDirty(m_creature_control);
        }