Skip to content

Commit

Permalink
Merge pull request #5 from VRLabs/dev
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
jellejurre committed Feb 26, 2024
2 parents 11984d7 + f6a950d commit bc3d6af
Show file tree
Hide file tree
Showing 29 changed files with 312 additions and 89 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/VRC-Asset-Release-And-Upload.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 0 additions & 45 deletions .github/workflows/create-release.yml

This file was deleted.

22 changes: 11 additions & 11 deletions FX.controller → Follower FX.controller
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Follower.Stop
m_ConditionEvent: Follower/Stop
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -2991692699483340776}
Expand All @@ -36,21 +36,21 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -2991692699483340776}
m_Position: {x: 10, y: 220, z: 0}
m_Position: {x: 30, y: 250, z: 0}
- serializedVersion: 1
m_State: {fileID: 2507061558303221150}
m_Position: {x: 10, y: 150, z: 0}
m_Position: {x: 30, y: 180, z: 0}
- serializedVersion: 1
m_State: {fileID: 1525845798234148065}
m_Position: {x: 10, y: 290, z: 0}
m_Position: {x: 30, y: 320, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 30, y: 10, z: 0}
m_EntryPosition: {x: 30, y: 90, z: 0}
m_ExitPosition: {x: 30, y: 50, z: 0}
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: 2507061558303221150}
--- !u!1102 &-2991692699483340776
Expand Down Expand Up @@ -86,10 +86,10 @@ AnimatorController:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FX
m_Name: Follower FX
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Follower.Stop
- m_Name: Follower/Stop
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
Expand Down Expand Up @@ -117,7 +117,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Follower.Stop
m_ConditionEvent: Follower/Stop
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1525845798234148065}
Expand All @@ -140,7 +140,7 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Follow
m_Name: Active
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions Follower.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1669249760399220748}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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_Children:
- {fileID: 5349806979329730795}
- {fileID: 5147591202370098870}
- {fileID: 5349806979329730795}
- {fileID: 4330276376573234579}
m_Father: {fileID: 0}
m_RootOrder: 0
Expand Down Expand Up @@ -82,7 +82,7 @@ MonoBehaviour:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0, w: 1}
collisionTags:
- Follower
- Follower/Stop
--- !u!114 &5719607805482665401
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -102,12 +102,12 @@ MonoBehaviour:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0, w: 1}
collisionTags:
- Follower
- Follower/Stop
allowSelf: 1
allowOthers: 0
localOnly: 0
receiverType: 0
parameter: Follower.Stop
parameter: Follower/Stop
minVelocity: 0.05
--- !u!1 &3314792913649324533
GameObject:
Expand Down Expand Up @@ -201,7 +201,7 @@ Transform:
m_Children:
- {fileID: 733502934842423558}
m_Father: {fileID: 1675005943129074272}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1818360609 &1569617139350710
RotationConstraint:
Expand Down Expand Up @@ -354,7 +354,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1675005943129074272}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1183024399 &3767271862023166392
LookAtConstraint:
Expand Down
8 changes: 8 additions & 0 deletions Instancer.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Instancer/Follower Instancer.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "VRLabs Follower 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
}
7 changes: 7 additions & 0 deletions Instancer/Follower Instancer.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions Instancer/Follower Instancer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#if VRLABS_INSTANCER_FOUND
using System;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;

namespace VRLabs.Follower
{
public class Follower : ScriptableObject
{
public const string packageName = "Follower";

public static string[] excludeRegexs =
{
".*\\.cs",
".*\\.asmdef",
"package.json"
};

[MenuItem("VRLabs/Create Instance/Follower")]
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 editor = ScriptableObject.CreateInstance<Follower>();
var script = MonoScript.FromScriptableObject(editor);
var assetPath = AssetDatabase.GetAssetPath(script);

instanceMethod.Invoke(null, new object[] { packageName, assetPath, excludeRegexs });
}
}
}
#endif
11 changes: 11 additions & 0 deletions Instancer/Follower Instancer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 VRLabs
Copyright (c) 2022 VRLabs LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file added Media/Preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Media/Setup.mp4
Binary file not shown.
Binary file added Media/Web/Preview.webp
Binary file not shown.
7 changes: 7 additions & 0 deletions Media/Web/Preview.webp.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Media/Web/PreviewGif.webp
Binary file not shown.
7 changes: 7 additions & 0 deletions Media/Web/PreviewGif.webp.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Media/setup.mp4
Binary file not shown.
Loading

0 comments on commit bc3d6af

Please sign in to comment.