private void Awake() { GameObject instance = Instantiate( tileSelectionIndicatorPrefab, transform ) as GameObject; marker = instance.transform; InputHandler = gameObject.AddComponent <EditorInputHandler>(); InputHandler.Initialize(this); }
private void Awake() { GameObject instance = Instantiate( tileSelectionIndicatorPrefab, transform ) as GameObject; marker = instance.transform; MoveAndUpdateMarker(new Point(0, 0)); Current = gameObject.AddComponent <Board> (); InputHandler = gameObject.AddComponent <EditorInputHandler> (); InputHandler.Initialize(this); }
static PlatformInputHandler GetPlatformInputHandler(RuntimePlatform platform) { PlatformInputHandler currentPlatformHandler = null; switch (platform) { case RuntimePlatform.Android: case RuntimePlatform.IPhonePlayer: currentPlatformHandler = new MobileInputHandler(); break; case RuntimePlatform.WindowsEditor: case RuntimePlatform.OSXEditor: default: currentPlatformHandler = new EditorInputHandler(); break; } return currentPlatformHandler; }
void OnGUI() { if( inputHandler == null ) inputHandler = new EditorInputHandler( this ); if ( !BeginGUI() ) { return; } List<Node> nodes = GetNodes(); List<NodeLink> links = GetNodeLinks(); Event e = Event.current; mousePosition = e.mousePosition; HandlePreInput( e ); Rect rect = position; rect.x = 0; rect.y = 0; scrollViewPosition = GUI.BeginScrollView( rect, scrollViewPosition, clientRect ); BeginWindows(); DrawNodes( nodes ); DrawLinks( links ); EndWindows(); GUI.EndScrollView(); HandlePostInput( e ); EndGUI(); if( rect.Contains( new Vector2( newClientRect.xMin, newClientRect.yMin ) ) && rect.Contains( new Vector2( newClientRect.xMax, newClientRect.yMax ) ) ) { clientRect = rect; } else { clientRect = newClientRect; } }