コード例 #1
0
        private void DrawFrequencyDomainClip()
        {
            float width  = Screen.width / 2;
            float height = Screen.height / 3;

            EditorGraph.DrawGraph(m_fftApplied, new Rect(0, height * 2, width, height));
        }
コード例 #2
0
ファイル: MumbleTester.cs プロジェクト: Vytek/Mumble-Unity
    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
    }
コード例 #3
0
        private void DrawWindowedClip()
        {
            float width  = Screen.width / 2;
            float height = Screen.height / 3;

            EditorGraph.DrawGraph(m_windowedClip, new Rect(0, height, width, height));
        }
コード例 #4
0
        private void DrawTimeDomainClip()
        {
            float width  = Screen.width / 2;
            float height = Screen.height / 3;

            EditorGraph.DrawGraph(m_originalClip, new Rect(0, 0, width, height));
        }
コード例 #5
0
    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
    }
コード例 #6
0
    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);
    }
コード例 #7
0
    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);
    }
コード例 #8
0
    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;
        }
    }
コード例 #9
0
    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();
    }
コード例 #10
0
    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);
    }
コード例 #11
0
 public void OnGraphLoaded(EditorGraph graph)
 {
     SetGraph(graph);
     UpdateFunctionMap();
 }
コード例 #12
0
    public void RenderPin(EditorGraph Graph, EditorNode Node)
    {
        Rect PinRect = Node.GetPinRect(ID);

        GUI.Button(PinRect, " ");
    }
コード例 #13
0
 public EditorNode(EditorGraph Owner)
 {
     _ID = Owner.GenerateUniqueNodeID();
     Init();
 }
コード例 #14
0
ファイル: MumbleTester.cs プロジェクト: Vytek/MayaVerse
    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
    }