Esempio n. 1
0
    private void Update()
    {
        if (Input.GetKey(KeyCode.Space))
        {
            for (var i = 0; i <= 1000; i++)
            {
                var m1 = new AllocTestMessage()
                {
                    value = "test"
                };
                FastMessagesPipe.SendMessage(m1);
            }
        }

        if (Input.GetKey(KeyCode.Return))
        {
            for (var i = 0; i <= 1000; i++)
            {
                var m1 = new AllocTestMessageSlow()
                {
                    value = "test"
                };
                EventMessageDispatcher.Dispatch(m1);
            }
        }
    }
    private void SendColorMessage()
    {
        var color   = GetComponent <Image>().color;
        var message = new ColorMessage(color);

        EventMessageDispatcher.Dispatch(message);
    }
Esempio n. 3
0
    private void SendRotationMessage()
    {
        float x, y, z, t;

        float.TryParse(rotationX.text, out x);
        float.TryParse(rotationY.text, out y);
        float.TryParse(rotationZ.text, out z);
        float.TryParse(time.text, out t);
        var v3      = new Vector3(x, y, z);
        var message = new RotationMessage(v3, t <= 0 ? 1 : t);

        EventMessageDispatcher.Dispatch(message);
    }