示例#1
0
 //-------------------------------------------------------------------------
 void OnFingerDown(FingerDownEvent e)
 {
     if (onFingerDown != null)
     {
         onFingerDown(e.Position);
     }
 }
示例#2
0
 //---------------------------------------------------------------------
 void OnFingerDown(FingerDownEvent e)
 {
     if (onFingerDown != null)
     {
         onFingerDown(e.Position);
     }
 }
示例#3
0
 //如果这个回调名字写成OnFingerDown,点一下就会触发两次,一次是delegate触发,一次是SendMessage触发
 void FingerDownEventHandler(FingerDownEvent e)
 {
     if (fingerDownMethods != null)
     {
         fingerDownMethods(e.Position, e.Selection);
     }
 }
示例#4
0
 void OnFingerDown(FingerDownEvent e)
 {
     if (isClickable && MemoryGameManager.Instance.IsGameActive)
     {
         gameObject.transform.localScale = new Vector3(pressDownScale, pressDownScale, 1f);
     }
 }
示例#5
0
 void OnFingerDown(FingerDownEvent e)
 {
     if (e.Selection != null)
     {
         Debug.Log(e.Selection.name);
     }
 }
示例#6
0
        //--------------------------------------------------------------------------
        // Finger Gesture handlers
        //--------------------------------------------------------------------------

        // Continous Gestures

        public void OnFingerDown(FingerDownEvent e)
        {
            _updates.Add(new InputMessage(
                             InputMessage.InputTypes.FingerDown,
                             InputMessage.MessageTypes.Transient,
                             e.Position
                             ));
        }
 void OnFingerDown(FingerDownEvent e)
 {
     if (currentFinger == null)
     {
         currentFinger = e.Finger;
         GoToTouchTarget(e.Position, 1f);
     }
 }
示例#8
0
    void OnFingerDown(FingerDownEvent e)
    {
        trail.time = 100;
        startTime = Time.time;

        startPos = e.Finger.Position;
        transform.position = Camera.main.ScreenToWorldPoint(new Vector3(e.Finger.Position.x, e.Finger.Position.y, 1));
    }
示例#9
0
    void OnFingerDown(FingerDownEvent e)
    {
        Levanto = false;
        PathRenderer path = paths[e.Finger.Index];

        path.Reset();

        // path.AddPoint( e.Finger.Position, fingerDownMarkerPrefab );
    }
示例#10
0
 public override void DealOnFingerDown(FingerDownEvent e)
 {
     if (followWind != null)
     {
         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);
     }
 }
	public override void DealOnFingerDown (FingerDownEvent e)
	{
		if ( followWind != null )
		{
			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 );
		}
	}
示例#12
0
	void OnFingerDown(FingerDownEvent e)
	{
		if(!GameController.isGameRunning && !wallTop.enabled)
		{
			OpenPanel();

			if(OnPanelOpening != null)
				OnPanelOpening();
		}
	}
 void OnFingerDown(FingerDownEvent e)
 {
     //Debug.LogError("OnFingerDown");
     if (!isCameraMoving && isFingerUp)
     {
         isFingerUp = false;
         DebugFile.GetInstance().WriteKeyFile("OnFingerDown", "OnFingerDown");
         MessageManager.GetInstance().Send(
             (int)GameMessageDefine.CrossRoadAnimalTeamMove);
     }
 }
示例#14
0
 void OnFingerDown(FingerDownEvent e)
 {
     if (m_onFingerDownFunc != null)
     {
         m_onFingerDownFunc.BeginPCall();
         m_onFingerDownFunc.Push(self);
         m_onFingerDownFunc.Push(e);
         m_onFingerDownFunc.PCall();
         m_onFingerDownFunc.EndPCall();
     }
 }
        private void OnSceneDown(FingerDownEvent downEvent)
        {
            if (!EnableGesture)
            {
                return;
            }

            //Debug.LogErrorFormat ("{0}->OnSceneDown: pos: {1}, finger: {2}", GetType ().Name, downEvent.Position, downEvent.Finger.Index);

            m_DownSingal.Dispatch(downEvent);
        }
	void OnFingerDown(FingerDownEvent e)
	{
		if(e.Finger.Index != 0) return;

		fingerDown = true;

		position = e.Position;

		if (OnFingerDownEvent != null)
			OnFingerDownEvent (e);
	}
