private void DrawFrequencyDomainClip() { float width = Screen.width / 2; float height = Screen.height / 3; EditorGraph.DrawGraph(m_fftApplied, new Rect(0, height * 2, width, height)); }
void Start() { if (HostName == "1.2.3.4") { Debug.LogError("Please set the mumble host name to your mumble server"); return; } Application.runInBackground = true; _mumbleClient = new MumbleClient(HostName, Port, CreateMumbleAudioPlayerFromPrefab, DestroyMumbleAudioPlayer, DebuggingVariables); if (DebuggingVariables.UseRandomUsername) { Username += UnityEngine.Random.Range(0, 100f); } _mumbleClient.Connect(Username, Password); if (MyMumbleMic != null) { _mumbleClient.AddMumbleMic(MyMumbleMic); } #if UNITY_EDITOR if (DebuggingVariables.EnableEditorIOGraph) { EditorGraph editorGraph = EditorWindow.GetWindow <EditorGraph>(); editorGraph.Show(); StartCoroutine(UpdateEditorGraph()); } #endif }
private void DrawWindowedClip() { float width = Screen.width / 2; float height = Screen.height / 3; EditorGraph.DrawGraph(m_windowedClip, new Rect(0, height, width, height)); }
private void DrawTimeDomainClip() { float width = Screen.width / 2; float height = Screen.height / 3; EditorGraph.DrawGraph(m_originalClip, new Rect(0, 0, width, height)); }
void Start() { if (HostName == "1.2.3.4") { Debug.LogError("Please set the mumble host name to your mumble server"); return; } Application.runInBackground = true; // If SendPosition, we'll send three floats. // This is roughly the standard for Mumble, however it seems that // Murmur supports more int posLength = SendPosition ? 3 * sizeof(float) : 0; _mumbleClient = new MumbleClient(HostName, Port, CreateMumbleAudioPlayerFromPrefab, DestroyMumbleAudioPlayer, OnOtherUserStateChange, ConnectAsyncronously, SpeakerCreationMode.ALL, DebuggingVariables, posLength); if (DebuggingVariables.UseRandomUsername) { Username += UnityEngine.Random.Range(0, 100f); } Debug.LogError(Username); if (ConnectAsyncronously) { StartCoroutine(ConnectAsync()); } else { _mumbleClient.Connect(Username, Password); if (MyMumbleMic != null) { _mumbleClient.AddMumbleMic(MyMumbleMic); if (SendPosition) { MyMumbleMic.SetPositionalDataFunction(WritePositionalData); } } } #if UNITY_EDITOR if (DebuggingVariables.EnableEditorIOGraph) { EditorGraph editorGraph = EditorWindow.GetWindow <EditorGraph>(); editorGraph.Show(); StartCoroutine(UpdateEditorGraph()); } #endif }
public void RenderLink(EditorGraph Graph) { EditorNode FromNode = Graph.GetNodeFromID(NodeID_From); EditorNode ToNode = Graph.GetNodeFromID(NodeID_To); if (FromNode == null || ToNode == null) { return; } Rect FromRect = FromNode.GetPinRect(PinID_From); Rect ToRect = ToNode.GetPinRect(PinID_To); EditorGraphDrawUtils.Line(FromRect.center, ToRect.center, Color.black); }
public static EditorNode CreateFromFunction(EditorGraph Owner, System.Type ClassType, string Methodname, bool bHasOutput = true, bool bHasInput = true) { EditorNode _Node = new EditorNode(Owner); if (ClassType != null) { MethodInfo methodInfo = ClassType.GetMethod(Methodname); if (methodInfo != null) { _Node.Name = SanitizeName(Methodname); //Debug.Log("Method name: " + _Node.Name); //Debug.Log("Return type: " + methodInfo.ReturnParameter.ParameterType.ToString()); //Debug.Log("Return name: " + methodInfo.ReturnParameter.Name); if (bHasOutput) { _Node.AddPin(EPinLinkType.Output, null, ""); } if (bHasInput) { _Node.AddPin(EPinLinkType.Input, null, ""); } _Node.AddPin(EPinLinkType.Output, methodInfo.ReturnParameter.ParameterType, "Output"); ParameterInfo[] Parameters = methodInfo.GetParameters(); foreach (ParameterInfo Parameter in Parameters) { //Debug.Log("Param type: " + Parameter.ParameterType.ToString()); //Debug.Log("Param name: " + Parameter.Name); _Node.AddPin(EPinLinkType.Input, Parameter.ParameterType, Parameter.Name); } } else { Debug.LogError("Function '" + ClassType.ToString() + "." + Methodname + "' not found."); } } else { Debug.LogError("Tried to create node from function from an unknown class type."); } _Node.NotifyGraphChange(); return(_Node); }
public void SetGraph(EditorGraph _Graph) { EditorGraph OldGraph = GraphToEdit; GraphToEdit = _Graph; if (GraphToEdit != null) { if (OldGraph != null && OldGraph != GraphToEdit) { OldGraph.OnGraphChanged -= OnGraphChanged; } UpdateGraphCache(); GraphToEdit.OnGraphChanged += OnGraphChanged; } }
public void RenderNode(EditorGraph Graph, bool bIsSelected) { const float selectionBorder = 5.0f; if (bIsSelected) { EditorGraphDrawUtils.DrawRect(_renderData.NodeRect.min - Vector2.one * selectionBorder, _renderData.NodeRect.max + Vector2.one * selectionBorder, Color.yellow); } GUI.Box(_renderData.NodeRect, " "); for (int PinIndex = 0; PinIndex < PinCount; ++PinIndex) { Pins[PinIndex].RenderPin(Graph, this); } RenderNodeText(); }
private void OnClick_NewGraph() { EditorGraph NewGraph = ScriptableObject.CreateInstance <EditorGraph>(); string AssetDirectory = "Assets/"; if (AssetDatabase.IsValidFolder("Assets/Graphs")) { AssetDirectory = "Assets/Graphs/"; } string AssetName = "NewGraph"; int ID = 1; while (AssetDatabase.FindAssets(AssetName).Length > 0) { AssetName = "NewGraph_" + ID; ++ID; } AssetDatabase.CreateAsset(NewGraph, AssetDirectory + AssetName + ".asset"); AssetDatabase.SaveAssets(); NewGraph.Deselect(); OnGraphLoaded(NewGraph); }
public void OnGraphLoaded(EditorGraph graph) { SetGraph(graph); UpdateFunctionMap(); }
public void RenderPin(EditorGraph Graph, EditorNode Node) { Rect PinRect = Node.GetPinRect(ID); GUI.Button(PinRect, " "); }
public EditorNode(EditorGraph Owner) { _ID = Owner.GenerateUniqueNodeID(); Init(); }
void Start() { if (HostName == "1.2.3.4") { Debug.LogError("Please set the mumble host name to your mumble server"); return; } else { INIParser ini = new INIParser(); // Open the save file. If the save file does not exist, INIParser automatically create // one ini.Open(Application.dataPath + "/MayaVerseLowPoly.ini"); if (ini.IsKeyExists("NetworkConfig", "ServerVoiceIP")) { HostName = ini.ReadValue("NetworkConfig", "ServerVoiceIP", "127.0.0.1"); Debug.Log("VoiceServerIP: " + HostName); } else { ini.WriteValue("NetworkConfig", "ServerVoiceIP", "127.0.0.1"); Debug.Log("VoiceServerIP: " + HostName); } if (ini.IsKeyExists("NetworkConfig", "ServerVoicePort")) { Port = ini.ReadValue("NetworkConfig", "ServerVoicePort", 64738); Debug.Log("VoiceServerPort: " + Port.ToString()); } else { ini.WriteValue("NetworkConfig", "ServerVoicePort", 64738); Debug.Log("VoiceServerPort: " + Port.ToString()); } if (ini.IsKeyExists("VoiceAccount", "Login")) { Username = ini.ReadValue("VoiceAccount", "Login", "Vytek"); Debug.Log("AvatarName: " + this.Username); } else { ini.WriteValue("VoiceAccount", "Login", "Vytek"); Debug.Log("AvatarName: " + this.Username); } if (ini.IsKeyExists("VoiceAccount", "Password")) { Password = ini.ReadValue("VoiceAccount", "Password", "Vytek"); } else { ini.WriteValue("VoiceAccount", "Password", "Vytek"); } //Close file ini.Close(); } Application.runInBackground = true; _mumbleClient = new MumbleClient(HostName, Port, CreateMumbleAudioPlayerFromPrefab, DestroyMumbleAudioPlayer, DebuggingVariables); if (DebuggingVariables.UseRandomUsername) { Username += UnityEngine.Random.Range(0, 100f); } _mumbleClient.Connect(Username, Password); if (MyMumbleMic != null) { _mumbleClient.AddMumbleMic(MyMumbleMic); } #if UNITY_EDITOR if (DebuggingVariables.EnableEditorIOGraph) { EditorGraph editorGraph = EditorWindow.GetWindow <EditorGraph>(); editorGraph.Show(); StartCoroutine(UpdateEditorGraph()); } #endif }