示例#1
0
    void DrawSpawModeUI(SpawnPoint _point)
    {
        Layout.Horizontal(true);
        Layout.Space();
        Layout.HelpBoxInfo("Add or Remove modes");
        Layout.Vertical(true);
        ETUButton.Button("+", _point.AddMode, Color.yellow);
        ETUButton.ButtonConfirmation("Clear all modes", _point.RemoveAll, "Remove all", "Remove all modes ?", "Yes", "No", _point.AllSpawnMode.Count > 0);
        Layout.Vertical(false);

        Layout.Horizontal(false);


        for (int i = 0; i < _point.AllSpawnMode.Count; i++)
        {
            SpawnMode _mode = _point.AllSpawnMode[i];
            Layout.Space();

            Layout.Horizontal(true);

            _mode.Type = (SpawnType)Layout.EnumPop("Mode Type", _mode.Type);

            //_mode.Type = (SpawnType)EditorGUILayout.EnumPopup("Mode Type", _mode.Type);
            ETUButton.ButtonConfirmation("-", _point.RemoveMode, "Remove mode", $"Remove point {i + 1} ?", "Yes", "No", i);
            Layout.Horizontal(false);
            DrawModeSettings(_mode);

            Layout.Space();
        }
    }
示例#2
0
    void DrawAgentUi(SpawnPoint _point)
    {
        _point.IsMonoAgent = EditorGUILayout.Toggle("Unique Agent ?", _point.IsMonoAgent);

        if (_point.IsMonoAgent)
        {
            Layout.Horizontal(true);

            _point.MonoAgent = (GameObject)Layout.ObjectField(_point.MonoAgent, typeof(GameObject), false);

            EdiTool.ETUButton.ButtonConfirmation("Delete Agent", _point.RemoveAgent, "Remove agent ?", "Delete ?", "Yes", "No");

            Layout.Horizontal(false);
        }
        else
        {
            ETUButton.Button("Add agent", _point.AddAgent, Color.cyan);

            EdiTool.ETUButton.ButtonConfirmation("Delete all", _point.RemoveAllAgent, "Remove all ?", "Delete all Agent ?", "Yes", "No", _point.Agents.Count > 0);

            for (int j = 0; j < _point.Agents.Count; j++)
            {
                Layout.Horizontal(true);

                _point.Agents[j] = (GameObject)Layout.ObjectField(_point.Agents[j], typeof(GameObject), false);

                ETUButton.ButtonConfirmation("-", _point.RemoveAgent, "Remove agent", $"Remove agent {j + 1} ?", "Yes", "No", j);

                Layout.Horizontal(false);
            }
        }
    }
示例#3
0
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        eTarget.CurveColor = EditorGUILayout.ColorField(eTarget.CurveColor);

        Layout.HelpBoxInfo($"Curve Tool v {version}");

        eTarget.curveDefinition = Layout.ETUSlider("Precision", ref eTarget.curveDefinition, 1, 1000);

        if (GUI.changed)
        {
            eTarget.SetCurve();
            SceneView.RepaintAll();
        }

        ETUButton.Button("Add", eTarget.Add, Color.green);
    }