コード例 #1
0
    public override void OnBodyGUI()
    {
        OSCNode target = ((OSCNode)this.target);

        target.Connection = (OSC.Connection)EditorGUILayout.ObjectField("OSC object", target.Connection, typeof(OSC.Connection), true);
        if (target.Connection != null)
        {
            target.gameObject = target.Connection.gameObject;
        }
        target.Bind(target.gameObject, true);

        if (target.initialized)
        {
            target.Connection.RemoteIP     = EditorGUILayout.TextField("IP:", target.Connection.RemoteIP);
            target.Connection.ListenerPort = EditorGUILayout.IntField("local port:", target.Connection.ListenerPort);
            target.Connection.SendToPort   = EditorGUILayout.IntField("remote port:", target.Connection.SendToPort);
        }

        foreach (NodePort port in target.Outputs)
        {
            NodeEditorGUILayout.PortField(port);
        }

        /*
         * if (target.gameObject == null)
         * {
         *
         *  if (GUILayout.Button("Bind object"))
         *  {
         *      target.Bind(Selection.activeGameObject);
         *  };
         * }
         * else if (target.initialized)
         * {
         *  if (GUILayout.Button("Rebind"))
         *  {
         *      ((OSCNode)target).Bind(Selection.activeGameObject,true);
         *  };
         *
         * }*/
    }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            OSCNode go = ((OSCNode)target);

            EditorGUILayout.LabelField(go != null ? go.ToString() : "no obj");
        }