예제 #1
0
        void MovimentDrawPlatform()
        {
            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(Language.platformSpritLookingLeft(_simpleAI.gameConfig.selectedLanguage) + " \n <--"))
            {
                _simpleAI.facingRight = false;
            }

            iconMonster = Resources.Load("Icons/" + ((_simpleAI.facingRight) ? "monster" : "monsterLeft")) as Texture2D;
            if (iconMonster)
            {
                Rect r;
                r = GUILayoutUtility.GetRect(iconMonster.width, iconMonster.height);
                EditorGUI.DrawTextureTransparent(r, iconMonster);
            }

            if (GUILayout.Button(Language.platformSpritLookingRight(_simpleAI.gameConfig.selectedLanguage) + " \n -->"))
            {
                _simpleAI.facingRight = true;
            }

            EditorGUILayout.EndHorizontal();


            EditorTools.DrawDivision();


            _simpleAI.monsterType = (AIBase.MonsterType)EditorGUILayout.EnumMaskField(new GUIContent(Language.movimentTypes(_simpleAI.gameConfig.selectedLanguage), iconMoviment, "which kind of movement or movements your AI can perform."), _simpleAI.monsterType);

            _simpleAI.movimentSpeed = EditorGUILayout.Slider(new GUIContent(Language.movimentSpeed(_simpleAI.gameConfig.selectedLanguage), iconSpeed, "How fast your monster is going to move."), _simpleAI.movimentSpeed, 0.01f, 100);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(new GUIContent(Language.isGrounded(_simpleAI.gameConfig.selectedLanguage), iconLanding));

            GUIStyle ButtonColor = EditorTools.BorderLassButton();

            string btnTxt;

            if (_simpleAI.isGrounded)
            {
                btnTxt = "YES";
                ButtonColor.normal.textColor = Color.blue;
            }
            else
            {
                btnTxt = "NO";
                ButtonColor.normal.textColor = Color.red;
            }

            GUILayout.Button(btnTxt, ButtonColor);
            EditorGUILayout.EndHorizontal();
        }
예제 #2
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();
        }