当前位置: 首页>>代码示例>>C#>>正文


C# CustomInput类代码示例

本文整理汇总了C#中CustomInput的典型用法代码示例。如果您正苦于以下问题:C# CustomInput类的具体用法?C# CustomInput怎么用?C# CustomInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CustomInput类属于命名空间,在下文中一共展示了CustomInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RaiseOnNewBoardPieceSelected

	protected void RaiseOnNewBoardPieceSelected(AbstractBoardPiece boardPiece, CustomInput.TouchInfo touchInfo)
	{
		if(OnNewBoardPieceSelected != null)
		{
			OnNewBoardPieceSelected(boardPiece, touchInfo);
		}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:7,代码来源:BoardPieceTouchController.cs

示例2: KeyMapping

 /// <summary>
 /// Create a new instance of <see cref="KeyMapping"/> with 3 specified <see cref="CustomInput"/>.
 /// </summary>
 /// <param name="name">KeyMapping name.</param>
 /// <param name="primaryCustomInput">Primary input.</param>
 /// <param name="secondaryCustomInput">Secondary input.</param>
 /// <param name="thirdCustomInput">Third input.</param>
 public KeyMapping(string name = "", CustomInput primaryCustomInput = null, CustomInput secondaryCustomInput = null, CustomInput thirdCustomInput = null)
 {
     mName          = name;
     primaryInput   = primaryCustomInput;
     secondaryInput = secondaryCustomInput;
     thirdInput     = thirdCustomInput;
 }
开发者ID:HaKDMoDz,项目名称:UnityEditor,代码行数:14,代码来源:KeyMapping.cs

示例3: Enqueue

		public void Enqueue (CustomInput currentInput)
		{
				if (currentInput.IsDown) {
						TouchManager.Instance.OnTouchStart (currentInput);
				}
				if (currentInput.IsUp) {
						TouchManager.Instance.OnTouchEnd (currentInput);
				}
		}
开发者ID:Furuta0316,项目名称:GGJ2016,代码行数:9,代码来源:TouchDetector.cs

示例4: Navigate

 private void Navigate(CustomInput.UserInput direction)
 {
     if ( EventSystem.current.currentSelectedGameObject == this.gameObject) {
         switch(direction)
         {
         case CustomInput.UserInput.Left:
             slider.value -= 1;
             break;
         case CustomInput.UserInput.Right:
             slider.value += 1;
             break;
         }
         if (sp) sp.SetVolume(slider.value);
     }
 }
开发者ID:JonathanHunter,项目名称:CardNinjas,代码行数:15,代码来源:SliderFix1.cs

示例5: setInput

    private void setInput(CustomInput input)
    {
        switch (keyIndex)
        {
            case 0:
                keyMapping.primaryInput = input;
            break;
            case 1:
                keyMapping.secondaryInput = input;
            break;
            case 2:
                keyMapping.thirdInput = input;
            break;
        }

        updateText();

        selectedButton = null;
    }
开发者ID:Gris87,项目名称:InputControl,代码行数:19,代码来源:InputControlDemo_KeyButtonScript.cs

示例6: Navigate

    public static void Navigate(CustomInput.UserInput direction, GameObject defaultGameObject)
    {
        GameObject next = EventSystem.current.currentSelectedGameObject;
        if (next == null)
        {
            if(defaultGameObject != null) EventSystem.current.SetSelectedGameObject(defaultGameObject);
            return;
        }

        bool nextIsValid = false;
        while (!nextIsValid)
        {
            switch (direction)
            {
                case CustomInput.UserInput.Up:
                    if (EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnUp() != null)
                        next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnUp().gameObject;
                    else next = null;
                    break;
                case CustomInput.UserInput.Down:
                    if (EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnDown() != null)
                        next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnDown().gameObject;
                    else next = null;
                    break;
                case CustomInput.UserInput.Left:
                    if (EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnLeft() != null)
                        next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnLeft().gameObject;
                    else next = null;
                    break;
                case CustomInput.UserInput.Right:
                    if (EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnRight() != null)
                        next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnRight().gameObject;
                    else next = null;
                    break;
            }
            if (next != null)
            {
                EventSystem.current.SetSelectedGameObject(next);
                nextIsValid = next.GetComponent<Selectable>().interactable;
            }
            else nextIsValid = true;
        }
    }
开发者ID:JonathanHunter,项目名称:Nullptr,代码行数:43,代码来源:Navigator.cs

示例7: Navigate

    private void Navigate(CustomInput.UserInput direction)
    {
        if ( EventSystem.current.currentSelectedGameObject == this.gameObject) {
            switch(direction)
            {
            case CustomInput.UserInput.Left:
                slider.value -= .01f;
                break;
            case CustomInput.UserInput.Right:
                slider.value += .01f;
                break;
            }
        }

        if (isSfx)
            GameManager.SFXVol = slider.value;
        else
            GameManager.MusicVol = slider.value;
    }
开发者ID:JonathanHunter,项目名称:CardNinjas,代码行数:19,代码来源:SliderFix.cs

示例8: Navigate

    private void Navigate(CustomInput.UserInput direction)
    {
        GameObject next = EventSystem.current.currentSelectedGameObject;

        switch(direction)
        {
        case CustomInput.UserInput.Up:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnUp().gameObject;
            break;
        case CustomInput.UserInput.Down:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnDown().gameObject;
            break;
        case CustomInput.UserInput.Accept:
            var pointer = new PointerEventData(EventSystem.current);
            ExecuteEvents.Execute(EventSystem.current.currentSelectedGameObject, pointer, ExecuteEvents.submitHandler);
            return;
        }
        EventSystem.current.SetSelectedGameObject(next);
    }
开发者ID:Ominous,项目名称:CardNinjas,代码行数:19,代码来源:MenusController.cs

示例9: Navigate

    private void Navigate(CustomInput.UserInput direction)
    {
        GameObject next = EventSystem.current.currentSelectedGameObject;

        switch(direction)
        {
        case CustomInput.UserInput.Up:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnUp().gameObject;
            break;
        case CustomInput.UserInput.Down:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnDown().gameObject;
            break;
        case CustomInput.UserInput.Left:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnLeft().gameObject;
            break;
        case CustomInput.UserInput.Right:
            next = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnRight().gameObject;
            break;
        }
        EventSystem.current.SetSelectedGameObject(next);
    }
开发者ID:szhangGT,项目名称:CardNinjas,代码行数:21,代码来源:MenusController.cs

示例10: OnNewBoardPieceSelected

	public void OnNewBoardPieceSelected(AbstractBoardPiece boardPiece, CustomInput.TouchInfo touchInfo)
	{
		if(BoardShuffleController.Instance.IsBoardReshuffling)
		{
			return;
		}
		
		bool selectionSucces = false;
		
		selectedBoardPiece = boardPiece;
		tileToDestroy = boardPiece.Tile as Match3Tile;
		effectPosition = boardPiece.cachedTransform;

		//Decide wether this selection is icepick worthy or not
		if(boardPiece.Tile == null)
		{
			if(boardPiece is LayeredBoardPiece && (boardPiece as LayeredBoardPiece).NumLayers > 0 )
			{
				selectionSucces = true;
			}
		}
		else if (!tileToDestroy.IsMoving && tileToDestroy.IsDestructible && !tileToDestroy.IsDestroying && !(tileToDestroy as NormalTile).IsFrozen()) 
		{
			selectionSucces = true;
		}
		
		if(selectionSucces)
		{
			SoundManager.Instance.PlayOneShot("icepick_sfx");
			
			touchController.StopInputController();
			touchController.OnNewBoardPieceSelected -= OnNewBoardPieceSelected;
			
			StartItemEffects();
		}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:36,代码来源:IcePick.cs

示例11: SetKey

    /// <summary>
    /// Create new <see cref="KeyMapping"/> with specified name and inputs.
    /// </summary>
    /// <returns>Created KeyMapping.</returns>
    /// <param name="name">KeyMapping name.</param>
    /// <param name="primary">Primary input.</param>
    /// <param name="secondary">Secondary input.</param>
    /// <param name="third">Third input.</param>
    public static KeyMapping SetKey(string name, CustomInput primary=null, CustomInput secondary=null, CustomInput third=null)
    {
        KeyMapping outKey = null;

        if (sKeysMap.TryGetValue(name, out outKey))
        {
            outKey.primaryInput   = primary;
            outKey.secondaryInput = secondary;
            outKey.thirdInput     = third;
        }
        else
        {
            outKey = new KeyMapping(name, primary, secondary, third);

            sKeysList.Add(outKey);
            sKeysMap.Add(name, outKey);
        }

        return outKey;
    }
开发者ID:Gris87,项目名称:UnityEditorCommonAssets,代码行数:28,代码来源:InputControl.cs

示例12: OnNewBoardPieceSelected

	protected void OnNewBoardPieceSelected(AbstractBoardPiece boardPiece, CustomInput.TouchInfo touchInfo)
	{
//		Debug.LogWarning("[OnNewBoardPieceSelect]");
		
		if(BoardShuffleController.Instance.IsBoardReshuffling)
		{
			return;
		}
		
		if(startPosition == Vector3.zero)
		{
			startPosition  = boardPiece.cachedTransform.position;
		}
		else
		{
			endPosition = boardPiece.cachedTransform.position;
		}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:18,代码来源:Sword.cs

示例13: Enqueue

    public void Enqueue(CustomInput currentInput)
    {
        if (!(currentInput.IsDown || currentInput.IsDrag || currentInput.IsUp))
                        return;

                this.pastInputs.Add (currentInput);

                if (this.pastInputs.Count == 1) {
                        //First Input
                        currentInput.MovedDistance = Vector3.zero;
                        currentInput.LevelingTime = 0;
                        currentInput.LevelingOriginSpeedVector = Vector3.zero;
                } else {
                        //currentInputからLevelingFrame数だけ古いフレームのInput
                        CustomInput levelingOriginInput = this.pastInputs [0];
                        currentInput.MovedDistance = currentInput.ScreenPosition - levelingOriginInput.ScreenPosition;
                        currentInput.LevelingTime = currentInput.Time - levelingOriginInput.Time;// this.LevelingFrameCount;
                        currentInput.LevelingOriginSpeedVector = levelingOriginInput.SpeedVector;

                        //フリック開始&継続判定
                        var lastInput = this.pastInputs [this.pastInputs.Count - 2];
                        if (lastInput.IsFlicking) {
                                //継続判定
                                if (currentInput.SpeedVector.magnitude > this.DefeatSpeed) {
                                        currentInput.IsFlicking = true;
                                } else {
                                        //フリック中止
                                        this.FlickStartInput = null;

                                        currentInput.IsFlicking = false;
                                        this.FlickStartInput = null;
                                }
                        } else {
                                //フリック開始判定
                                if (currentInput.AccelerationVector.magnitude > this.DetectAcceleration) {
                                        if (currentInput.SpeedVector.magnitude > 0.0001f) {
                                                if (!this.ContinuousDetect && this.IsDetected) {
                                                        //指を離すまで再検知しない
                                                } else {
                                                        currentInput.IsFlicking = true;
                                                        this.FlickStartInput = currentInput;
                                                        this.IsDetected = true;
                                                        //フリック開始イベント
                                                        TouchManager.Instance.OnFlickStart (new FlickEventArgs (levelingOriginInput, currentInput));
                                                }
                                        }
                                }
                        }

                        //フリック完了判定
                        if (currentInput.IsFlicking && currentInput.IsUp) {

                                Vector3 flickDistance = currentInput.ScreenPosition - this.FlickStartInput.ScreenPosition;
                                if (flickDistance.magnitude > this.MinFlickDistance) {

                                        //フリック成立
                                        TouchManager.Instance.OnFlickComplete (new FlickEventArgs (this.pastInputs [this.pastInputs.Count - 2], currentInput));
                                        //TouchManager.Instance.OnFlickComplete (new FlickEventArgs (this.FlickStartInput, currentInput));

                                        currentInput.IsFlicking = false;
                                        this.FlickStartInput = null;

                                }
                        }

                        //指が離れた
                        if (currentInput.IsUp) {
                                this.IsDetected = false;
                                this.pastInputs.Clear();
                        }
                }

                while (this.pastInputs.Count > this.LevelingFrameCount) {
                        this.pastInputs.RemoveAt (0);
                }
    }
开发者ID:EsProgram,项目名称:Unity-TouchManager,代码行数:76,代码来源:FlickDetector.cs

示例14: OnTouchStart

 public void OnTouchStart(CustomInput input)
 {
     if (this.TouchStart != null)
                     this.TouchStart (this.gameObject, new CustomInputEventArgs (input));
 }
开发者ID:yota2013,项目名称:ApplicationProject,代码行数:5,代码来源:TouchManager.cs

示例15: CustomInputEventArgs

		public CustomInputEventArgs (CustomInput input)
		{
				this.Input = input;
		}
开发者ID:Furuta0316,项目名称:GGJ2016,代码行数:4,代码来源:CustomInputEventArgs.cs


注:本文中的CustomInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。