コード例 #1
0
        private void ActionWindowFunction(int id)
        {
            CatGraph.ActionWrapper wrapper = _catGraph.GetActionWrapper(id);
            if (wrapper == null)
            {
                return;
            }
            float height   = 15;
            float distance = height + 2f;
            float width    = 100;

            if (GUI.Button(new Rect(10, 10, width - 20, height), "Remove"))
            {
                Undo.RecordObject(_catGraph, "Remove Action");
                _catGraph.RemoveAction(wrapper);
            }
            GUI.Label(new Rect(10, 100 / 2 - distance, width, height), "Action");
            wrapper.SetAction((Action)EditorGUI.ObjectField(new Rect(5, 100 / 2, width - 10, height), wrapper.Action, typeof(Action), false));
        }