diff --git a/.github/workflows/VRC-Asset-Release-And-Upload.yml b/.github/workflows/VRC-Asset-Release-And-Upload.yml new file mode 100644 index 0000000..ac34bff --- /dev/null +++ b/.github/workflows/VRC-Asset-Release-And-Upload.yml @@ -0,0 +1,84 @@ +name: VRC Asset Release and Listing Upload +on: + push: + tags: + - "*.*.*" + +env: + ASSETS_PATH: . + RELEASE_PATH: Packages + ARTIFACT_DURATION: 30 # In days + UPLOAD_ENDPOINT: https://api.vrlabs.dev/packages/add + WORKFLOW_VERSION: 1.0.0 + +jobs: + build: + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Check if package.json exists + run: | + if [ ! -f package.json ]; then + echo "package.json not found" + exit 1 + fi + + - name: Get package.json + id: get_package_json + run: | + { + echo 'package_json<<"""' + echo $(cat package.json) + echo '"""' + } >> $GITHUB_OUTPUT + + - name: Get needed Data + id: job_data + run: | + version=$(echo "${{ github.ref_name }}") + version=$(echo $version | tr '[:upper:]' '[:lower:]') + echo "version=$version" >> $GITHUB_OUTPUT + major_version=$(echo $version | cut -d '.' -f 1) + minor_version=$(echo $version | cut -d '.' -f 2) + echo "major_version=$major_version" >> $GITHUB_OUTPUT + echo "minor_version=$minor_version" >> $GITHUB_OUTPUT + name="${{ fromJson(steps.get_package_json.outputs.package_json).name }}" + display_name="${{ fromJson(steps.get_package_json.outputs.package_json).displayName }}" + echo "package_name=$name" >> $GITHUB_OUTPUT + echo "package_display_name=$display_name" >> $GITHUB_OUTPUT + + - name: Create Packages + id: create_packages + uses: VRLabs/VRCTools-Packaging-Action@v1 + with: + path: '${{ env.ASSETS_PATH }}' + outputPath: '${{ env.RELEASE_PATH }}' + releaseUrl: 'https://github.com/${{ github.repository }}/releases/download/${{ steps.job_data.outputs.version }}/${{ steps.job_data.outputs.package_name }}-${{ steps.job_data.outputs.version }}.zip' + unityReleaseUrl: 'https://github.com/${{ github.repository }}/releases/download/${{ steps.job_data.outputs.version }}/${{ steps.job_data.outputs.package_name }}-${{ steps.job_data.outputs.version }}.unitypackage' + releaseVersion: '${{ steps.job_data.outputs.version }}' + + - name: Create Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: "${{ steps.job_data.outputs.package_display_name }} ${{ steps.job_data.outputs.version }}" + files: | + ${{ steps.create_packages.outputs.unityPackagePath }} + ${{ steps.create_packages.outputs.vccPackagePath }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SOURCE_TAG: ${{ steps.job_data.outputs.version }} + + - name: Add server-json to Artifacts + uses: actions/upload-artifact@v3 + with: + name: server-json + path: ${{ steps.create_packages.outputs.serverPackageJsonPath }} + retention-days: ${{ env.ARTIFACT_DURATION }} + + - name: Send package info to a server + run: | + curl -X POST -H "Content-Type: application/json" -H "Vrl-Api-Key: ${{ secrets.LISTINGS_API_KEY }}" --data @${{ steps.create_packages.outputs.serverPackageJsonPath }} ${{ env.UPLOAD_ENDPOINT }} || exit 0 + shell: bash \ No newline at end of file diff --git a/Instancer.meta b/Instancer.meta new file mode 100644 index 0000000..7b5e64f --- /dev/null +++ b/Instancer.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b4349f730b814a7082972510eb968f5d +timeCreated: 1723227768 \ No newline at end of file diff --git a/Instancer/Mirror-Clone-Toggle Instancer.asmdef b/Instancer/Mirror-Clone-Toggle Instancer.asmdef new file mode 100644 index 0000000..88e4c5d --- /dev/null +++ b/Instancer/Mirror-Clone-Toggle Instancer.asmdef @@ -0,0 +1,22 @@ +{ + "name": "VRLabs Mirror-Clone-Toggle Instancer", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "dev.vrlabs.instancer", + "expression": "", + "define": "VRLABS_INSTANCER_FOUND" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Instancer/Mirror-Clone-Toggle Instancer.asmdef.meta b/Instancer/Mirror-Clone-Toggle Instancer.asmdef.meta new file mode 100644 index 0000000..056e8fc --- /dev/null +++ b/Instancer/Mirror-Clone-Toggle Instancer.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5da78789c0cd4809889e5c87c5ec9c9e +timeCreated: 1723227768 \ No newline at end of file diff --git a/Instancer/Mirror-Clone-Toggle Instancer.cs b/Instancer/Mirror-Clone-Toggle Instancer.cs new file mode 100644 index 0000000..e48d1ae --- /dev/null +++ b/Instancer/Mirror-Clone-Toggle Instancer.cs @@ -0,0 +1,50 @@ +#if VRLABS_INSTANCER_FOUND +using System; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace VRLabs.MirrorCloneToggle +{ + public class MirrorCloneToggle : ScriptableObject + { + public const string packageName = "Mirror-Clone-Toggle"; + + public static string[] excludeRegexs = + { + ".*\\.cs", + ".*\\.asmdef", + "package.json" + }; + + [MenuItem("VRLabs/Create Instance/Mirror Clone Toggle")] + public static void FancyPackage() + { + Type instancerType = AppDomain.CurrentDomain.GetAssemblies() + .Where(x => x.GetType("VRLabs.Instancer.Instancer") != null) + .Select(x => x.GetType("VRLabs.Instancer.Instancer")).FirstOrDefault(); + + if (instancerType == null) + { + Debug.LogError("Instancer not found. To use this functionality, install the VRLabs Instancer from https://github.com/VRLabs/Instancer"); + return; + } + + MethodInfo instanceMethod = instancerType.GetMethod("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + + if (instanceMethod == null) + { + Debug.LogError("Instance method not found"); + return; + } + + var assetPath = new System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName() + .Replace(System.IO.Path.GetDirectoryName(Application.dataPath), "") + .Replace("\\", "/".Replace("./", "")); + + instanceMethod.Invoke(null, new object[] { packageName, assetPath, excludeRegexs }); + } + } +} +#endif \ No newline at end of file diff --git a/Instancer/Mirror-Clone-Toggle Instancer.cs.meta b/Instancer/Mirror-Clone-Toggle Instancer.cs.meta new file mode 100644 index 0000000..44cade8 --- /dev/null +++ b/Instancer/Mirror-Clone-Toggle Instancer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bcea72e9d1784ef9a41455807931f8c7 +timeCreated: 1723227768 \ No newline at end of file diff --git a/LICENSE.meta b/LICENSE.meta new file mode 100644 index 0000000..8687b1f --- /dev/null +++ b/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 83655823a7e15f447bf464ee6d0522b1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mirror Clone Toggle FX.controller b/Mirror Clone Toggle FX.controller new file mode 100644 index 0000000..e779286 --- /dev/null +++ b/Mirror Clone Toggle FX.controller @@ -0,0 +1,258 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1101 &-8173707088435146515 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: MirrorCloneToggle/Enabled + m_EventTreshold: 0 + - m_ConditionMode: 1 + m_ConditionEvent: IsLocal + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5919636765436306317} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-5764120379198688606 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: MirrorCloneToggle/Enabled + m_EventTreshold: 0 + - m_ConditionMode: 1 + m_ConditionEvent: IsLocal + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5919636765436306317} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &-5426313753696026812 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Init + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 6510848551071469322} + - {fileID: -5764120379198688606} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 0 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d8c0e2a9235deba4d91a56f82c7a7791, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-2656895139126610080 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: MirrorCloneToggle/Enabled + m_EventTreshold: 0 + - m_ConditionMode: 1 + m_ConditionEvent: IsLocal + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5125844152620525728} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Mirror Clone Toggle FX + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: MirrorCloneToggle/Enabled + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: IsLocal + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Mirror Clone Toggle + m_StateMachine: {fileID: 1547352308192947263} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &1547352308192947263 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Mirror Clone Toggle + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5426313753696026812} + m_Position: {x: 30, y: 180, z: 0} + - serializedVersion: 1 + m_State: {fileID: 5125844152620525728} + m_Position: {x: -90, y: 250, z: 0} + - serializedVersion: 1 + m_State: {fileID: 5919636765436306317} + m_Position: {x: 150, y: 250, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 80, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 50, y: 40, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5426313753696026812} +--- !u!1102 &5125844152620525728 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clone On + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -8173707088435146515} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 0 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 51595a4a862e73147bb5c83b2b2940ff, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &5919636765436306317 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clone Off + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -2656895139126610080} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 0 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d8c0e2a9235deba4d91a56f82c7a7791, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &6510848551071469322 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: MirrorCloneToggle/Enabled + m_EventTreshold: 0 + - m_ConditionMode: 1 + m_ConditionEvent: IsLocal + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5125844152620525728} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 diff --git a/Mirror Clone Toggle FX.controller.meta b/Mirror Clone Toggle FX.controller.meta new file mode 100644 index 0000000..c45e050 --- /dev/null +++ b/Mirror Clone Toggle FX.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb436c3848cf21544b7e0f60308e2f5a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mirror Clone Toggle Parameters.asset b/Mirror Clone Toggle Parameters.asset new file mode 100644 index 0000000..5e4ce97 --- /dev/null +++ b/Mirror Clone Toggle Parameters.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1506855854, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: Mirror Clone Toggle Parameters + m_EditorClassIdentifier: + parameters: + - name: MirrorCloneToggle/Enabled + valueType: 2 + saved: 0 + defaultValue: 0 + networkSynced: 0 diff --git a/Mirror Clone Toggle Parameters.asset.meta b/Mirror Clone Toggle Parameters.asset.meta new file mode 100644 index 0000000..33538a7 --- /dev/null +++ b/Mirror Clone Toggle Parameters.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f5d005f63629201499f645ba521b48f8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mirror Clone Toggle.prefab b/Mirror Clone Toggle.prefab new file mode 100644 index 0000000..77fb7d0 --- /dev/null +++ b/Mirror Clone Toggle.prefab @@ -0,0 +1,117 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3882979636311929898 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3882979636311929899} + - component: {fileID: 3882979636311929908} + m_Layer: 0 + m_Name: Mirror Clone Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3882979636311929899 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3882979636311929898} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3882979638049024001} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &3882979636311929908 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3882979636311929898} + m_Enabled: 0 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 0.31 + field of view: 1 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 262144 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: 13f9f29dfe756564d9d99af99d243f95, type: 2} + m_TargetDisplay: 0 + m_TargetEye: 1 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 0 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!1 &3882979638049024000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3882979638049024001} + m_Layer: 0 + m_Name: Mirror Clone Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3882979638049024001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3882979638049024000} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3882979636311929899} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Mirror Clone Toggle.prefab.meta b/Mirror Clone Toggle.prefab.meta new file mode 100644 index 0000000..b177b6d --- /dev/null +++ b/Mirror Clone Toggle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 77c5dc2670a82c44fa69d87bc6e09183 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md index 76cd534..2734a05 100644 --- a/README.md +++ b/README.md @@ -1 +1,75 @@ -# MirrorCloneToggle \ No newline at end of file +
+ +# Mirror Clone Toggle + +[![Generic badge](https://img.shields.io/github/downloads/VRLabs/Mirror-Clone-Toggle/total?label=Downloads)](https://github.com/VRLabs/Mirror-Clone-Toggle/releases/latest) +[![Generic badge](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/VRLabs/Mirror-Clone-Toggle/blob/main/LICENSE) +[![Generic badge](https://img.shields.io/badge/Quest-Incompatible-red?logo=Meta)](https://img.shields.io/badge/Quest-Incompatible-red?logo=Meta) +[![Generic badge](https://img.shields.io/badge/Unity-2022.3.22f1-lightblue?logo=Unity)](https://unity.com/releases/editor/whats-new/2022.3.22) +[![Generic badge](https://img.shields.io/badge/SDK-AvatarSDK3-lightblue.svg)](https://vrchat.com/home/download) + +[![Generic badge](https://img.shields.io/discord/706913824607043605?color=%237289da&label=DISCORD&logo=Discord&style=for-the-badge)](https://discord.vrlabs.dev/) +[![Generic badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dvrlabs%26type%3Dpatrons&style=for-the-badge)](https://patreon.vrlabs.dev/) + +A system for forcing the mirror clone to be enabled + +### ⬇️ [Download Latest Version](https://github.com/VRLabs/Mirror-Clone-Toggle/releases/latest) + +### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.mirror-clone-toggle) + +
+ +--- + +## How it works + +* There is a camera in the system, which when enabled, always renders the `MirrorReflection` layer to a 1x1 resolution render texture. +* This is enough to get VRChat to enable the local Mirror Clone. + +## Install guide + +https://github.com/user-attachments/assets/93651823-2b07-45d2-b9cf-87c1a2d8b63c + +* Drag and drop the `Mirror Clone Toggle` prefab onto your avatar +* Merge the `Mirror Clone Toggle FX` FX layer with your avatar's FX layer, using [Av3Manager](https://github.com/VRLabs/Avatars-3.0-Manager) +* Merge the parameter list with your avatar's parameter list + +## How to use + +* The `MirrorCloneToggle/Enabled` parameter is a bool, which enables the mirror clone when enabled. + +## Performance stats + +```c++ +FX Animator Layers: 1 +``` + +## Hierarchy layout + +```html +Mirror Clone Toggle +|-Mirror Clone Camera +``` + +## Contributors + +* [WingmanDraws](https://github.com/WingmanDraws) +* [TohruTheDragon](https://github.com/fkrisi11) + +## License + +Mirror Clone Toggle is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Mirror-Clone-Toggle/blob/main/LICENSE). + +​ + +
+ +[](https://vrlabs.dev "VRLabs") + +[](https://discord.vrlabs.dev/ "VRLabs") + +[](https://patreon.vrlabs.dev/ "VRLabs") + +[](https://twitter.com/vrlabsdev "VRLabs") + +
diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..d023518 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f312616b66ef523469e05f092c74d9fe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources.meta b/Resources.meta new file mode 100644 index 0000000..d4b8594 --- /dev/null +++ b/Resources.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 31f451ce050f49c0a70a6e2f347942d4 +timeCreated: 1723227777 \ No newline at end of file diff --git a/Resources/Animations.meta b/Resources/Animations.meta new file mode 100644 index 0000000..e8fc227 --- /dev/null +++ b/Resources/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a938435b09986f458ea208a4109c90d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Animations/Clone Off.anim b/Resources/Animations/Clone Off.anim new file mode 100644 index 0000000..29f2f6b --- /dev/null +++ b/Resources/Animations/Clone Off.anim @@ -0,0 +1,122 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clone Off + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.016666668 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: Mirror Clone Toggle/Mirror Clone Camera + classID: 20 + script: {fileID: 0} + flags: 0 + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 242439732 + attribute: 3305885265 + script: {fileID: 0} + typeID: 20 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.016666668 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.016666668 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: Mirror Clone Toggle/Mirror Clone Camera + classID: 20 + script: {fileID: 0} + flags: 0 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Resources/Animations/Clone Off.anim.meta b/Resources/Animations/Clone Off.anim.meta new file mode 100644 index 0000000..f9b6a9b --- /dev/null +++ b/Resources/Animations/Clone Off.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d8c0e2a9235deba4d91a56f82c7a7791 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Animations/Clone On.anim b/Resources/Animations/Clone On.anim new file mode 100644 index 0000000..d9653e6 --- /dev/null +++ b/Resources/Animations/Clone On.anim @@ -0,0 +1,122 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clone On + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.016666668 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: Mirror Clone Toggle/Mirror Clone Camera + classID: 20 + script: {fileID: 0} + flags: 0 + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 242439732 + attribute: 3305885265 + script: {fileID: 0} + typeID: 20 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.016666668 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.016666668 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: Mirror Clone Toggle/Mirror Clone Camera + classID: 20 + script: {fileID: 0} + flags: 0 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Resources/Animations/Clone On.anim.meta b/Resources/Animations/Clone On.anim.meta new file mode 100644 index 0000000..a50a694 --- /dev/null +++ b/Resources/Animations/Clone On.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51595a4a862e73147bb5c83b2b2940ff +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Texture.meta b/Resources/Texture.meta new file mode 100644 index 0000000..46163e1 --- /dev/null +++ b/Resources/Texture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98f049afaec537f4794e6ec89abe4dd8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Texture/Clone Texture.renderTexture b/Resources/Texture/Clone Texture.renderTexture new file mode 100644 index 0000000..319bb93 --- /dev/null +++ b/Resources/Texture/Clone Texture.renderTexture @@ -0,0 +1,40 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!84 &8400000 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clone Texture + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 5 + m_Width: 1 + m_Height: 1 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 0 + m_ColorFormat: 8 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 0 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 diff --git a/Resources/Texture/Clone Texture.renderTexture.meta b/Resources/Texture/Clone Texture.renderTexture.meta new file mode 100644 index 0000000..a053549 --- /dev/null +++ b/Resources/Texture/Clone Texture.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13f9f29dfe756564d9d99af99d243f95 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..0066d4d --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "dev.vrlabs.mirror-clone-toggle", + "displayName": "Mirror Clone Toggle", + "version": "1.0.999", + "license": "MIT", + "unity": "2022.3", + "description": "A system for forcing the mirror clone to be enabled", + "author": { + "name": "VRLabs", + "email": "mail@vrlabs.dev", + "url": "https://vrlabs.dev" + }, + "siteUrl": "https://github.com/VRLabs/Mirror-Clone-Toggle", + "vpmDependencies": { + "dev.vrlabs.instancer": ">=1.0.2" + }, + "legacyFolders": {}, + "unityPackageDestinationFolder": "Assets/VRLabs/Mirror Clone Toggle", + "vccRepoCategory": "components", + "unityPackageDestinationFolderMetas": { + "Assets/VRLabs": "652a1ba5b00554143bc9a76307dbc4e8", + "Assets/VRLabs/Mirror Clone Toggle": "e4dddd3555a991342961214ad86014b2" + }, + "questCompatibility": "none" +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..51594a8 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c1ef40a664744dc4b8862dfc23808ca7 +timeCreated: 1723228082 \ No newline at end of file