Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 private static Vector3 ComputeRelativePosition(EntityGameObjectDirectory directory, EntityGameObjectDirectory.Type gameObjectType)
 {
     return(directory.GetGameObject(gameObjectType).transform.localPosition);
 }
Esempio n. 5
0
 private static Quaternion ComputeRelativeRotation(EntityGameObjectDirectory directory, EntityGameObjectDirectory.Type gameObjectType)
 {
     return(directory.GetGameObject(gameObjectType).transform.localRotation);
 }
Esempio n. 6
0
        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);
        }