void OnFingerHover( FingerHoverEvent e )
 {
     if( e.Phase == FingerHoverPhase.Enter )
         GetComponent<Renderer>().sharedMaterial = hoverMaterial; // show hover-state material
     else
         GetComponent<Renderer>().sharedMaterial = normalMaterial; // restore original material
 }
Example #2
0
    void FingerHoverEventHandler(FingerHoverEvent e)
    {
//		Debug.Log("hover event handler()");
        if (fingerHoverMethods != null)
        {
            fingerHoverMethods(e.Position, e.Selection, HoverPhaseConvertor(e.Phase));
        }
    }
	void OnFingerHover(FingerHoverEvent e)
	{
		//if(GameController.isGameRunning || MenuController.activeMenu != MenuController.Menus.Main || Popup.IsActive || DailyRewardController.IsActive) return;

		if(!(MenuController.IsMenuActive && MenuController.activeMenu == MenuController.Menus.Main) || Popup.IsActive || DailyRewardController.IsActive) return;

		if(e.Phase == FingerHoverPhase.Enter)
			spinningCoroutine = StartCoroutine(StartSpinning());
	}
 public override void DealOnFingerHover(FingerHoverEvent e)
 {
     if (e.Phase == FingerHoverPhase.Exit)
     {
         Vector2 velocity = e.Finger.DeltaPosition / Time.deltaTime;
         flower.Blow(velocity * Global.Pixel2Unit);
         Debug.Log("Blow " + (velocity * Global.Pixel2Unit));
     }
     UpdateColliderPosition();
 }
Example #5
0
 void OnFingerHover(FingerHoverEvent e)
 {
     if (isClickable && MemoryGameManager.Instance.IsGameActive)
     {
         if (e.Phase == FingerHoverPhase.Exit)
         {
             GameObjectUtils.ResetLocalScale(this.gameObject);
         }
     }
 }
	public override void DealOnFingerHover (FingerHoverEvent e)
	{
		if ( e.Phase == FingerHoverPhase.Exit )
		{
			Vector2 velocity = e.Finger.DeltaPosition / Time.deltaTime; 
			flower.Blow( velocity * Global.Pixel2Unit );
			Debug.Log("Blow " + ( velocity * Global.Pixel2Unit ) );
		}
		UpdateColliderPosition();
	}
Example #7
0
 //增加手势识别
 void OnFingerHover(FingerHoverEvent e)
 {
     if (m_onFingerHoverFunc != null && e.Selection.tag == "Card")
     {
         m_onFingerHoverFunc.BeginPCall();
         m_onFingerHoverFunc.Push(self);
         m_onFingerHoverFunc.Push(e.Selection);
         m_onFingerHoverFunc.PCall();
         m_onFingerHoverFunc.EndPCall();
     }
 }
Example #8
0
 void OnFingerHover(FingerHoverEvent e)
 {
     if (e.Phase == FingerHoverPhase.Enter)
     {
         renderer.sharedMaterial = hoverMaterial; // show hover-state material
     }
     else
     {
         renderer.sharedMaterial = normalMaterial; // restore original material
     }
 }
Example #9
0
	void OnFingerHover( FingerHoverEvent e )
	{
		
		GameObject selection = e.Selection;  
		if (selection == null )
			return;

		SenseGuesture sense = selection.GetComponent<SenseGuesture>();
		if ( sense != null )
			sense.DealOnFingerHover( e );
	}
Example #10
0
    public override void DealOnFingerHover(FingerHoverEvent e)
    {
        if (followWind != null && (Time.time - e.Finger.StarTime) > 0.12f)
        {
            Vector3 touchPosition = Camera.main.ScreenToWorldPoint(e.Position);
//			float angle = Vector3.Dot( Vector3.forward , Vector3.Cross( transform.up , touchPosition - transform.position ) );
//			followWind.AddImpuse( angle * Time.deltaTime * touchIntense  , touchPosition );

            Vector2 velocity = e.Finger.DeltaPosition / Time.deltaTime;
            followWind.AttachVelocity(velocity, touchPosition, touchAttachRate * 0.0001f);
        }
    }
