Add VRChat and GitHub packages to Unity project

This commit is contained in:
gunnbr committed 2021-01-18 09:14:18 -08:00
1 parent 0334a52b21
commit 85538aaccc
3297 files changed
+847877

No files matched your search

@@ -0,0 +1,37 @@
#if VRC_SDK_VRCSDK2
using UnityEngine;
using UnityEditor;
public class VRCPlayerModEditorWindow : EditorWindow {
public delegate void AddModCallback();
public static AddModCallback addModCallback;
private static VRCSDK2.VRC_PlayerMods myTarget;
private static VRCSDK2.VRCPlayerModFactory.PlayerModType type;
public static void Init (VRCSDK2.VRC_PlayerMods target, AddModCallback callback)
{
// Get existing open window or if none, make a new one:
EditorWindow.GetWindow (typeof (VRCPlayerModEditorWindow));
addModCallback = callback;
myTarget = target;
type = VRCSDK2.VRCPlayerModFactory.PlayerModType.Jump;
}
void OnGUI ()
{
type = (VRCSDK2.VRCPlayerModFactory.PlayerModType)EditorGUILayout.EnumPopup("Mods", type);
if(GUILayout.Button("Add Mod"))
{
VRCSDK2.VRCPlayerMod mod = VRCSDK2.VRCPlayerModFactory.Create(type);
myTarget.AddMod(mod);
addModCallback();
}
}
}
#endif