コード例 #1
0
    void Start()
    {
        xmlDoc = new XmlDocument();
        SlipStreamComponent = GameObject.FindObjectOfType <SlipStream>();
        SlipStreamComponent.PacketNotification += new PacketReceivedHandler(OnPacketReceived);

        if (origin == null)
        {
            origin = new GameObject("Origin").transform;
        }

        /* NEW CODE */
        multiSkeletonBones = new SkeletonBones[skeletonList.Count];

        nBones = skeletonBonesList.Count / skeletonList.Count;       // number of bones per skeleton (assuming they've the same amount)

        for (int i = 0; i < multiSkeletonBones.Length; i++)
        {
            multiSkeletonBones[i] = new SkeletonBones();
            multiSkeletonBones[i].skeletonBonesIDs         = new int[nBones];
            multiSkeletonBones[i].skeletonBonesNames       = new string[nBones];
            multiSkeletonBones[i].skeletonBonesPositions   = new Vector3[nBones];
            multiSkeletonBones[i].skeletonBonesQuaternions = new Quaternion[nBones];
        }
        /* END OF NEW CODE */
    }
コード例 #2
0
	void Start () 
	{
		xmlDoc= new XmlDocument();
		SlipStreamComponent = GameObject.FindObjectOfType<SlipStream>();
		SlipStreamComponent.PacketNotification += new PacketReceivedHandler(OnPacketReceived);

		if(origin == null) {
			origin = new GameObject("Origin").transform;
		}
	}
コード例 #3
0
    void Start()
    {
        xmlDoc = new XmlDocument();
        SlipStreamComponent = GameObject.FindObjectOfType <SlipStream>();
        SlipStreamComponent.PacketNotification += new PacketReceivedHandler(OnPacketReceived);

        if (origin == null)
        {
            origin = new GameObject("Origin").transform;
        }
    }
コード例 #4
0
    void Awake()
    {
        Instance          = this;
        mReceiveBuffer    = new byte[kMaxSubPacketSize];
        mPacket           = System.String.Empty;
        mRemoteIpEndPoint = new IPEndPoint(IPAddress.Parse(IP), Port);
        mListener         = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
        mListener.Bind(mRemoteIpEndPoint);
        mListener.Blocking          = false;
        mListener.ReceiveBufferSize = 128 * 1024;

        xmlDoc = new XmlDocument();
    }
コード例 #5
0
    // Use this for initialization
    void Awake()
    {
        // we start the connection to the server from Unity by running the .bat file named UnitySample
        string path = Application.dataPath.Substring(2) + "/Server";
        path = path.Replace('/', '\\');
        Debug.Log(Application.dataPath + "/Server/UnitySample.bat " + remoteIP+ " " + myIp+ " " + myDrive + " " + '"' + path + '"');
        System.Diagnostics.Process.Start(Application.dataPath + "/Server/UnitySample.bat ", remoteIP + " " + myIp + " "  + myDrive + " "+'"'+ path+'"');

        xmlDoc = new XmlDocument();
        if (SlipStreamObject == null)
        {
            stream = GetComponent<SlipStream>();
        }
        else
        {
            stream = SlipStreamObject.GetComponent<SlipStream>();
        }
    }
コード例 #6
0
    // Use this for initialization
    void Awake()
    {
        // we start the connection to the server from Unity by running the .bat file named UnitySample
        string path = Application.dataPath.Substring(2) + "/Server";

        path = path.Replace('/', '\\');
        Debug.Log(Application.dataPath + "/Server/UnitySample.bat " + remoteIP + " " + myIp + " " + myDrive + " " + '"' + path + '"');
        System.Diagnostics.Process.Start(Application.dataPath + "/Server/UnitySample.bat ", remoteIP + " " + myIp + " " + myDrive + " " + '"' + path + '"');

        xmlDoc = new XmlDocument();
        if (SlipStreamObject == null)
        {
            stream = GetComponent <SlipStream>();
        }
        else
        {
            stream = SlipStreamObject.GetComponent <SlipStream>();
        }
    }
コード例 #7
0
    void Start()
    {
        xmlDoc= new XmlDocument();
        SlipStreamComponent = GameObject.FindObjectOfType<SlipStream>();
        SlipStreamComponent.PacketNotification += new PacketReceivedHandler(OnPacketReceived);

        if(origin == null) {
            origin = new GameObject("Origin").transform;
        }

        /* NEW CODE */
        multiSkeletonBones = new SkeletonBones[skeletonList.Count];

        nBones = skeletonBonesList.Count/skeletonList.Count; // number of bones per skeleton (assuming they've the same amount)

        for (int i = 0; i < multiSkeletonBones.Length; i++) {
            multiSkeletonBones[i] = new SkeletonBones();
            multiSkeletonBones[i].skeletonBonesIDs = new int[nBones];
            multiSkeletonBones[i].skeletonBonesNames = new string[nBones];
            multiSkeletonBones[i].skeletonBonesPositions = new Vector3[nBones];
            multiSkeletonBones[i].skeletonBonesQuaternions = new Quaternion[nBones];
        }
        /* END OF NEW CODE */
    }