Example #11
0
 void OnFingerHover( FingerHoverEvent e )
 {
     if( e.Phase == FingerHoverPhase.Enter )
     {
         // apply scale modifier
         transform.localScale = hoverScaleFactor * originalScale;
     }
     else
     {
         // restore original scale
         transform.localScale = originalScale;
     }
 }
Example #12
0
 void OnFingerHover(FingerHoverEvent e)
 {
     // check the hover event phase to check if we're entering or exiting the object
     if (e.Phase == FingerHoverPhase.Exit)
     {
         if (!doneWithShake)
         {
             //Cancel shaker if finger moves out of the Rescue game object
             transform.position = startDragPos;
             elapsed            = 0;
         }
     }
 }
 void OnFingerHover(FingerHoverEvent e)
 {
     if (e.Phase == FingerHoverPhase.Enter)
     {
         // apply scale modifier
         transform.localScale = hoverScaleFactor * originalScale;
     }
     else
     {
         // restore original scale
         transform.localScale = originalScale;
     }
 }
	public override void DealOnFingerHover (FingerHoverEvent e)
	{
		
		if ( followWind != null && ( Time.time - e.Finger.StarTime ) > 0.12f )
		{
			Vector3 touchPosition = Camera.main.ScreenToWorldPoint( e.Position );
//			float angle = Vector3.Dot( Vector3.forward , Vector3.Cross( transform.up , touchPosition - transform.position ) );
//			followWind.AddImpuse( angle * Time.deltaTime * touchIntense  , touchPosition );

			Vector2 velocity = e.Finger.DeltaPosition / Time.deltaTime;
			followWind.AttachVelocity( velocity , touchPosition , touchAttachRate * 0.0001f );
		}
	}
Example #15
0
 void OnFingerHoverBack(FingerHoverEvent e)
 {
     if (inkDict.ContainsKey(e.Finger.Index) && inkDict[e.Finger.Index] != null)
     {
         if (e.Finger.DistanceFromStart < inkDict[e.Finger.Index].affectRange())
         {
             inkDict[e.Finger.Index].Spread(Time.deltaTime);
         }
         else
         {
             inkDict[e.Finger.Index].Fade();
             inkDict[e.Finger.Index] = null;
         }
     }
 }
Example #16
0
    void OnFingerHover(FingerHoverEvent e)
    {
        GameObject selection = e.Selection;

        if (selection == null)
        {
            return;
        }

        SenseGuesture sense = selection.GetComponent <SenseGuesture>();

        if (sense != null)
        {
            sense.DealOnFingerHover(e);
        }
    }
    static int get_Phase(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FingerHoverEvent obj = (FingerHoverEvent)o;
            FingerHoverPhase ret = obj.Phase;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Phase on a nil value" : e.Message));
        }
    }
Example #18
0
    /// <summary>
    /// Raises the finger hover event.
    /// </summary>
    /// <param name="e">E.</param>
    void OnFingerHover(FingerHoverEvent e)
    {
        if (GameData.getInstance().isLock)                         //if game locked,you can not control the game
        {
            return;
        }
        if (e.Selection == bread1)                         //deal with the event while bread1 was touched
        {
            // finger entered the object
            if (e.Phase == FingerHoverPhase.Enter)
            {
                //this level simulate a mutilple touch at same time.When system detect one touch,we start a timer,check whether another touch happenes in 0.1 second.


                StartCoroutine("bread2disappear");
                npick++;                                                //plus picked number
                bread1.SetActive(false);                                //pick up bread1
                if (npick == 2)
                {
                    GameData.getInstance().main.gameWin();                                           //detect 2 bread picked.Win the game
                    StopAllCoroutines();                                                             //stop time check
                }
            }
        }


        if (e.Selection == bread2)                         //deal with the event while bread2 was touched
        {
            // finger entered the object
            if (e.Phase == FingerHoverPhase.Enter)
            {
                //this level simulate a mutilple touch at same time.When system detect one touch,we start a timer,check whether another touch happenes in 0.1 second.
                StartCoroutine("bread1disappear");
                npick++;                                                //plus picked number
                bread2.SetActive(false);                                //pick up bread2

                if (npick == 2)
                {
                    GameData.getInstance().main.gameWin();                                           //detect 2 bread picked.Win the game
                    StopAllCoroutines();                                                             //stop time check
                }
            }
        }
    }
