public void Destroy()
 {
     this.comp_rectangle = new Rect();
     this.components     = null;
     this.owner          = null;
     clicked_index       = -1;
 }
Esempio n. 2
0
        private void CreateNodes()
        {
            if (root_action == null)
            {
                Debug.LogWarning("action is null");
                return;
            }

            _winMinX = 50f;
            _winMinY = 50f;

            NodeLevelCounter.Clear();
            rectangles.Clear();
            ActionEditorNode.ID = 0;

            if (root_action_node != null)
            {
                root_action_node.Clear();
            }

            root_action_node = ActionEditorNode.InstantiateNode(root_action);

            rectangles.Add(root_action_node.rectangle);

            root_action_node.AddChildren(ref rectangles);
            root_action_node.CountLevels(0);
            root_action_node.RepositionNodes(0);
            //NodeLevelCounter.DebugLevels();

            //_resizeHandle = AssetDatabase.LoadAssetAtPath("Assets/Sprites/NodeEditor/ResizeHandle.png", typeof(Texture2D)) as Texture2D;
            _aaLine = AssetDatabase.LoadAssetAtPath("Assets/Sprites/NodeEditor/AA1x5.png", typeof(Texture2D)) as Texture2D;
            //_icon = new GUIContent(_resizeHandle);
            //_mainwindowID = GUIUtility.GetControlID(FocusType.Native); //grab primary editor window controlID
        }
Esempio n. 3
0
        public static string TextField(ActionEditorNode act, string label, string obj)
        {
            string ret = EditorGUILayout.TextField(label, obj);

            //Debug.Log (ret + " " + obj););

            return(ret);
        }
Esempio n. 4
0
        public static WindowActionNode Init(ActionEditorNode target)
        {
            window_instance       = (WindowActionNode )EditorWindow.GetWindow(typeof(WindowActionNode));
            window_instance.title = "Action Inspector";

            window_instance.Target = target;

            return(window_instance);
            //window_instance.selected_action = window_instance.GetSelectedAction();
        }
Esempio n. 5
0
 //[MenuItem("CGM/Action Editor")]
 public static void Init(CGME.Action act)
 {
     window_instance = (WindowActionEditor )EditorWindow.GetWindow(typeof(WindowActionEditor));
     window_instance.wantsMouseMove = true;
     //window.title = GetWindowTitle();
     //window_instance.selected_action = window_instance.GetSelectedAction();
     window_instance.root_action = act;
     window_instance.name        = act.CGType;
     ActionEditorNode.SetStyles();
     ActionEditorPopupWindow.SetStyle();
     window_instance.CreateNodes();
 }
        public void Build(Rect parent_rect, string[] components, ActionEditorNode owner)
        {
            this.comp_rectangle = new Rect(parent_rect);

            comp_rectangle.width  = width;
            comp_rectangle.height = height;

            box_rect         = new Rect(comp_rectangle);
            box_rect.height *= components.Length;

            this.components = components;

            this.owner = owner;
        }
Esempio n. 7
0
        public void AddChild(CGME.Action child_action, ref List <Rect> rect_list)
        {
            //Debug.Log ("2");


            //Debug.Log ("3");
            //ActionEditorNode child_node = AddNewNode(child_action,parent_node,x,y);
            ActionEditorNode child_node = InstantiateNode(child_action);

            rect_list.Add(child_node.rectangle);

            children.Add(child_node);
            //Debug.Log ("4");
            child_node.AddChildren(ref rect_list);
        }
Esempio n. 8
0
        public static Enum EnumPopup(ActionEditorNode act, string label, Enum obj)
        {
            Enum ret = EditorGUILayout.EnumPopup(label, obj);

            return(ret);
        }
Esempio n. 9
0
        public static bool Toggle(ActionEditorNode act, string label, bool obj)
        {
            bool ret = EditorGUILayout.Toggle(label, obj);

            return(ret);
        }
Esempio n. 10
0
        public static int Popup(ActionEditorNode act, string label, int obj, string[] labels)
        {
            int ret = EditorGUILayout.Popup(label, obj, labels);

            return(ret);
        }
Esempio n. 11
0
        public static int IntField(ActionEditorNode act, string label, int obj)
        {
            int ret = EditorGUILayout.IntField(label, obj);

            return(ret);
        }