本文整理汇总了C#中SFSObject.PutFloat方法的典型用法代码示例。如果您正苦于以下问题:C# SFSObject.PutFloat方法的具体用法?C# SFSObject.PutFloat怎么用?C# SFSObject.PutFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFSObject
的用法示例。
在下文中一共展示了SFSObject.PutFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendPublicMessageForSyncMove
public void SendPublicMessageForSyncMove(int myPlayerId, Vector3 destination)
{
SFSObject obj = new SFSObject();
obj.PutUtfString("username", userName + myPlayerId);
obj.PutFloat("destinationx", destination.x);
obj.PutFloat("destinationy", destination.y);
obj.PutFloat("destinationz", destination.z);
sfs.Send(new PublicMessageRequest("move", obj));
}
示例2: SendPublicMessageRequestFire
public void SendPublicMessageRequestFire(int myPlayerID, int shootPower, float directX, float directY)
{
SFSObject obj = new SFSObject();
obj.PutUtfString("username", userName + myPlayerID);
obj.PutInt("shootpower", shootPower);
obj.PutFloat("directx", directX);
obj.PutFloat("directy", directY);
sfs.Send(new PublicMessageRequest("playerfire", obj));
}
示例3: PlayerMove
public void PlayerMove(float x, float y, float z)
{
//Debug.Log("PlayerMove: " + x + " " + y + " " + z);
ISFSObject obj = new SFSObject();
obj.PutFloat("x", x);
obj.PutFloat("y", y);
obj.PutFloat("z", z);
sfs.Send(new ExtensionRequest(Commands.MOVE, obj, sfs.LastJoinedRoom));
}
示例4: InviaAnimazioneControllerTast
public static void InviaAnimazioneControllerTast(int userId, float forward, float turn,bool onGround , float jump , float jumpLeg,bool attacco1,bool attacco2)
{
SFSObject objOut = new SFSObject();
objOut.PutFloat("f", forward);
objOut.PutFloat("t", turn);
objOut.PutBool("o", onGround);
objOut.PutFloat("j", jump);
objOut.PutFloat("jL", jumpLeg);
objOut.PutBool("a1", attacco1);
objOut.PutBool("a2", attacco2);
me.sfs.Send(new ExtensionRequest("SanT", objOut,me. sfs.LastJoinedRoom));
}
示例5: Compress
protected void Compress()
{
GameObject tetrisDropper = GameObject.Find ("TetrisDropper");
GameObject gameManager = GameObject.Find ("GameManager");
SFSObject createBlockMessage = new SFSObject ();
createBlockMessage.PutUtfString ("messageType", "RequestCreate");
createBlockMessage.PutUtfString ("objectType", "Block");
createBlockMessage.PutFloat ("xPos", tetrisDropper.transform.position.x);
createBlockMessage.PutFloat ("yPos", tetrisDropper.transform.position.y);
createBlockMessage.PutFloat ("zPos", tetrisDropper.transform.position.z);
gameManager.SendMessage ("SendData", createBlockMessage);
}
示例6: InviaAnimazioneControllerClick
public static void InviaAnimazioneControllerClick(int userId, float forward, bool attacco1, bool attacco2)
{
SFSObject objOut = new SFSObject();
objOut.PutFloat("f", forward);
objOut.PutBool("a1", attacco1);
objOut.PutBool("a2", attacco2);
me.sfs.Send(new ExtensionRequest("SanC", objOut, me.sfs.LastJoinedRoom));
}
示例7: Update
void Update()
{
if (!theUI.GetchatTBFocus())
{
if (Input.GetKeyDown(KeyCode.W))
{
this.MecAnim.SetBool(RUN_ANIMATION, true);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloatArray("Location", ourLPC.GetLocation());
ObjectIn.PutBool("IsMoving", true);
SFServer.Send(new ExtensionRequest("PositionUpdate", ObjectIn));
// First rotation
this.PlayerRB.transform.Rotate(0, crosshairTransform.localRotation.eulerAngles.y, 0);
crosshairTransform.localRotation = Quaternion.Euler(crosshairTransform.localEulerAngles.x, 0, crosshairTransform.localEulerAngles.z);
crosshairTransform.localPosition = new Vector3(1f, 2.5f, 1.0f);
ObjectIn = new SFSObject();
ObjectIn.PutFloat("Rotation", ourLPC.GetRotation());
SFServer.Send(new ExtensionRequest("RotationUpdate", ObjectIn));
}
if (Input.GetKeyUp(KeyCode.W))
{
this.MecAnim.SetBool(RUN_ANIMATION, false);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloatArray("Location", ourLPC.GetLocation());
ObjectIn.PutBool("IsMoving", false);
SFServer.Send(new ExtensionRequest("PositionUpdate", ObjectIn));
}
if (Input.GetKey(KeyCode.W))
{
CameraController cameraControllerObj = (CameraController)Camera.main.GetComponent("CameraController");
cameraControllerObj.setCursorVisible(false);
this.PlayerRB.MovePosition(transform.position + (transform.forward * Time.deltaTime * PlayerSpeed));
}
if (Input.GetKey(KeyCode.W) && Input.GetAxis("Mouse X") != 0)
{
// Take Cross Hair's rotate, and reset crosshair
this.PlayerRB.transform.Rotate(0, crosshairTransform.localRotation.eulerAngles.y, 0);
crosshairTransform.localRotation = Quaternion.Euler(crosshairTransform.localEulerAngles.x, 0, crosshairTransform.localEulerAngles.z);
crosshairTransform.localPosition = new Vector3(1f, 2.5f, 1.0f);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloat("Rotation", ourLPC.GetRotation());
SFServer.Send(new ExtensionRequest("RotationUpdate", ObjectIn));
}
if (Input.GetKeyDown(KeyCode.F))
{
if (ourLPC.getPlayerAction() != null)
{
ourLPC.getPlayerAction().performAction(GameObject.Find("SceneScriptsObject"));
}
}
}
}
示例8: InviaTransformLocali
//MODIFICA BY LUCA
/*
private void InviaTransformLocali()
{
ISFSObject objOut = new SFSObject();
objOut.PutFloat("x", Statici.playerLocaleGO.transform.position.x);
objOut.PutFloat("y", Statici.playerLocaleGO.transform.position.y);
objOut.PutFloat("z", Statici.playerLocaleGO.transform.position.z);
objOut.PutFloat("rot", Statici.playerLocaleGO.transform.rotation.eulerAngles.y);
sfs.Send(new ExtensionRequest("regT", objOut, sfs.LastJoinedRoom));
controllerPlayer.MovementDirty = false;
}
*/
public static void InviaTransformLocali(NetworkTransform ne)
{
ISFSObject objOut = new SFSObject();
objOut.PutFloat("x", ne.position.x);
objOut.PutFloat("y", ne.position.y);
objOut.PutFloat("z", ne.position.z);
objOut.PutFloat("rx", ne.rotation.x);
objOut.PutFloat("ry", ne.rotation.y);
objOut.PutFloat("rz", ne.rotation.z);
me.sfs.Send(new ExtensionRequest("regT", objOut, me.sfs.LastJoinedRoom));
// me.controllerPlayer.MovementDirty = false;
}
示例9: SendStatusChange
void SendStatusChange()
{
pendingSend = false;
ISFSObject data = new SFSObject();
ISFSObject tr = new SFSObject();
if(sendHP){
Debug.Log("Sending status change: " + component.HP);
tr.PutFloat("currentHP", component.HP);
}
data.PutSFSObject(NetSyncObjCharacter.statusDS, tr);
data.PutInt("id", syncObj.ID);
SFSNetworkManager.Instance.SendNetObjSync(data);
}
示例10: TransformToSFSObject
public static ISFSObject TransformToSFSObject(Vector3 pos, Vector3 angles)
{
ISFSObject data = new SFSObject();
data.PutUtfString("type", "transform");
data.PutFloat("x", pos.x);
data.PutFloat("y", pos.y);
data.PutFloat("z", pos.z);
data.PutFloat("rx", angles.x);
data.PutFloat("ry", angles.y);
data.PutFloat("rz", angles.z);
return data;
}
示例11: SendData
public void SendData(Transform a)
{
ISFSObject isfsO = new SFSObject();
isfsO.PutInt("Sender", sfs.MySelf.PlayerId);
isfsO.PutFloat("px", a.position.x);
isfsO.PutFloat("py", a.position.y);
isfsO.PutFloat("pz", a.position.z);
isfsO.PutFloat("rx", a.rotation.x);
isfsO.PutFloat("ry", a.rotation.y);
isfsO.PutFloat("rz", a.rotation.z);
sfs.Send(new ExtensionRequest(ConfigRequestCmd.cmd_playermove, isfsO, sfs.LastJoinedRoom));
}
示例12: SendFireRequest
private void SendFireRequest( object data )
{
SFSObject sfsdata = new SFSObject ();
Dictionary<string, object> firedata = data as Dictionary<string, object>;
sfsdata.PutFloat ( "damage", ( float ) firedata[ "damage" ] );
sfsdata.PutUtfString("type", (string)firedata["type"]);
sfsdata.PutInt ( "player.hit.id", ( int ) firedata[ "player.hit.id" ] );
sfsdata.PutFloat ( "contact.point.x", ( float ) firedata[ "contact.point.x" ] );
sfsdata.PutFloat ( "contact.point.y", ( float ) firedata[ "contact.point.y" ] );
sfsdata.PutFloat ( "contact.point.z", ( float ) firedata[ "contact.point.z" ] );
SFSInstance.Send ( new ExtensionRequest ( "server.fire", sfsdata, SFSInstance.LastJoinedRoom, useUDP ) );
}
示例13: ToSFSObject
// Stores the transform values to SFSObject to send them to server
public ISFSObject ToSFSObject(ISFSObject data)
{
ISFSObject launchMessage = new SFSObject();
//Message
launchMessage.PutUtfString("messageType", type);
//side hit id
launchMessage.PutInt("cubeID", cubeID);
//side hit id
launchMessage.PutInt("sideID", sideID);
// Launch Position
launchMessage.PutFloat("sx", this.launchPosition.x);
launchMessage.PutFloat("sy", this.launchPosition.y);
launchMessage.PutFloat("sz", this.launchPosition.z);
// Launch Destination
launchMessage.PutFloat("ex", this.launchDestination.x);
launchMessage.PutFloat("ey", this.launchDestination.y);
launchMessage.PutFloat("ez", this.launchDestination.z);
//Local Game Time
launchMessage.PutDouble("localGameTime", this.localGameTime);
//Local Game Time
launchMessage.PutDouble("gameTimeETA", this.gameTimeETA);
data.PutSFSObject("launchMessage", launchMessage);
return data;
}
示例14: toSFSObject
public override SFSObject toSFSObject()
{
SFSObject storyObject = new SFSObject();
storyObject.PutLong("id_UserStory", this.getId_UserStory());
storyObject.PutLong ("Id_Sprint", this.id_Sprint);
storyObject.PutInt("prioridad", this.getPrioridad());
storyObject.PutUtfString("descripcion", this.getDescripcion());
storyObject.PutSFSArray("listaTareas", this.getListaTareasToSFSArray());
storyObject.PutSFSArray("listaEstimacion", this.getListaEstimacionToSFSArray());
storyObject.PutSFSArray ("listaCriterios", this.getListaCriteriosToSFSArray ());
storyObject.PutInt("estadoEstimacion",this.getEstadoEstimacion());
storyObject.PutFloat("valorEstimacion",this.getValorEstimacion());
storyObject.PutLong("id_proyecto",this.getProyecto());
storyObject.PutUtfString("Titulo",this.getTitulo());
storyObject.PutBool("cerrada", this.cerrada);
storyObject.PutUtfString ("fecha_ultimo_cambio", this.get_fecha_ultimo_cambio ().ToString());
return storyObject;
}
示例15: OnStartGame
private void OnStartGame()
{
if (sfs.MySelf.PlayerId == 1)
{
player = (GameObject)Instantiate(Resources.Load("Prefabs/player", typeof(GameObject)), new Vector3(-5, 0, 0), Quaternion.identity);
player.gameObject.name = userName + sfs.MySelf.PlayerId.ToString();
}
else if (sfs.MySelf.PlayerId == 2)
{
player = (GameObject)Instantiate(Resources.Load("Prefabs/player", typeof(GameObject)), new Vector3(5, 0, 0), Quaternion.identity);
player.name = userName + sfs.MySelf.PlayerId;
}
SFSObject obj = new SFSObject();
obj.PutUtfString("username", userName + sfs.MySelf.PlayerId);
obj.PutFloat("x", player.transform.position.x);
obj.PutFloat("y", player.transform.position.y);
obj.PutFloat("z", player.transform.position.z);
sfs.Send(new PublicMessageRequest("newplayerjoingame", obj));
}