Example #19
0
    void OnFingerHover( FingerHoverEvent e )
    {
        if( e.Selection == fingerHoverObject )
        {
            // finger entered the object
            if( e.Phase == FingerHoverPhase.Enter )
            {
                UI.StatusText = "Finger entered " + fingerHoverObject.name;

                originalHoverMaterial = fingerHoverObject.renderer.sharedMaterial;
                fingerHoverObject.renderer.sharedMaterial = highlightMaterial;
            }
            else if( e.Phase == FingerHoverPhase.Exit ) // finger left the object
            {
                UI.StatusText = "Finger left " + fingerHoverObject.name;
                fingerHoverObject.renderer.sharedMaterial = originalHoverMaterial;
            }
        }
    }
Example #20
0
 /// <summary>
 /// Raises the finger hover event.
 /// </summary>
 /// <param name="e">E.</param>
 void OnFingerHover(FingerHoverEvent e)
 {
     if (GameData.getInstance().isLock)                         //if locked,ignore all customer interactive
     {
         return;
     }
     if (e.Selection == bread)                         //if target is bread
     {
         // finger entered the object
         if (e.Phase == FingerHoverPhase.Enter)                                //start touch
         {
             onTouching = true;                                                //whether touching flag
         }
         else if (e.Phase == FingerHoverPhase.Exit)                            // finger left the object
         {
             onTouching = false;                                               //whether touching flag
         }
     }
 }
    void OnFingerHover(FingerHoverEvent e)
    {
        if (e.Selection == fingerHoverObject)
        {
            // finger entered the object
            if (e.Phase == FingerHoverPhase.Enter)
            {
                UI.StatusText = "Finger entered " + fingerHoverObject.name;

                originalHoverMaterial = fingerHoverObject.renderer.sharedMaterial;
                fingerHoverObject.renderer.sharedMaterial = highlightMaterial;
            }
            else if (e.Phase == FingerHoverPhase.Exit)  // finger left the object
            {
                UI.StatusText = "Finger left " + fingerHoverObject.name;
                fingerHoverObject.renderer.sharedMaterial = originalHoverMaterial;
            }
        }
    }
    static int _CreateFingerHoverEvent(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                FingerHoverEvent obj = new FingerHoverEvent();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FingerHoverEvent.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #23
0
 public virtual void DealOnFingerHover(FingerHoverEvent e)
 {
 }
Example #24
0
	public virtual void DealOnFingerHover( FingerHoverEvent e )
	{
	}
Example #25
0
 void OnFingerHover(FingerHoverEvent e)
 {
 }
Example #26
0
	void OnFingerHoverBack( FingerHoverEvent e )
	{
		if ( inkDict.ContainsKey( e.Finger.Index ) && inkDict[e.Finger.Index] != null)
		{
			if ( e.Finger.DistanceFromStart < inkDict[e.Finger.Index].affectRange() ) {
				inkDict[e.Finger.Index].Spread(Time.deltaTime);
			}
			else {
				inkDict[e.Finger.Index].Fade();
				inkDict[e.Finger.Index] = null;
			}	
		}

	}
	void OnFingerHover (FingerHoverEvent e) {
		// check the hover event phase to check if we're entering or exiting the object
		if (e.Phase == FingerHoverPhase.Enter) {
			touchedObject (e);
		}
	}
	private void touchedObject (FingerHoverEvent e) {
		if (e.Selection.tag == "Gal") {
			Debug.Log ("Gal");
			e.Selection.SendMessage ("StartExitAnimation");
		}
	}