using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using IDK.GlobalMessage;
public class Tester : MonoBehaviour
{

    void OnGUI () {
        // Make a background box
        GUI.Box(new Rect(10,10,170,120), "Message Test");
    
        if(GUI.Button(new Rect(20,40,150,20), "NAME")) {

            PrintLog ( GlobalMessage.Send("NAME") );

        }

        if(GUI.Button(new Rect(20,70,150,20), "CALC_ADD 1(integer)")) {
            PrintLog ( GlobalMessage.Send("CALC_ADD1",  new object[]{10, 100, 10}) );
        }

        if(GUI.Button(new Rect(20,100,150,20), "CALC_ADD 2(Vector)")) {
            PrintLog ( GlobalMessage.Send("CALC_ADD2",  new object[]{Vector3.one*10, Vector3.one*20}) );
        }
        
    }

    void PrintLog(Hashtable _returns)
    {
        string result = "";
        foreach(string obj in _returns.Keys)
        {
            result += $"{_returns[obj]}\n";
        }
        UnityEngine.Debug.Log(result);
    }


}
