Beispiel #1
0
    void DrawnAgentUI(SM_SpawnPoint _point)
    {
        EditoolsField.Toggle("Unique Agent? ", ref _point.IsMonoAgent);
        EditoolsLayout.Space(5);

        if (_point.IsMonoAgent)
        {
            EditoolsLayout.Horizontal(true);
            _point.MonoAgent = (GameObject)EditoolsField.ObjectField(_point.MonoAgent, typeof(GameObject), false);
            EditoolsButton.ButtonWithConfirm("X", Color.red, _point.RemoveAgent, "Remove Agent", "Remove Agent?");
            EditoolsLayout.Horizontal(false);
        }
        else
        {
            EditoolsLayout.Horizontal(true);
            EditoolsBox.HelpBoxInfo($"Add agent to spawn");
            EditoolsLayout.Vertical(true);
            EditoolsButton.Button("Add Agent", Color.cyan, _point.AddAgent);
            EditoolsButton.ButtonWithConfirm("Clear", Color.red, _point.ClearAgents, "Clear Agents", "Clear All Agents ?",
                                             _showCondition: _point.Agents.Count > 0);
            EditoolsLayout.Vertical(false);
            EditoolsLayout.Horizontal(false);

            for (int j = 0; j < _point.Agents.Count; j++)
            {
                EditoolsLayout.Horizontal(true);
                _point.Agents[j] = (GameObject)EditoolsField.ObjectField(_point.Agents[j], typeof(GameObject), false);
                EditoolsButton.ButtonWithConfirm("X", Color.red, _point.RemoveAgent, j, "Remove Agent ?",
                                                 "Remove This Agent ?");
                EditoolsLayout.Horizontal(false);
            }
        }
    }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            EditoolsLayout.Horizontal(true);
            EditoolsBox.HelpBoxInfo("Agents Settings");
            EditoolsLayout.Horizontal(false);

            EditoolsLayout.Space(2);

            EditoolsLayout.Horizontal(true);
            targetSettings.SpeedMove = EditoolsField.FloatField("Move Speed", targetSettings.SpeedMove);
            EditoolsLayout.Horizontal(false);

            EditoolsLayout.Horizontal(true);
            targetSettings.SpeedRotation = EditoolsField.FloatField("Rotation Speed", targetSettings.SpeedRotation);
            EditoolsLayout.Horizontal(false);


            EditoolsLayout.Horizontal(true);
            EditoolsField.Toggle("Add LookAt ?", ref targetSettings.UseLookAt);
            EditoolsLayout.Horizontal(false);
            EditoolsLayout.Horizontal(true);
            if (targetSettings.UseLookAt)
            {
                EditoolsBox.HelpBox("LookAt Target");
                targetSettings.TargetLookAt = (GameObject)EditoolsField.ObjectField(targetSettings.TargetLookAt, typeof(GameObject), true);
            }
            EditoolsLayout.Horizontal(false);


            EditorUtility.SetDirty(targetSettings); // flush value
        }
Beispiel #3
0
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();
        EditoolsBox.HelpBoxInfo($"SPAWN TOOL V{version}");
        eTarget.TriggerZonePrefab = (SM_SpawnTrigger)EditoolsField.ObjectField(eTarget.TriggerZonePrefab, typeof(SM_SpawnTrigger), false);
        if (!eTarget.TriggerZonePrefab)
        {
            return;
        }

        EditoolsLayout.Space(1);
        DrawnSpawnPointsUI();

        SceneView.RepaintAll();
    }
Beispiel #4
0
        void DrawnAgentUI()
        {
            if (!eTarget)
            {
                return;
            }

            EditoolsLayout.Horizontal(true);
            EditoolsBox.HelpBoxInfo("Agents Settings");
            EditoolsLayout.Vertical(true);
            EditoolsButton.ButtonWithConfirm("Remove all Agents", Color.red, eTarget.ClearAgents, "Clear All Agents ?",
                                             $"Clear All Agents", "Are your sure ?", _showCondition: eTarget.Agents.Count > 0);
            EditoolsButton.Button("Add Agent", Color.green, eTarget.AddAgent);
            EditoolsLayout.Vertical(false);
            EditoolsLayout.Horizontal(false);

            for (int i = 0; i < eTarget.Agents.Count; i++)
            {
                if (eTarget.Agents[i] == null)
                {
                    return;
                }
                UF_PathAgent _agent = eTarget.Agents[i];
                EditoolsLayout.Foldout(ref _agent.Show, $"{i + 1} / {eTarget.Agents.Count}");

                if (!_agent.Show)
                {
                    continue;
                }

                EditoolsLayout.Horizontal(true);
                EditoolsBox.HelpBox($"{i + 1} / {eTarget.Agents.Count}");
                EditoolsButton.ButtonWithConfirm("-", Color.red, eTarget.RemoveAgent, i, $"Remove Agent {i}",
                                                 "Are your sure ?");
                EditoolsLayout.Horizontal(false);

                // EditoolsField.IntSlider("Speed Move", ref _agent.SpeedMove, _agent.MinSpeedMove, _agent.MaxSpeedMove); // todo remove
                // EditoolsField.IntSlider("Speed Rotation", ref _agent.SpeedRotation, _agent.MinSpeedRotation _agent.MaxSpeedRotation); // todo remove

                EditoolsLayout.Horizontal(true);
                _agent.AgentToMove =
                    (GameObject)EditoolsField.ObjectField(_agent.AgentToMove, typeof(GameObject), true);
                // todo input for UF_PAthAgentSettings
                _agent.AgentSettings =
                    (UF_PathAgentSettings)EditoolsField.ObjectField(_agent.AgentSettings, typeof(UF_PathAgentSettings),
                                                                    false);
                EditoolsButton.Button("New Settings", Color.white, PathManagerMenu.UF_PathManagerMenu.CreateNewAgentProfile, !_agent.AgentSettings);
                EditoolsLayout.Horizontal(false);

                if (eTarget.Paths.Count > 0)
                {
                    string[] _pathsNames = eTarget.Paths.Select(o => o.Mode.Id).ToArray();
                    _agent.PathIndex = EditorGUILayout.Popup("Paths target", _agent.PathIndex, _pathsNames);
                    _agent.PathId    = _pathsNames[_agent.PathIndex];
                }
                else
                {
                    EditoolsBox.HelpBox("NO PATH FOUND !", MessageType.Error);
                }
            }
        }