コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (Image != null)
            {
                Image.Dispose();
                Image = null;
            }

            if (HeaderText != null)
            {
                HeaderText.Dispose();
                HeaderText = null;
            }

            if (FooterText != null)
            {
                FooterText.Dispose();
                FooterText = null;
            }

            if (ButtonDetails != null)
            {
                ButtonDetails.Dispose();
                ButtonDetails = null;
            }

            if (ButtonCancel != null)
            {
                ButtonCancel.Dispose();
                ButtonCancel = null;
            }

            if (ButtonSend != null)
            {
                ButtonSend.Dispose();
                ButtonSend = null;
            }

            if (Details != null)
            {
                Details.Dispose();
                Details = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }
        }
コード例 #2
0
        /// <summary>
        /// Proccess input information returned in Event in onGUI
        /// Useful for building Input mapper editor in "Edit mode"
        /// </summary>
        /// <param name="e">Event dispatched inside onGUI.</param>
        public static void processGUIEvent(Event e)
        {
            if ((e.isKey && e.keyCode > 0) || e.isMouse)
            {
                _frameCountEditor++;

                if (e.isMouse)
                {
                    _code = (int)Enum.Parse(typeof(KeyCode), "Mouse" + e.button);
                }
                else
                {
                    _code = (int)e.keyCode;
                }

                bool containsKey = _isKeyState.ContainsKey(_code);

                if (!containsKey)
                {
                    _isKeyState [_code] = new ButtonDetails();
                }

                //	Debug.Log ("processGUIEvent "+e.keyCode+" "+(int)e.keyCode);


                //if event is KeyDown and ((if is in keystate tracking should be false (keyup)) or if new not in key state tracking)
                if (e.type == EventType.KeyDown || e.type == EventType.MouseDown)
                {
                    _isKeyState [_code].value = 1f;


                    //         Debug.Log ("DOWN :"+e.type+" "+e.keyCode+" buttonState:"+_isKeyState[(int)e.keyCode].buttonState);
                }
                else if (e.type == EventType.KeyUp || e.type == EventType.MouseUp)
                {
                    _isKeyState [_code].value = 0;

                    //		Debug.Log ("UP :"+e.type+" "+e.keyCode);
                }


                e.Use();
            }
        }
コード例 #3
0
				/// <summary>
				/// Proccess input information returned in Event in onGUI
				/// Useful for building Input mapper editor in "Edit mode"
				/// </summary>
				/// <param name="e">Event dispatched inside onGUI.</param>
				public static void processGUIEvent (Event e)
				{
			
	
			
			
						if ((e.isKey && e.keyCode > 0) || e.isMouse) {
								_frameCountEditor++;
				
								if (e.isMouse)
										_code = (int)Enum.Parse (typeof(KeyCode), "Mouse" + e.button);
								else
										_code = (int)e.keyCode;
				
								bool containsKey = _isKeyState.ContainsKey (_code);
				
								if (!containsKey)
										_isKeyState [_code] = new ButtonDetails ();
				
								//	Debug.Log ("processGUIEvent "+e.keyCode+" "+(int)e.keyCode);
				
				
								//if event is KeyDown and ((if is in keystate tracking should be false (keyup)) or if new not in key state tracking)
								if (e.type == EventType.KeyDown || e.type == EventType.MouseDown) {
					
										_isKeyState [_code].value = 1f;
					
					
										//         Debug.Log ("DOWN :"+e.type+" "+e.keyCode+" buttonState:"+_isKeyState[(int)e.keyCode].buttonState);
					
								} else if (e.type == EventType.KeyUp || e.type == EventType.MouseUp) {
										_isKeyState [_code].value = 0;
					
										//		Debug.Log ("UP :"+e.type+" "+e.keyCode);
					
								}
				
				
								e.Use ();
				
				
						}
			
			
				}