void OpenDoor() { if (DoorIsOpen == true) { return; } if (!CanIOpen()) { return; } DoorIsOpen = true; Quaterniond TargetRot = OriginalOrientation * new Quaterniond(0, 90 * Math.PI / 180.0, 0); MMoveSync ms = new MMoveSync(msoParent, msoParent.transform.Position, TargetRot); ms.Speed = 0.5; msoParent.Add(ms); //Globals.Network.PositionRequest(msoParent.InstanceID, msoParent.transform.Position, TargetRot); //msoParentPhysics.SetRotation(OriginalOrientation * new Quaterniond(0, 90 * Math.PI / 180.0, 0)); }
void CloseDoor() { if (DoorIsOpen == false) { return; } DoorIsOpen = false; MMoveSync ms = (MMoveSync)msoParent.FindModuleByType(EType.MoveSync); if (ms != null) { ms.Stop(); msoParent.Remove(ms); } ms = new MMoveSync(msoParent, msoParent.transform.Position, OriginalOrientation); ms.Speed = 0.5; msoParent.Add(ms); //Globals.Network.PositionRequest(msoParent.InstanceID, msoParent.transform.Position, OriginalOrientation); }