Exemple #1
0
	void OnTap(TapGesture gesture)
	{
		if (IsAutoPlay) return;
		if (isPlaying) return;
		var worldPos = Camera.main.ScreenToWorldPoint(gesture.Position);
		worldPos.z = 0;
		var localPos = transform.InverseTransformPoint(worldPos);
		var logicPos = layout.View2Logic(new Vector2(localPos.x, localPos.y));
		if (logicPos.x < 0 || logicPos.x >= env.Foreground.Width ||
		    logicPos.y < 0 || logicPos.y >= env.Foreground.Height)
		{
			return;
		}

		if (null == selection)
		{
			selection = logicPos;
			view.HighlightCell(selection.x, selection.y, true);
		}
		else if (logicPos != selection)
		{
			view.HighlightCell(selection.x, selection.y, false);
			var tmp = selection;
			selection = null;
			PlayInput(tmp, logicPos);
		}
	}
        void Tap(TapGesture gesture)
        {
            /// Open or close this function
            if (!GlobalManager.FurnitureOperationSwitch)
                return;

            /// Global manager selection set
            GameObject go = gesture.Selection;

            if (!IsNull(GlobalManager.Selection))
                RemoveSihouette(GlobalManager.Selection);

            if (IsSameSelection(go))
            {
                go = null;
            } else
            {
                if (IsFurniture(go))
                {
                    AddSihouette(go);
                } else
                {
                    go = null;
                }
            }

            GlobalManager.Selection = go;
        }
 void OnDoubleTap( TapGesture gesture )
 {
     if( gesture.Selection == doubleTapObject )
     {
         SpawnParticles( doubleTapObject );
         UI.StatusText = "Double-Tapped with finger " + gesture.Fingers[0];
     }
 }
 void OnTap( TapGesture gesture )
 {
     if(LevelManager.manager != null)
     {
         GameObject playerInstance = LevelManager.manager.GetPlayerInstance();
         playerInstance.GetComponent<PlayerScript>().Jump();
     }
 }
 void OnTap( TapGesture gesture )
 {
     if( gesture.Selection == tapObject )
     {
         SpawnParticles( tapObject );
         UI.StatusText = "Tapped with finger " + gesture.Fingers[0];
     }
 }
        void Tap(TapGesture gesture)
        {
            if (!GlobalManager.AddFurnitureFunctionSwitch)
                return;

            var furniture = FurnitureItem.CurrentFurniture;
            if (!furniture)
                return;
            GameObject.Instantiate(furniture, gesture.Hit.point, furniture.transform.rotation);
        }
Exemple #7
0
 void OnTap(TapGesture gesture)
 {
     var middle = Screen.width/2;
     if (gesture.Position.x <= middle)
     {
         beatCollider.SendMessage("OnCheckSound", SoundType.Snare);
     }
     else
     {
         beatCollider.SendMessage("OnCheckSound", SoundType.Kick);
     }
 }
	void OnTap( TapGesture gesture )
	{
		GameObject selection = gesture.StartSelection;  
		if (selection == null )
			return;

		Debug.Log("on Tap select " + selection.name);
		SenseGuesture sense = selection.GetComponent<SenseGuesture>();
		if ( sense != null )
			sense.DealTap( gesture );
		
	}
Exemple #9
0
    void OnTap( TapGesture gesture )
    {
        Ray ray = Camera.main.ScreenPointToRay( gesture.Position );
        RaycastHit hit;

        if( Physics.Raycast( ray, out hit ) )
        {
            if( dragView )
                dragView.LookAt( hit.point );
            else
                transform.LookAt( hit.point );
        }
    }
	void Onlvl1( TapGesture gesture ) 
	{
		if( gesture.Selection )
			Debug.Log( "Tapped object: " + gesture.Selection.name );
		AutoFade.LoadLevel(2 ,3,1,Color.black);
		//	    Application.LoadLevel (1);
		
		//		else
		//			Debug.Log( "No object was tapped at " + gesture.Position );
		//	}
		//	Debug.Log( "Tap gesture detected at " + gesture.Position + 
		//		           ". It was sent by " + gesture.Recognizer.name );
		
	}
	void OnTap (TapGesture gesture) {
		if (uiFence.activeSelf) {
			return;
		}
		if (gesture.Selection) {
			Debug.Log ("Tapped object: " + gesture.Selection.tag);
			string tag = gesture.Selection.tag;
			if (tag == "Player") {
				PlayerTapped ();
			} else if (tag == "Gal" || tag == "Kyaba") {
				GalTapped (gesture);
			}
		} else {
			Debug.Log ("No object was tapped at " + gesture.Position);
		}
	}
 void OnTap(TapGesture gesture)
 {
     if (gesture.Selection) // tapped an object
     {
         if (gesture.Selection.tag != "Button")
         {
             Vector2 offset = new Vector2(380, 195);
             Vector2 newGesturePosition = gesture.Position - offset;
             timothy.SendMessage("TimothyShoot", newGesturePosition, SendMessageOptions.DontRequireReceiver);
         }
     }
     else
     {
         // timothy.SendMessage("TimothyShoot", SendMessageOptions.DontRequireReceiver);
     }
 }
