public void processPickedUpSheepMessage(PickedUpSheepMessage _msg) { GameObject sheep = GameObject.Find(_msg.sheepName); if (sheep != null) { SheepMovement sheep_movement = sheep.GetComponent <SheepMovement>(); Rigidbody sheep_rb = sheep.GetComponent <Rigidbody>(); sheep_rb.velocity = Vector3.zero; sheep_rb.angularVelocity = Vector3.zero; sheep_rb.useGravity = false; sheep_movement.setPickedUpBy(_msg.playerName); sheep_movement.setState(_msg.sheepState); sheep_movement.localMove(_msg.sheepPosition, _msg.sheepRotation, _msg.time, _msg.sheepAnimation); } }
public void processSheepMovementMessage(SheepMovementMessage _msg) { //server does not care about sheep movement receiving messages if (isServer) { return; } GameObject sheep = GameObject.Find(_msg.objectTransformName); if (sheep != null) { SheepMovement sheep_movement = sheep.GetComponent <SheepMovement>(); if (sheep_movement.getState() != (int)State.Unavailable) { sheep_movement.localMove(_msg.objectPosition, _msg.objectRotation, _msg.time, _msg.objectAnimation); } } }