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 UnityEngine.EventSystems; | |
public class GetCurrentUIObject : MonoBehaviour | |
{ | |
void Update() | |
{ | |
// prints Null if nothing is selected, or name of the gameobject | |
Debug.Log(EventSystem.current.currentSelectedGameObject); | |
} |
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
Q) test runtime adjustments to Terrain Data in the Unity Editor without writing to actual terrain file? | |
A) Instantiate() the TerrainData object to get an in-memory copy, then modify that? | |
theTerrainData = Terrain.activeTerrain.terrainData; | |
theTerrainData = TerrainData.Instantiate(theTerrainData); | |
Terrain.activeTerrain.terrainData = theTerrainData; | |
Terrain.activeTerrain.Flush(); |
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; | |
[ExecuteInEditMode] | |
public class VolumetricImageEffect : MonoBehaviour | |
{ | |
public float exposure=0.6f; | |
public float decay = 0.95f; | |
public float density = 0.96f; | |
public float weight = 0.4f; | |
public float clamp = 1f; |
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
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG -v color | |
// http://answers.unity3d.com/questions/492681/how-to-use-adb-logcat.html#answer-571021 | |
-s parameter | |
-s Equivalent to filterspec '*:S' and is used to precede a list of filterspecs that add content. |
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
// original script : http://answers.unity3d.com/answers/252528/view.html | |
// modified by unitycoder.com | |
// Usage: Place this script in Editor/ folder | |
// Start the tool from menu, Window/Tools/Alpha-fy Images | |
using UnityEngine; | |
using UnityEditor; | |
using System.IO; |
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; | |
public class CustomPoint : MonoBehaviour | |
{ | |
public Vector3 offset = Vector2.zero; | |
public float radius = 0.05f; | |
void OnDrawGizmosSelected() | |
{ | |
Gizmos.color = Color.red; |
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
triple quotes for easy multiline string! | |
string1 = ("\n" | |
"asdfasdf\n" | |
"asdfasdf\n" | |
) | |
string1 = """ | |
asdfasdf | |
asdfasdf | |
""" |
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
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- | |
----------------- |
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
Installation failed with the following output: | |
pkg: /data/local/tmp/Package.apk | |
Failure [INSTALL_FAILED_OLDER_SDK] | |
5235 KB/s (22586102 bytes in 4.212s) | |
UnityEditor.HostView:OnGUI() | |
// file:AndroidManifest.xml, find line, adjust minSdkVersion, its probably higher than your device |
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
# http://stackoverflow.com/a/18416308 | |
from threading import Thread | |
import time | |
class MyClass(Thread): | |
def __init__(self, name): | |
super(MyClass, self).__init__() | |
#self.daemon = True | |
self.cancelled = False |