//	void OnFingerDown(FingerDownEvent e)
	void OnTap( TapGesture gesture ) 
	{
		if( gesture.Selection)
			Debug.Log( "Tapped object: " + gesture.Selection.name );
		  //  dooranim.Play ("DoorOpenYellow");
		      dooranim.CrossFade("DoorOpenYellow", 0.9F);
		Object.Destroy(this, 0.9f);
		     // tapped = true;
		   // this.transform.Translate(Vector2.up * Time.deltaTime, Space.World);
		//    dooranim.CrossFade("DoorOpenYellow", 1.0);
				    
	//	WaitForSeconds (3);

		//	    dooranim.SetBool("open",true);
//		else
//			Debug.Log( "No object was tapped at " + gesture.Position );
//	}
	//	Debug.Log( "Tap gesture detected at " + gesture.Position + 
//		           ". It was sent by " + gesture.Recognizer.name );

}
Exemple #14
0
    void OnTap(TapGesture gesture)
    {
        if (gesture.Selection == this.gameObject)
        {
            if (CanSwitch())
            {
                //可点击的次数
                if (_clickTimesLimit != 0)
                {
                    _switchCount++;
                }

                _state = State.ON;

                _anim.SetTrigger("push");

                if (SwitchOnEvent != null)
                {
                    SwitchOnEvent();
                }
            }
        }
    }
Exemple #15
0
 void OnDoubleTap(TapGesture gesture)
 {
     if (gesture.Selection == this.gameObject)
     {
         if (_state == State.NORMAL)
         {
             ChangeState("fat");
         }
         else if (_state == State.FAT)
         {
             ChangeState("normal");
         }
     }
 }
	void OnTap(TapGesture gesture)
	{
		if(OnTapGesture != null)
			OnTapGesture(gesture);
	}
Exemple #17
0
	private void OnTap(TapGesture gesture)
	{
		if (null == layout) return;
		var worldPos = Camera.main.ScreenToWorldPoint(gesture.Position);
		worldPos.z = 0;
		var localPos = transform.InverseTransformPoint(worldPos);
		var logicPos = layout.View2Logic(new Vector2(localPos.x, localPos.y));
		if (logicPos.x < 0 || logicPos.x >= logicWidth) return;
		if (logicPos.y < 0 || logicPos.y >= logicHeight) return;
		
		OnSelection(logicPos.x, logicPos.y);
	}
Exemple #18
0
 void OnTap(TapGesture gesture)
 {
     Debug.Log("Tap gesture detected at" + gesture.Position + ".It was sent by" + gesture.Recognizer.name);
 }
Exemple #19
0
 public CUITapGesture(TapGesture gesture) : base(() => gesture.Invoke())
 {
     gesture.NativeGesture = this;
 }
	private void OnDoubleTap(TapGesture gesture)
	{
		if(isPaused)
			Popup.ShowYesNo(Localization.Get("QUIT_GAME"), QuitGame, null, true);
	}
 // Discrete Gestures
 public void OnTap(TapGesture tap)
 {
     if (tap.State == GestureRecognitionState.Recognized) {
         _updates.Add(new InputMessage(
             InputMessage.InputTypes.OneFingerTap,
             InputMessage.MessageTypes.Transient,
             tap.Fingers.Select(f => f.Position).ToList(),
             tap.Fingers.Select(f => f.DeltaPosition).ToList()
         ));
     }
 }
Exemple #22
0
    void OnTap(TapGesture gesture)
    {
        if(controller != TouchControllerType.JOYPAD)
            return;

        if(gesture.Selection == bt_spike)
        {
            Vector3 paddlePos = joystick_bar.transform.localPosition;

            if(player1.pMotion == MotionType.WALK && player1.can_swipe) // sliding
            {
                Debug.Log("sliding!");
                if(paddlePos.x < -15)
                {
                    gameManager.P1Sliding(false);
                }
                else if(paddlePos.x > 15)
                {
                    gameManager.P1Sliding(true);
                }
            }
            else if(player1.pMotion == MotionType.JUMP) // spiking
            {
                float angle = GetAngleFromZeroPoint(paddlePos);//Vector2.Angle(Vector2.zero, new Vector2(paddlePos.x, paddlePos.y));
                Debug.Log(angle);
                if(angle >= 35 && angle < 145 && paddlePos.y >= 15) // upper spike
                {
                    gameManager.P1Spiking(SpikeType.HIGH, false);
                    Debug.Log("HHHHHHHHHHHHHHHHH " + angle);
                }
                else if((angle < 35 && angle >= 0) || (angle < 0 && angle >= -35) || (angle >=145 && angle <= 180) ||(angle >= -180 && angle < -145)) // middle spike
                {
                    gameManager.P1Spiking(SpikeType.MID, false);
                    Debug.Log("MMMMMMMMMMMMMMMMM" + angle);
                }
                else if(angle >= -145 && angle < -35 && paddlePos.y <= -10) // lower spike
                {
                    gameManager.P1Spiking(SpikeType.LOW, false);
                    Debug.Log("LLLLLLLLLLLLLLLLL" + angle);
                }
            }
        }
    }
