CreateClient() public static method

public static CreateClient ( string appName, string name ) : SyphonClientObject,
appName string
name string
return SyphonClientObject,
Ejemplo n.º 1
0
//i don't trust that this doesn't crash unity. need more testing.
//	public SyphonClientTexture(){
//		Syphon.syphonScriptCount++;
//	}
//	~SyphonClientTexture(){
//		Syphon.syphonScriptCount--;
//	}
#endif

    void setupTexture()
    {
        //when you initialize the client texture, you should TRY to create the syphon client object.
        //if it needs to exist because the server is available, it will create it. if the server is offline,
        //nothing will happen. this basically initializes a singleton for that particular server appName/name.
        clientObject = Syphon.CreateClient(clientAppName, clientName);
//		if the client object exists
        if (clientObject != null)
        {
            //only registers it if it doesn't already exist.
            Syphon.RegisterClientInstance(this, clientObject);
        }
    }
Ejemplo n.º 2
0
    public void drawGUIServerEditor()
    {
        foreach (KeyValuePair <string, string[]> kvp in SyphonTarget.serverAppNames)
        {
            GUI.changed = false;
            int selectIndex = 0;
            if (kvp.Key != serverConfirmKey)
            {
                selectIndex = 0;
            }
            else
            {
                selectIndex = GUIServerSelectionIndex;
            }
            selectIndex = EditorGUILayout.Popup(kvp.Key, selectIndex, kvp.Value);
            if (GUI.changed)
            {
                //Debug.Log("Selected: " + kvp.Key + " : " +  kvp.Value[GUIServerSelectionIndex] + "!");
                GUIServerSelectionIndex = selectIndex;
                showServerConfirmState  = true;
                serverConfirmKey        = kvp.Key;
                serverConfirmValue      = kvp.Value[selectIndex];
            }
        }

        if (showServerConfirmState && SyphonTarget.servers.ContainsKey(serverConfirmKey) && SyphonTarget.servers[serverConfirmKey].ContainsKey(serverConfirmValue))
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("ADD CLIENT:\nAPP: " + serverConfirmKey + "\nNAME: " + serverConfirmValue);
            if (GUILayout.Button("YES"))
            {
                Syphon.CreateClient(serverConfirmKey, serverConfirmValue);
                showServerConfirmState = false;
            }
            else if (GUILayout.Button("NO"))
            {
                showServerConfirmState = false;
            }

            GUILayout.EndHorizontal();
        }
    }