public GameObject GetGameObject(EntityGameObjectDirectory.Type gameObjectType) { if (!Enum.IsDefined(typeof(Type), gameObjectType)) { throw new InvalidEnumArgumentException(nameof(gameObjectType), (int)gameObjectType, typeof(Type)); } switch (gameObjectType) { case Type.Root: return(RootGameObject); case Type.IKRoot: return(IKRoot); case Type.CameraRoot: return(CameraRoot); case Type.RightHand: return(RightHand); case Type.LeftHand: return(LeftHand); case Type.NameRoot: return(NameRoot); case Type.HeadRoot: return(HeadRoot); default: throw new ArgumentOutOfRangeException(nameof(gameObjectType), gameObjectType, null); } }
private static int InitializeRotationIndex(NetworkMovementTrackerTypeFlags context, NetworkMovementTrackerTypeFlags flagToCheck, EntityGameObjectDirectory.Type gameObjectType, Quaternion[] rotations, int index, EntityGameObjectDirectory directory) { if((context & flagToCheck) != 0) directory.GetGameObject(gameObjectType).transform.localRotation = rotations[index++]; return index; }
private static int InitializePositionIndex(NetworkMovementTrackerTypeFlags context, NetworkMovementTrackerTypeFlags flagToCheck, EntityGameObjectDirectory.Type gameObjectType, Vector3[] positions, int index, EntityGameObjectDirectory directory) { //cameraTransform.position = (rootTransform.position + args.ChangeInformation.Data.TrackerPositionUpdates[0]); if((context & flagToCheck) != 0) directory.GetGameObject(gameObjectType).transform.localPosition = positions[index++]; return index; }
private static Vector3 ComputeRelativePosition(EntityGameObjectDirectory directory, EntityGameObjectDirectory.Type gameObjectType) { return(directory.GetGameObject(gameObjectType).transform.localPosition); }
private static Quaternion ComputeRelativeRotation(EntityGameObjectDirectory directory, EntityGameObjectDirectory.Type gameObjectType) { return(directory.GetGameObject(gameObjectType).transform.localRotation); }
private static int InitializePositionIndex(NetworkMovementTrackerTypeFlags context, NetworkMovementTrackerTypeFlags flagToCheck, EntityGameObjectDirectory.Type gameObjectType, Vector3[] positions, int index, EntityGameObjectDirectory directory) { if ((context & flagToCheck) != 0) { positions[index++] = ComputeRelativePosition(directory, gameObjectType); } return(index); }