Skip to content

Instantly share code, notes, and snippets.

View korinVR's full-sized avatar
🥽
VR

Katsuomi Kobayashi korinVR

🥽
VR
View GitHub Profile
@korinVR
korinVR / SceneMenuGenerator.cs
Created April 20, 2022 00:54
Unity: Generate a quick scene-opening menu from the scene list of the Build Settings
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
// Generate a quick scene-opening menu from the scene list of the Build Settings.
// Usage: Open "Scene -> Generate Scene Menu..."
public static class SceneMenuGenerator
{
// Customize it appropriately.
@korinVR
korinVR / VRInputModule.cs
Last active December 7, 2020 00:36
Minimum VR EventSystem components
using System.Collections.Generic;
using UnityEngine.EventSystems;
namespace FrameSynthesis.XR.UnityUI
{
public class VRInputModule : BaseInputModule
{
readonly List<RaycastResult> raycastResults = new List<RaycastResult>();
public override void Process()
@korinVR
korinVR / XRPluginManagementSettings.cs
Last active May 20, 2024 15:38
Enable and disable XR Plug-in Management plugins
using System;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEditor.XR.Management.Metadata;
using UnityEngine;
namespace FrameSynthesis.XR
{
// ref. https://docs.unity3d.com/Packages/[email protected]/manual/EndUser.html
public static class XRPluginManagementSettings
@korinVR
korinVR / KonamiCommand.cs
Last active December 16, 2021 01:08
Konami Code detector for Oculus Quest
public class KonamiCommand
{
readonly OVRInput.RawButton[] sequenceButtons =
{
OVRInput.RawButton.LThumbstickUp,
OVRInput.RawButton.LThumbstickUp,
OVRInput.RawButton.LThumbstickDown,
OVRInput.RawButton.LThumbstickDown,
OVRInput.RawButton.LThumbstickLeft,
OVRInput.RawButton.LThumbstickRight,
@korinVR
korinVR / build.yml
Last active August 1, 2020 02:25
GitHub Action to build Hugo and deploy to AWS S3
name: CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
@korinVR
korinVR / SwitchXRMenu.cs
Last active June 17, 2020 03:46
Enabling/disabling XR settings on XR Plug-in Management
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEngine;
namespace KorinVR
{
public class SwitchXRMenu
{
[MenuItem("XR Tools/Enable XR")]
static void EnableXR()
@korinVR
korinVR / Jenkinsfile
Last active February 1, 2020 15:59
Running Unity tests Jenkinsfile
def unity = 'C:\\Program Files\\Unity\\Hub\\Editor\\2019.3.0f6\\Editor\\Unity.exe'
pipeline {
agent any
triggers {
pollSCM('H/5 * * * *')
}
stages {
@korinVR
korinVR / PixiJSResize.js
Last active May 4, 2019 15:30
Resizing the PixiJS stage according to the page size
import * as PIXI from 'pixi.js'
import backgroundImageURL from '/assets/images/background.jpg'
const application = new PIXI.Application()
const screenW = 1024
const screenH = 1024
const resize = () => {
@korinVR
korinVR / index.html
Last active September 25, 2024 11:31
Unity の WebGL 出力をブラウザ一杯に表示するテンプレート
<!-- Assets/WebGLTemplates/FullWindow あたりに格納して Player Settings で選択 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>%UNITY_WEB_NAME%</title>
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
<script>
const gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%");
@korinVR
korinVR / UnityXRParamFactory.cs
Created March 21, 2018 08:54
Use Vive Stereo Rendering Toolkit on Unity standard VR support
using UnityEngine;
using UnityEngine.XR;
namespace HTC.UnityPlugin.StereoRendering
{
public class UnityXRParamFactory : IDeviceParamFactory
{
public int GetRenderWidth()
{
return XRSettings.eyeTextureWidth;