Skip to content

Instantly share code, notes, and snippets.

View momo-the-monster's full-sized avatar

Momo the Monster momo-the-monster

View GitHub Profile
@momo-the-monster
momo-the-monster / SetGitPath.cs
Created August 6, 2021 00:48
Add Folder to Environment Path in C#
using System;
using UnityEditor;
using UnityEngine;
public class SetGitPath : MonoBehaviour
{
[InitializeOnLoadMethod]
// Start is called before the first frame update
public static void Initialize()
{
%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
@momo-the-monster
momo-the-monster / AndroidManifest.xml
Created October 29, 2019 01:29
Oculus Quest-Ready Android Manifest
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /><!-- Request the headset DoF mode -->
<application>
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
android:launchMode="singleTask"
android:name="com.unity3d.player.UnityPlayerActivity"
@momo-the-monster
momo-the-monster / InputExplore.cs
Created October 29, 2019 01:27
Unity XR Cross-Platform Input
using UnityEngine;
using UnityEngine.XR;
namespace MMM.XR
{
public class InputExplore : MonoBehaviour
{
[SerializeField] private GameObject _leftHandPrefab;
[SerializeField] private GameObject _rightHandPrefab;
[SerializeField] private Transform _handContainer;
#!/usr/bin/python3
#Copyright 2017 Michael Kirsch
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
#to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
try:
import time
@momo-the-monster
momo-the-monster / RaycastHoverPoint.cs
Created October 18, 2018 00:28
Steam VR Interaction from Afar
using Valve.VR;
public class RaycastHoverPoint : MonoBehaviour {
public LayerMask LayerMask;
public Transform target;
public float MaxDistance = 5;
public void OnPoseUpdate(SteamVR_Action_Pose pose)
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AudienceCamera : MonoBehaviour
{
public GameObject mainCameraEye;
public bool lockZ = true;
public static WebCamTexture PrepareWebCamTexture (ref WebCamDevice device, bool frontFace, int width, int height)
{
WebCamTexture texture = null;
// Checks how many and which cameras are available on the device
for (int cameraIndex = 0; cameraIndex < WebCamTexture.devices.Length; cameraIndex++) {
if (WebCamTexture.devices [cameraIndex].isFrontFacing == frontFace) {
Debug.Log (cameraIndex + " name " + WebCamTexture.devices [cameraIndex].name
+ " isFrontFacing " + WebCamTexture.devices [cameraIndex].isFrontFacing);
device = WebCamTexture.devices [cameraIndex];
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections.Generic;
using System.Text;
namespace Helios
{
[InitializeOnLoad]
public class ShowSceneButtons : EditorWindow
@momo-the-monster
momo-the-monster / GrowMany-Snip.cs
Last active August 29, 2015 14:22
Sample code from Dwell
// MIT License for original content by Momo the Monster
// For Dwell & PDXCCCards
// Feel free to remove the redundant braces in the for loop if you want it to read tighter.
internal void GrowMany()
{
Sequence s = DOTween.Sequence();
for (int i = 0; i < numberToGrow; i++)
{
s.AppendCallback(Grow).AppendInterval(growSpeed);