You control the game, not the player
- rewind, pause?
Parallel Dimensions
- ..
Pausing has Consequences
| // Here's a solution via reflection. This is the same method that gets called when you F2 or Right Click | Rename | |
| [MenuItem("Test/Rename")] | |
| public static void Rename() | |
| { | |
| var type = typeof(EditorWindow).Assembly.GetType("UnityEditor.SceneHierarchyWindow"); | |
| var hierarchyWindow = EditorWindow.GetWindow(type); | |
| var rename = type.GetMethod("RenameGO", BindingFlags.Instance | BindingFlags.NonPublic); | |
| rename.Invoke(hierarchyWindow, null); | |
| } |
| // you can either select the object and execute a menu command | |
| public static void PerformOperation(string operation) | |
| { | |
| EditorApplication.ExecuteMenuItem("Edit/" + operation); | |
| } | |
| Selection.activeObject = myObj; | |
| PerformOperation("Copy"); | |
| // http://answers.unity3d.com/answers/707375/view.html |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using MoonSharp.Interpreter; | |
| namespace PerformanceComparison | |
| { | |
| class Sample |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using MoonSharp.Interpreter; | |
| using MoonSharp.Interpreter.Interop; | |
| namespace Playground |
| // assign gameobject layer using layermask NOTE returns -2147483648 if you havent set the layermask in inspector! | |
| go.layer = (int)(Mathf.Log((uint)layermask.value, 2)); | |
| // set layers to children also | |
| foreach (Transform t in go.transform) | |
| { | |
| t.gameObject.layer = (int)(Mathf.Log((uint)layermask.value, 2)); | |
| } | |
| // check if layer exists by name |
| //SmoothMovementTest | |
| // https://forum.unity3d.com/threads/smoothmovementtest-should-help-eliminating-hiccup-sources.162694/ | |
| using UnityEngine; | |
| using System.Collections; | |
| public class SmoothMovementTest : MonoBehaviour { | |
| public Transform cube; | |
| public Transform cubeRigid; |
| // https://twitter.com/JoachimHolmer/status/859974266233794560 | |
| // tested with 10million random vectors | |
| // 1100ms | |
| public static bool EqualVector3(Vector3 a, Vector3 b) | |
| { | |
| return a==b; | |
| } |