This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class FittedBoxCollider { | |
[MenuItem("GameObject/Create Other/Create Fitted BoxCollider")] | |
static void FittedBoxColliderMenu() { | |
Transform transform = Selection.activeTransform; | |
Quaternion rotation = transform.rotation; | |
transform.rotation = Quaternion.identity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using Holoville.HOTween; | |
[System.Serializable] | |
public class DynamicEvent { | |
[System.Serializable] | |
public class AnimationSetup { | |
public GameObject gameObject; | |
public string animation; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class CreateEmptyAtSelection : ScriptableObject { | |
[MenuItem("GameObject/Create Empty at Selection &n")] | |
static void CreateEmpty() { | |
GameObject go = new GameObject(); | |
if (Selection.activeTransform != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
plist=$1"/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :UIFileSharingEnabled bool true" $plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class MeasuringTape : MonoBehaviour { | |
public Vector3 target = Vector3.zero; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Diagnostics; | |
public class RevealPersistentDataDirectory : MonoBehaviour { | |
[MenuItem("Assets/Reveal Persistent Data Directory")] | |
static void DoMenu() { | |
Process process = new Process(); | |
process.StartInfo.FileName = ( (Application.platform == RuntimePlatform.WindowsEditor) ? "explorer.exe" : "open" ); | |
process.StartInfo.Arguments = "file://"+Application.persistentDataPath; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool RaycastWithTag(Ray ray, out RaycastHit hit, float distance, string tag, int layerMask = System.Int32.MaxValue) { | |
RaycastHit[] hits = Physics.RaycastAll(ray, distance, layerMask); | |
hit = new RaycastHit(); | |
hit.distance = distance; | |
foreach(RaycastHit ahit in hits) { | |
if ( ahit.distance < hit.distance && ahit.transform.CompareTag(tag) ) { | |
hit = ahit; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public delegate void GameEventDelegate(GameEvent evt = null); | |
[System.Serializable] | |
public class GameEvent { | |
public GameObject target; | |
NewerOlder