コード例 #1
0
    public virtual void Awake()
    {
        m_SendController = null;

        if (string.IsNullOrEmpty(SendControllerObjectName) == true)
        {
            Debug.LogError("You must supply a SendControllerObjectName");
            return;
        }

        GameObject controllerObject = GameObject.Find(SendControllerObjectName);

        if (controllerObject == null)
        {
            Debug.LogError(string.Format("A GameObject with the name '{0}' could not be found", SendControllerObjectName));
            return;
        }

        OscSendController controller = controllerObject.GetComponent <OscSendController> ();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", SendControllerObjectName));
            return;
        }

        m_SendController = controller;
    }
コード例 #2
0
ファイル: NiwController.cs プロジェクト: Naiko90/Pong
    // Use this for initialization
    public override void Start()
    {
        #region init receiver

        base.Start();

        #endregion

        #region init sender

        OscSendController controller = sendControllerObject.GetComponent<OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sendControllerObject.name));
            return;
        }

        m_SendController = controller;

        #endregion

        #region init NIW

        if (doInitializeNiw)
        {
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero", 0));
            Send(new OscMessage("/niw/server/push/invert/low/avg/zero/contactdetect", "aggregator/floorcontact"));
            Send(new OscMessage("/niw/server/config/invert/low", 0.025f));
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero/contactdetect", 10000));
        }

        #endregion
    }
コード例 #3
0
ファイル: SendOscBehaviourBase.cs プロジェクト: Naiko90/Pong
    public virtual void Awake()
    {
        m_SendController = null;

        if (string.IsNullOrEmpty(SendControllerObjectName) == true)
        {
            Debug.LogError("You must supply a SendControllerObjectName");
            return;
        }

        GameObject controllerObject = GameObject.Find(SendControllerObjectName);

        if (controllerObject == null)
        {
            Debug.LogError(string.Format("A GameObject with the name '{0}' could not be found", SendControllerObjectName));
            return;
        }

        OscSendController controller = controllerObject.GetComponent<OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", SendControllerObjectName));
            return;
        }

        m_SendController = controller;
    }
コード例 #4
0
    void Awake()
    {
        if (receiver == null)
        {
            Debug.LogError("You must supply a ReceiveController");
            return;
        }

        if (!GetReceiveController(receiver, out floorReceiverController))
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscReceiveController component", receiver.name));
            return;
        }
        else
        {
            callbacks = new Dictionary <KeyValuePair <OscReceiveController, string>, OscMessageEvent>();
            callbacks[new KeyValuePair <OscReceiveController, string>(floorReceiverController, "/niw/client/raw")] = ReceiveMessage;
            callbacks[new KeyValuePair <OscReceiveController, string>(floorReceiverController, "/niw/client/aggregator/floorcontact")] = FloorContact;
        }

        floorSenderController = sender.GetComponent <OscSendController>();
        if (floorSenderController == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sender.name));
            return;
        }

        floorType     = type;
        serverAddress = "/niw/game/status";
    }
コード例 #5
0
ファイル: Movement.cs プロジェクト: Naiko90/Road-Runner
    // Use this for initialization
    void Start()
    {
        OscSendController controller = sendControllerObject.GetComponent <OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sendControllerObject.name));
            return;
        }

        m_SendController = controller;
    }
コード例 #6
0
    // Use this for initialization
    public override void Start()
    {
        playerController = transform.FindChild("PlayerController").gameObject;

        #region init receiver

        base.Start();

        #endregion

        #region init sender

        OscSendController controller = sendControllerObject.GetComponent <OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sendControllerObject.name));
            return;
        }

        m_SendController = controller;

        #endregion

        #region init NIW

        if (doInitializeNiw)
        {
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero", 0));
            Send(new OscMessage("/niw/server/push/invert/low/avg/zero/contactdetect", "aggregator/floorcontact"));
            Send(new OscMessage("/niw/server/config/invert/low", 0.025f));
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero/contactdetect", 10000));
        }

        #endregion

        for (int i = 0; i < 6; i++)
        {
            for (int j = 0; j < 6; j++)
            {
                FeetMap[i, j] = -1;
            }
        }
    }
コード例 #7
0
ファイル: NiwController.cs プロジェクト: Naiko90/Road-Runner
    // Use this for initialization
    public override void Start()
    {
        playerController = transform.FindChild("PlayerController").gameObject;

        #region init receiver

        base.Start();

        #endregion

        #region init sender

        OscSendController controller = sendControllerObject.GetComponent<OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sendControllerObject.name));
            return;
        }

        m_SendController = controller;

        #endregion

        #region init NIW

        if (doInitializeNiw)
        {
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero", 0));
            Send(new OscMessage("/niw/server/push/invert/low/avg/zero/contactdetect", "aggregator/floorcontact"));
            Send(new OscMessage("/niw/server/config/invert/low", 0.025f));
            Send(new OscMessage("/niw/server/config/invert/low/avg/zero/contactdetect", 10000));
        }

        #endregion

        for (int i = 0; i < 6; i++)
        {
            for (int j = 0; j < 6; j++)
            {
                FeetMap[i, j] = -1;
            }
        }
    }
コード例 #8
0
ファイル: Movement.cs プロジェクト: Naiko90/Road-Runner
    // Use this for initialization
    void Start()
    {
        OscSendController controller = sendControllerObject.GetComponent<OscSendController>();

        if (controller == null)
        {
            Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscSendController component", sendControllerObject.name));
            return;
        }

        m_SendController = controller;
    }