示例#17
0
	void OnFingerDown( FingerDownEvent e )
	{
		GameObject selection = e.Selection;  
		if (selection == null )
			return;

		SenseGuesture sense = selection.GetComponent<SenseGuesture>();
		if ( sense != null )
			sense.DealOnFingerDown( e );

	}
示例#18
0
    void OnFingerDown(FingerDownEvent e)
    {
        m_fingureDown        = true;
        m_fingerDownPosition = e.Position;

        if (m_player != null)
        {
            m_playerPosition = m_player.GetPlayerPosition();
            m_player.StartMove();
        }
    }
示例#19
0
 //按下事件
 void OnFingerDown(FingerDownEvent e)
 {
     //如果选取目标对象为本物体
     if (e.Selection == gameObject)
     {
         //设置控制器中选定的物体为本物体
         game_controller.selection = gameObject;
         //手指不松开不检测碰撞
         game_controller.isMotionEnd = false;
         //让正选中的物体移到别的上面,就能不受阻碍
         gameObject.transform.position = GetWorldPos(e.Position) + new Vector3(0, 0, -1);
     }
 }
示例#20
0
    void OnFingerDown(FingerDownEvent e)
    {
        touch.Add(new TouchMsg(e.Position, 0));

        LineRendererTest.instance.SetAct(e.Position);
        // print(touch.Count);
        // myRemove(0,touch);
        // touch.RemoveAt(0);
        //touchPosition.Add((Vector2)e.Position);
        //UIobjs.Add(MyInstiateUIObj(e.Position));
        //// print(touchPosition.Count);
        //length = 0;
    }
示例#21
0
    void OnFingerDown(FingerDownEvent gesture)
    {
        if (!enabled)
        {
            return;
        }

        if (!currentSelected && gesture.Raycast.Hits2D != null)
        {
            currentSelected            = gesture.Raycast.Hit2D.transform.gameObject;
            offsetPositionOverFinger.y = Mathf.Round((gesture.Raycast.Hit2D.collider.bounds.size.y - 0.15f) * 15) * .10f;
            //currentSelected.transform.DOMove(overFingerPosition,.1f).SetId("Input_SelectedPosition");
        }
    }
示例#22
0
    void OnFingerDown(FingerDownEvent e)
    {
        m_enableMove   = true;
        m_downPosition = e.Position;
        if (m_entity != null)
        {
            m_recordDownPosition = m_entity.transform.position;
            m_recordPosition     = m_entity.transform.position;
        }

        if (SwitchState != null)
        {
            SwitchState(EEntityState.Prepare, Vector3.zero);
        }
    }
示例#23
0
    void OnFingerDown(FingerDownEvent e)
    {
        GameObject selection = e.Selection;

        if (selection == null)
        {
            return;
        }

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

        if (sense != null)
        {
            sense.DealOnFingerDown(e);
        }
    }
示例#24
0
    void OnFingerDown(FingerDownEvent gesture)
    {
        if (!enabled)
        {
            return;
        }

        if (currentSelected == false && allowInput && gesture.Raycast.Hits2D != null)
        {
            currentSelected            = gesture.Raycast.Hit2D.transform.gameObject;
            offsetPositionOverFinger.y = Mathf.Round((gesture.Raycast.Hit2D.collider.bounds.size.y - 0.15f) * 15) * .10f;

            /*selectedInitialPosition = currentSelected.transform.position;
             * selectedInitialScale = currentSelected.transform.localScale;*/
        }
    }
示例#25
0
    void OnFingerDownBack(FingerDownEvent e)
    {
        GameObject selection = e.Selection;

        if (e.Finger.Phase == FingerGestures.FingerPhase.Begin)
        {
            if (enabled && m_state == CameraState.Free)
            {
                CreatInk(e.Position, e.Finger);
            }
            else
            {
                EventManager.Instance.PostEvent(EventDefine.UnableToMove);
            }
        }
    }
