sendString() private method

private sendString ( string message ) : void
message string
return void
Exemplo n.º 1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (isPlayerController /*|| gameManager.inCinematicMode*/)
        {
            return;
        }

        if (collision.gameObject.tag == "Lightsaber" || collision.gameObject.tag == "MainCamera")
        {
            //Debug.Log("Clash!");
            audioClash.Play();
            UDPScript.sendString("clash");
            //UDPScript.sendString("clash");
            //UDPScript.sendString(Random.Range(1, 4).ToString());
            //baxter.GetComponent<BaxterController>().SendBaxterMessage(0);
            //baxterController.SendBaxterMessage(Random.Range(0, 3));
        }
        else
        {
            audioClash.Stop();
        }
    }
Exemplo n.º 2
0
    void OnTriggerEnter(Collider other)
    {
        //Debug.Log("Triggered with " + other.tag);



        if ((other.tag == "Pillar" || other.tag == "Rocket") && !shield.onOff)
        {
            Vector3 velocityChange = Vector3.forward * 2000;
            velocityChange.z += Mathf.Abs((rb.velocity.z / 10));

            rb.AddRelativeForce(velocityChange, ForceMode.VelocityChange);
            Info.getCameraShake().AddShake(40, 0.2f);
            ////////////////////////////////////////
            udpSendRef.sendString("CrashedWall");

            ICollidable collidable = other.GetComponent <ICollidable>();
            if (collidable != null)
            {
                collidable.Collide();
            }

            Info.getDistortImageEffects().Quake();
            ObstacleExplosion.Explode(other.transform.position);
            GameObject.Find("CrashSound").GetComponent <AudioSource>().Play();
        }

        if (other.tag == "SpeedUpRing")
        {
            rb.AddRelativeForce(Vector3.forward * -2000, ForceMode.VelocityChange);
            //Info.getCameraShake().AddShake(40, 0.2f);
            //Info.getDistortImageEffects().Quake();
            blur.Quake();
            GameObject.Find("SpeedupSound").GetComponent <AudioSource>().Play();
            /////////////////////////////////////
            udpSendRef.sendString("SpeedUpRing");
        }

        if (other.tag == "Portal")
        {
            if (!desertMode)
            {
                Info.getFollowPlayer().GoStraight(rb.velocity.z);

                Vector3 teleportPosition = other.GetComponent <Portal>().connectionPortal.transform.position;
                teleportPosition.y = transform.position.y;
                transform.position = teleportPosition;
                desertMode         = true;

                GetComponent <PortalDesertSpawner>().EnterDesert();
            }
            else
            {
                Info.getFollowPlayer().GoStraight(rb.velocity.z);

                Vector3 teleportPosition = other.GetComponent <Portal>().connectionPortal.transform.position;
                teleportPosition.y = transform.position.y;
                transform.position = teleportPosition;
                desertMode         = false;

                GetComponent <PortalDesertSpawner>().EnterCity();
            }

            if (rb.velocity.z > -6500 * deathModifier)
            {
                rb.velocity = new Vector3(rb.velocity.x, rb.velocity.y, -6500 * deathModifier);
            }

            GameObject.Find("PortalSound").GetComponent <AudioSource>().Play();
        }

        if (other.tag == "CityCrack")
        {
            StartDropDown();
            GameObject.Find("FadeOut").GetComponent <FadeOut>().StartFadeOut();
        }

        if (other.tag == "DesertPlane")
        {
            desertPlane = other.gameObject;
        }
    }
Exemplo n.º 3
0
 public void SendBaxterMessage(int num)
 {
     udpSend.sendString(ArmMoveCmd("left", new Vector3(posX, posY, posZ), DegreesToQuaternion(new Vector3(rotX, rotY, rotZ))));
     //udpSend.sendString(ArmMoveCmd(baxterCmdList[num].armName, baxterCmdList[num].armPos, baxterCmdList[num].armRot));
     //udpSend.sendString(cmd.ArmMoveCmd(baxterCmdList[num].armName, baxterCmdList[num].armPos.x, baxterCmdList[num].armPos.y, baxterCmdList[num].armPos.z, baxterCmdList[num].armRot.x, baxterCmdList[num].armRot.y, baxterCmdList[num].armRot.z, baxterCmdList[num].armRot.w));
 }
Exemplo n.º 4
0
 public void sendIp(){
     UDPSend sendObj = new UDPSend();
     sendObj.init();
     sendObj.sendString("MyIP" + " " + Network.player.ipAddress);
     GameObject.Destroy(sendObj);
 }