Esempio n. 1
0
	public override void OnNotify( NOTIFY_MSG msg )
	{
	}
Esempio n. 2
0
	public abstract void OnNotify( NOTIFY_MSG msg);
Esempio n. 3
0
	private void SendMessageEx( NOTIFY_MSG msg)
	{
		if( null == receiver)
			return;

		receiver.SendMessage( "OnNotify", msg);
	}
Esempio n. 4
0
	// Update is called once per frame
	void Update()
	{
		TouchPhase phase = TouchPhase.Canceled;

		if( 0 < Input.touchCount)
			phase = Input.GetTouch( 0 ).phase;

		switch( phase )
		{
		case TouchPhase.Began:
			{
				if( false == AsUtil.PtInCollider( uiCamera, collider, Input.GetTouch( 0 ).position ) )
					return;

				SetPress();
				isClicked = true;
			}
			break;
		case TouchPhase.Moved:
			{
				if( false == AsUtil.PtInCollider( uiCamera, collider, Input.GetTouch( 0 ).position ) )
				{
					SetNormal();
				}
				else
				{
					if( true == isClicked )
						SetPress();
				}
			}
			break;
		case TouchPhase.Ended:
			{
				if( ( true == isClicked ) && ( true == AsUtil.PtInCollider( uiCamera, collider, Input.GetTouch( 0 ).position ) ) )
				{
					SetNormal();

					if( true == fade )
					{
						Color currentColor = renderer.sharedMaterial.GetColor( "_Color" );
						if( 1.0f != currentColor.a )
							return;
					}

					float curClickedTime = Time.time;
					if( 0.4f > ( curClickedTime - prevClickedTime ) )
					{
						NOTIFY_MSG msg = new NOTIFY_MSG();
						msg.id = this.id;
						msg.type = NOTIFY_MSG_TYPE.BM_DBL_CLICKED;
						SendMessageEx( msg );
					}
					else
					{
						NOTIFY_MSG msg = new NOTIFY_MSG();
						msg.id = this.id;
						msg.type = NOTIFY_MSG_TYPE.BM_CLICKED;
						SendMessageEx( msg );
					}

					prevClickedTime = curClickedTime;
				}

				isClicked = false;
			}
			break;
		}
	}
Esempio n. 5
0
	void OnMouseUpAsButton()
	{
		SetNormal();

		isClicked = false;

		if( true == fade)
		{
			Color currentColor = renderer.sharedMaterial.GetColor( "_Color" );
			if( 1.0f != currentColor.a )
				return;
		}

		float curClickedTime = Time.time;
		if( 0.4f > ( curClickedTime - prevClickedTime))
		{
			NOTIFY_MSG msg = new NOTIFY_MSG();
			msg.id = this.id;
			msg.type = NOTIFY_MSG_TYPE.BM_DBL_CLICKED;
			SendMessageEx( msg );
		}
		else
		{
			NOTIFY_MSG msg = new NOTIFY_MSG();
			msg.id = this.id;
			msg.type = NOTIFY_MSG_TYPE.BM_CLICKED;
			SendMessageEx( msg );
		}

		prevClickedTime = curClickedTime;
	}