示例#26
0
	void OnFingerDown(FingerDownEvent e) {
		Ray ray1 = UICamera.GetComponent<Camera> ().ScreenPointToRay (e.Position);
		RaycastHit hit1;
		if(Physics.Raycast(ray1, out hit1)){
			if(hit1.transform.gameObject.CompareTag("UI")){
			}else{
				if (e.Position.x > 0 && e.Position.y < -e.Position.x + Screen.height && e.Position.y > e.Position.x) {
					//左屏幕
					if(!fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveLeft[0] = 1;
						fingerList.Add(e.Finger,GameController.GetInstance().moveLeft);
					}else if(fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveLeft[0] = 1;
						fingerList[e.Finger] = GameController.GetInstance().moveLeft;
					}
				}else if(e.Position.y > Screen.width - e.Position.x && e.Position.x < Screen.width && e.Position.y < e.Position.x + Screen.height - Screen.width){
					//右屏幕
					if(!fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveRight[0] = 1;
						fingerList.Add(e.Finger,GameController.GetInstance().moveRight);
					}else if(fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveRight[0] = 1;
						fingerList[e.Finger] = GameController.GetInstance().moveRight;
					}
				}else if(e.Position.y > Screen.height - e.Position.x && e.Position.y > Screen.height/2 && e.Position.y > e.Position.x + Screen.height - Screen.width && e.Position.y < Screen.height){
					//上屏幕
					if(!fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveUp[0] = 1;
						fingerList.Add(e.Finger,GameController.GetInstance().moveUp);
					}else if(fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveUp[0] = 1;
						fingerList[e.Finger] = GameController.GetInstance().moveUp;
					}
				}else if(e.Position.y > 0 && e.Position.y < e.Position.x && e.Position.y < Screen.height/2 && e.Position.y < Screen.width - e.Position.x){
					//下屏幕
					if(!fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveDown[0] = 1;
						fingerList.Add(e.Finger,GameController.GetInstance().moveDown);
					}else if(fingerList.ContainsKey(e.Finger)){
						GameController.GetInstance().moveDown[0] = 1;
						fingerList[e.Finger] = GameController.GetInstance().moveDown;
					}
				}
			}
		}

	}
示例#27
0
    //Letters on Word
    void OnFingerDown(FingerDownEvent gesture)
    {
        if (!enabled)
        {
            return;
        }

        if (allowInput && gesture.Raycast.Hit2D)
        {
            letter        = gesture.Raycast.Hit2D.transform.gameObject;
            firstPosition = letter.transform.position;

            if (objectSize.x == 0 && gesture.Raycast.GameObject.GetComponent <BoxCollider2D>())
            {
                objectSize = gesture.Raycast.GameObject.GetComponent <BoxCollider2D> ().bounds.size;
            }
        }
    }