Exemple #23
0
 private void OnEnable()
 {
     tapGesture         = GetComponent <TapGesture>();
     tapGesture.Tapped += TapGesture_Tapped;
 }
Exemple #24
0
 // Use this for initialization
 void Start()
 {
     tg        = this.GetComponent <TapGesture>();
     standard  = this.GetComponent <Renderer>().material.color;
     currColor = "standard";
 }
Exemple #25
0
	public virtual void DealTap( TapGesture guesture )
	{
	}
Exemple #26
0
 void OnTap(TapGesture gesture)
 {
     Application.LoadLevel("IntroScreen");
 }
Exemple #27
0
	void OnDoubleTapBack( TapGesture g )
	{
		WindAdv wind = LogicManager.LevelManager.GetWind();
		wind.UISwitch();
	}
Exemple #28
0
	void OnTap(TapGesture gesture) { 
		if (Game.status == 1) {
			mSquares.GetComponent<SquaresController> ().SmashIn ();
		}
	}
 //Gesture used to reset transform
 void OnDoubleTapReset(TapGesture gesture)
 {
     ResetTransform();
 }
Exemple #30
0
 protected override void onTapRunning(TapGesture gesture)
 {
 }
Exemple #31
0
 public virtual void DealTap(TapGesture guesture)
 {
 }
Exemple #32
0
 /// <summary>
 /// Called whenever a tap gesture is detected on this control.<br />
 /// This should be overridden by deriving classes when tap detection is enabled.<br />
 /// There is no default behavior with a tap.<br />
 /// Tap detection should be enabled via EnableGestureDetection().<br />
 /// </summary>
 /// <param name="tap">The tap gesture.</param>
 /// <since_tizen> 3 </since_tizen>
 public virtual void OnTap(TapGesture tap)
 {
 }
	public override void DealTap (TapGesture guesture)
	{
		parent.DealTap(guesture);
	}
Exemple #34
0
 protected override void OnEnable()
 {
     base.OnEnable();
     gesture         = GetComponent <TapGesture>();
     gesture.Tapped += pressedHandler;
 }
Exemple #35
0
 void OnTap(TapGesture gesture)
 {
 }
	/// <summary>
	/// Raises the tap gesture event. This event is raised by FingerGestures's TapRecognizer component.
	/// </summary>
	/// <param name='eventData'>
	/// Event data.
	/// </param>
	public void OnTapGesture(TapGesture eventData) {
		if (dragLock > 0) {
			tapSelectedTile = null;
		}
		
		// Process tap gesture only if the start selection is a board tile.
		if (eventData.StartSelection != null && eventData.StartSelection.layer == Match3Globals.Instance.layerBoardTile) 
		{
			// Check if there is no previously selected tile.
			if (tapSelectedTile == null) 
			{
//				Debug.Log("TapGesture selection started: " + eventData.StartSelection);
				tapSelectedTile = eventData.StartSelection.GetComponent<AbstractTile>();
//				Debug.Log("Tile tapped: " + tapSelectedTile);
				tapSelectedTile.RaiseEventTileTap();
			} 
			else 
			{
//				Debug.Log("TapGesture selected ended: " + eventData.StartSelection);
				AbstractTile newSelectedTile = eventData.StartSelection.GetComponent<AbstractTile>();
				
				// Tell the Match3BoardGameLogic to try and switch the first selected tile with this new selected tile.
				if ((InputFilter == null || InputFilter(tapSelectedTile, newSelectedTile, TileMoveDirection.Count)) && boardGameLogic.TryToMoveTile(tapSelectedTile, newSelectedTile) == false) 
				{
					// If the tiles couldn't be switched then make the new selected tile as the first selected tile.
					tapSelectedTile = newSelectedTile;
					newSelectedTile.RaiseEventTileTap();
				} 
				else 
				{
					// If the tiles were succesfully switched (not necessarilly matched) then reset the first selected tile.
					tapSelectedTile = null;
					//boardGameLogic.loseConditions.NewMove();
				}
			}
		}
	}
	private void GalTapped (TapGesture gesture) {
		Debug.Log ("gal tapped");
		playerController.Atack (gesture.Selection.transform);
	}