コード例 #1
0
    void milkcocoaEventHandler(MilkcocoaEvent e)
    {
        AudioSource audioSource = gameObject.GetComponent <AudioSource>();

        audioSource.clip = Audio;
        audioSource.PlayOneShot(Audio);
    }
コード例 #2
0
ファイル: testUI.cs プロジェクト: jack-app/jackhack2018_F
 public void milkcocoaEventHandler(MilkcocoaEvent e)
 {
     // e.data は JSONObjectです
     if (e.data.GetField("params").HasField("chat"))
     {
         string message  = e.data.GetField("params").GetField("chat").GetField("message").str;
         string username = e.data.GetField("params").GetField("chat").GetField("name").str;
         contentTextArea = Uri.UnescapeDataString(username) + " : " + Uri.UnescapeDataString(message) + "\n" + contentTextArea;
     }
 }
コード例 #3
0
    // メソッド
    public void milkcocoaEventHandler(MilkcocoaEvent e)
    {
        // Debug.Log("receivedJSON");
        if (e.data.GetField("params").HasField("chat"))
        {
            // Debug.Log("proper syntax");
            //受け取ったJSONファイルを読み込む
            string speakerName = e.data.GetField("params").GetField("chat").GetField("speakerName").str;
            string message     = e.data.GetField("params").GetField("chat").GetField("message").str;

            // Debug.Log(string.Format("{0} : {1}", speakerName, message));
            this.history = history + Uri.UnescapeDataString(speakerName) + " : " + Uri.UnescapeDataString(message) + System.Environment.NewLine;
        }
    }