示例#28
0
    private void OnFingerEvent(FingerEvent args)
    {
        FingerMotionEvent motionEventArgs = args as FingerMotionEvent;

        if (null != motionEventArgs)
        {
            // ui collider clicked
            if (UICamera.hoveredObject == m_HeroCollider)
            {
                // only rotate on finger down
                if (motionEventArgs.Phase == FingerMotionPhase.Updated)
                {
                    // rotate left or right
                    if (motionEventArgs.Position.x - m_LastFingerPos.x > 0.5)
                    {
                        OnHeroRotate(m_CurHeroId, -1);
                    }
                    else if (motionEventArgs.Position.x - m_LastFingerPos.x < -0.5)
                    {
                        OnHeroRotate(m_CurHeroId, 1);
                    }
                    else
                    {
                    }
                }
                m_LastFingerPos = motionEventArgs.Position;
            }
            return;
        }

        FingerDownEvent downEventArgs = args as FingerDownEvent;

        if (downEventArgs != null)
        {
            if (UICamera.hoveredObject == m_HeroCollider)
            {
                return;
            }
            return;
        }
    }
    void OnFingerDown(FingerDownEvent e)
    {
        if (e.Selection == this.gameObject)
        {
            if (!this.menuShowing && this.Building.FactionType == this.gameSceneController.MyFactionType)
            {
                this.menuShowing = true;
                if (this.buildingMenu == null)
                {
                    this.buildingMenu                         = (GameObject)Instantiate(Resources.Load("UI/BuildingMenu"));
                    this.buildingMenu.name                    = "BuildingMenu";
                    this.buildingMenu.transform.parent        = GameObject.Find("PanelRoot").transform;
                    this.buildingMenu.transform.localScale    = new Vector3(1, 1, 1);
                    this.buildingMenu.transform.localPosition = this.WorldPosToNGUIPos(e.Finger.Position);

                    if (this.Building.MaxLevel == BuildingLevel.BuildingLevel1)
                    {
                        UIImageButton upgradeButton = this.buildingMenu.transform.FindChild("UpgradeButton").gameObject.GetComponent <UIImageButton>();
                        upgradeButton.isEnabled = false;
                    }

                    UIEventListener.Get(this.buildingMenu.transform.FindChild("RepairButton").gameObject).onClick =
                        HandleBuildingMenuEvent;
                    UIEventListener.Get(this.buildingMenu.transform.FindChild("UpgradeButton").gameObject).onClick =
                        HandleBuildingMenuEvent;
                    UIEventListener.Get(this.buildingMenu.transform.FindChild("SaleButton").gameObject).onClick =
                        HandleBuildingMenuEvent;
                }
                this.buildingMenu.SetActive(true);
            }
        }
        else
        {
            if (this.buildingMenu != null)
            {
                this.buildingMenu.SetActive(false);
                this.menuShowing = false;
            }
        }
    }
