コード例 #1
0
    // Use this for initialization

    void Start()
    {
        sender   = OSCStream.GetComponent <Sender>();
        receiver = OSCStream.GetComponent <Receiver>();

        localPath = GetGameObjectPath(transform, root);

        receiver.AddChannel(localPath + ".transform", new float[10]);
        receiver.AddChannel(localPath + ".remoteManipulation", false);
        if (recursive)
        {
            for (int c = 0; c < transform.childCount; ++c)
            {
                Transform child = transform.GetChild(c);
                if (child.gameObject.GetComponent <OSCTransform>() == null)
                {
                    OSCTransform childOSCT = child.gameObject.AddComponent <OSCTransform>();
                    childOSCT.recursive = true;
                    childOSCT.root      = root;
                    childOSCT.OSCStream = OSCStream;
                    childOSCT.mode      = mode;
                }
            }
        }
    }
コード例 #2
0
    void Start()
    {
        sender   = OSCStream.GetComponent <Sender>();
        receiver = OSCStream.GetComponent <Receiver>();

        localPath = GetGameObjectPath(transform, root);
        size      = width * height;
        matrix    = new byte[size];
        receiver.AddChannel(localPath + ".matrix", matrix);
        receiver.AddChannel(localPath + ".remoteManipulation", false);

        tex    = new Texture2D(width, height);
        colors = new Color32[size];
        GetComponent <Renderer>().material.mainTexture = tex;
    }