public void Start() { if(m_input==null) { m_input = FindObjectOfType(typeof(NIInput)) as NIInput; if (m_input == null) throw new System.Exception("Please add an NIInput object to the scene"); } swipeRightDetector = new InputGestureDetector(m_input, "NIGUI_SWIPE_RIGHT"); swipeLeftDetector = new InputGestureDetector(m_input, "NIGUI_SWIPE_LEFT"); GUI.skin = menuSkin; singleImageWidth = Screen.width; singleImageHeight = Screen.height; container = new Rect(0,0,singleImageWidth,singleImageHeight); }
/// mono-behavior start - initializes the input public void Start() { if(m_input==null) { m_input = FindObjectOfType(typeof(NIInput)) as NIInput; if (m_input == null) throw new System.Exception("Please add an NIInput object to the scene"); } if(m_tracker == null) { m_tracker = FindObjectOfType(typeof(NISkeletonTracker)) as NISkeletonTracker; } swipeRightDetector = new InputGestureDetector(m_input, "NIGUI_SWIPE_RIGHT"); swipeLeftDetector = new InputGestureDetector(m_input, "NIGUI_SWIPE_LEFT"); crossHandDetector = new InputGestureDetector(m_input, "NIGUI_CROSS_HAND"); pushDetector = new InputGestureDetector(m_input, "NIGUI_PUSH"); waveDetector = new InputGestureDetector(m_input, "NIGUI_WAVE"); steadyDetector = new InputGestureDetector(m_input, "NIGUI_CLICK"); leftHandupDetector = new InputGestureDetector(m_input, "NIGUI_LEFT_HANDUP"); menuAreaNormalized = new Rect (menuArea.x * Screen.width - (menuArea.width * 0.5f), menuArea.y * Screen.height - (menuArea.height * 0.5f), menuArea.width, menuArea.height); }