コード例 #1
0
        public virtual BasicAction GetDrivePrimaryAction(InteractableRaw thisInteractable, InteractorRaw interactor)
        {
            //return base.GetPrimaryAction(interactor);
            Transform offset = thisInteractable.CreateOffset(interactor);

            //if (driveType == DriveTypes.Directional)
            //	switch (thisInteractable.followType)
            //	{
            //		case FollowType.Transform:
            //			return new DirectionalTransformDriveAction(this, thisInteractable, interactor, offset);
            //		case FollowType.Rigidbody:
            //			return new DirectionalRigidbodyDriveAction(this, thisInteractable, interactor, offset);
            //		case FollowType.Joint:
            //			return new DirectionalDriveJointAction(this, thisInteractable.mainRigidbody, interactor, offset);
            //	}
            //else if (driveType == DriveTypes.Rotational)
            //	switch (thisInteractable.followType)
            //	{
            //		case FollowType.Transform:
            //			return new RotationalTransformDriveAction(this, thisInteractable, interactor, offset);
            //		case FollowType.Rigidbody:
            //			break;
            //		case FollowType.Joint:
            //			break;
            //	}

            return(null);
        }
コード例 #2
0
        public virtual BasicAction GetPrimaryAction(InteractableRaw thisInteractable, InteractorRaw interactor)
        {
            Transform offset = thisInteractable.CreateOffset(interactor);

            switch (thisInteractable.followType)
            {
            case FollowType.Transform:
                if (!thisInteractable.preciseRotate)
                {
                    return(new GrabFollowTransformAction(thisInteractable, interactor, offset));
                }
                else
                {
                    return(new GrabFollowTransformPosDifRotAction(thisInteractable, interactor, offset));
                }

            case FollowType.Rigidbody:
                if (!thisInteractable.preciseRotate)
                {
                    return(new GrabFollowVelocityAction(thisInteractable, interactor, offset));
                }
                else
                {
                    return(new GrabFollowRigidbodyForceAtPointAction(thisInteractable, interactor, offset));
                }

            case FollowType.Joint:
                return(new GrabFollowJointAction(thisInteractable, interactor, offset));
            }
            return(null);
        }