Exemple #1
0
        void showAIArea()
        {
            EditorGUILayout.BeginVertical("Box");

            EditorGUILayout.BeginVertical("Box");

            EditorGUILayout.Space();

            //TODO: Tradução
            _simpleAI.target   = (GameObject)EditorGUILayout.ObjectField("Target", _simpleAI.target, typeof(GameObject), true);
            _simpleAI.cooldown = EditorGUILayout.Slider(new GUIContent("Cooldown", "Cooldown between behaviours."), _simpleAI.cooldown, 0.1f, 10);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Actual behaviour");

            GUIStyle behaviourName = EditorTools.BorderLassButton();

            behaviourName.fontSize = 12;

            if (_simpleAI.actualAction > -1)
            {
                behaviourName.normal.textColor = _simpleAI.ai.actions[_simpleAI.actualAction].color;
                GUILayout.Button(_simpleAI.ai.actions[_simpleAI.actualAction].name, behaviourName);
            }
            else if (_simpleAI.actualAction == -1)
            {
                behaviourName.normal.textColor = Color.black;
                GUILayout.Button("------", behaviourName);
            }
            else
            {
                //TODO: Tradurção
                behaviourName.normal.textColor = Color.red;
                GUILayout.Button("Cooldown", behaviourName);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            _simpleAI.fixedTarget         = EditorGUILayout.ToggleLeft(new GUIContent("Fixed tagert", "Once it have a target AI. will keep it never changing until it lost the current one."), _simpleAI.fixedTarget);
            _simpleAI.loseTargetCondition = (AIBase.LoseTargetConditions)EditorGUILayout.EnumPopup(new GUIContent("Lose target", "Condition that makes this AI lose a target."), _simpleAI.loseTargetCondition);

            if (_simpleAI.loseTargetCondition == AIBase.LoseTargetConditions.both || _simpleAI.loseTargetCondition == AIBase.LoseTargetConditions.maxSight)
            {
                //TODO: Tradução
                EditorGUILayout.LabelField(new GUIContent("Sight"), EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                float sightRadiusHelper = EditorGUILayout.FloatField("Sight radius", _simpleAI.loseTargetSight);
                if (sightRadiusHelper >= 0)
                {
                    _simpleAI.loseTargetSight = sightRadiusHelper;
                }
                EditorGUILayout.EndVertical();
            }

            if (_simpleAI.loseTargetCondition == AIBase.LoseTargetConditions.both || _simpleAI.loseTargetCondition == AIBase.LoseTargetConditions.distanceToSpawnArea)
            {
                //TODO: Tradução
                EditorGUILayout.LabelField(new GUIContent("Spawn"), EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                float distanceHelper = EditorGUILayout.FloatField("Max. Distance from spwan", _simpleAI.maxDistanceFromSpawn);
                if (distanceHelper >= 0)
                {
                    _simpleAI.maxDistanceFromSpawn = distanceHelper;
                }
                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();
        }