示例#30
0
    static int _CreateFingerDownEvent(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                FingerDownEvent obj = new FingerDownEvent();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FingerDownEvent.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 void OnFingerDown(FingerDownEvent e)
 {
     if (e.Selection == this.gameObject)
     {
         GameObject[] furnitures = GameObject.FindGameObjectsWithTag("Furniture");
         for (int i = 0; i < furnitures.Length; i++)
         {
             if (furnitures[i].transform.name.Contains("wall") || furnitures[i].transform.name.Contains("Wall") || furnitures[i].transform.name.Contains("Floor") || furnitures[i].transform.name.Contains("floor") || furnitures[i].transform.name.Contains("ciling") || furnitures[i].transform.name.Contains("Ceiling"))
             {
                 Debug.Log(furnitures[i].transform.name);
             }
             else if (furnitures[i].GetComponent <Renderer>())
             {
                 furnitures[i].GetComponent <Renderer>().enabled = false;
             }
             else
             {
                 furnitures[i].GetComponentInChildren <Renderer>().enabled = false;
             }
         }
     }
 }
示例#32
0
    public void OnFingerDown(FingerDownEvent e)
    {
        {
            if (FingerPointData == null)
            {
                FingerPointData = new PointerEventData(eventSystem);
            }

            List <RaycastResult> rayCastResults = new List <RaycastResult>();
            FingerPointData.Reset();
            FingerPointData.position = e.Position;
            eventSystem.RaycastAll(FingerPointData, rayCastResults);
            FingerPointData.pointerCurrentRaycast = FindFirstRaycast(rayCastResults);
            m_fingerTargetObject = FingerPointData.pointerCurrentRaycast.gameObject;
            rayCastResults.Clear();

            Vector3 camPos = Camera.main.transform.position;
            Debug.DrawLine(camPos, camPos + Camera.main.ScreenPointToRay(e.Position).direction * 100f);

            // specified for the 2D/3D switch button
            ExecuteEvents.Execute(m_fingerTargetObject, new PointerEventData(eventSystem), ExecuteEvents.pointerClickHandler);
        }
    }
示例#33
0
//	public virtual void OnFingerMove( Vector2 delta ){}

    void OnFingerDown(FingerDownEvent e)
    {
        Select();
    }
	private void OnFingerDown(FingerDownEvent e)
	{
		//Popup.Hide ();
		//Time.timeScale = 1f;
	}
 void OnFingerDown( FingerDownEvent e )
 {
     UI.StatusText = string.Empty;
 }
示例#36
0
 void OnDetectFingerDown(FingerDownEvent e)
 {
     inputActive = true;
     inputOrigin = GetScreenPosition(e.Position);
     inputPosition = inputOrigin;
 }
	void OnFingerDown(FingerDownEvent e)
	{
		if(Popup.IsActive || !isGameRunning)return;

		if(!isPaused || (isPaused && e.Selection != null && e.Selection.layer == LayerMask.NameToLayer("Tap&Hold")))
			ResumeGame();
	}
示例#38
0
 private void OnDown(FingerDownEvent eventData)
 {
 }
 void OnFingerDown( FingerDownEvent e )
 {
     PathRenderer path = paths[e.Finger.Index];
     path.Reset();
     path.AddPoint( e.Finger.Position, fingerDownMarkerPrefab );
 }
示例#40
0
	public virtual void DealOnFingerDown( FingerDownEvent e )
	{
	}
示例#41
0
 void OnFingerDown( FingerDownEvent e )
 {
     if( e.Selection == fingerDownObject )
         SpawnParticles( fingerDownObject );
 }
 //--------------------------------------------------------------------------
 // Finger Gesture handlers
 //--------------------------------------------------------------------------
 // Continous Gestures
 public void OnFingerDown(FingerDownEvent e)
 {
     _updates.Add(new InputMessage(
         InputMessage.InputTypes.FingerDown,
         InputMessage.MessageTypes.Transient,
         e.Position
     ));
 }
示例#43
0
	void OnFingerDownBack( FingerDownEvent e )
	{
		GameObject selection = e.Selection;
		if ( e.Finger.Phase == FingerGestures.FingerPhase.Begin )
		{
			if ( enabled && m_state == CameraState.Free )
				CreatInk( e.Position , e.Finger );
			else 
				EventManager.Instance.PostEvent( EventDefine.UnableToMove );
		}

	}
示例#44
0
 void OnFingerDown(FingerDownEvent e)
 {
 }
示例#45
0
 void OnFingerDown( FingerDownEvent e )
 {
     timothy.SendMessage ("TimothyBrake", SendMessageOptions.DontRequireReceiver);
 }
示例#46
0
	/// <summary>
	/// 按下时调用 
	/// </summary>
	/// <param name="gesture"></param>
    void OnFingerDown(FingerDownEvent gesture)
	{
		fingerNumber = gesture.Finger.Index;
		downPosition = gesture.Finger.StartPosition;
		
		///< 判断是否是键盘区域,键盘区域不能垒方块
        if (false == SunmRMKeyControl.outsideButtonRec(gesture.Position.x, Screen.height - gesture.Position.y)
         || true == SunmRMKeyControl.insideButtonFunctionRec(gesture.Position))
        {
            bISAddCube = false;
        }
	}
示例#47
0
    /// <summary>
    /// 按下时调用 
    /// </summary>
    /// <param name="gesture"></param>
    void OnFingerDown(FingerDownEvent gesture)
    {
        fingerNumber = gesture.Finger.Index;
        //Debug.Log("鼠标按下的点:"+gesture.Finger.StartPosition);
        downPosition = gesture.Finger.StartPosition;
        startPoint3 = map2Sphere(downPosition);
		
		///< 判断是否是键盘区域,键盘区域不能垒方块
        if (false == SunmRTKeyControl.outsideButtonRec(gesture.Position.x, Screen.height - gesture.Position.y)
            || true == SunmRTKeyControl.insideButtonFunctionRec(gesture.Position)) 
        {
            bISAddCube = false;
        }
        
    }
示例#48
0
 void OnFingerDown(FingerDownEvent e)
 {
     UI.StatusText = string.Empty;
 }
示例#49
0
 private void OnSceneFingerDown(FingerDownEvent fingerDownEvent)
 {
     OnFingerEvent(CocoGestureType.FingerDown, fingerDownEvent);
 }