• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MovingJoystick类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: On_JoystickMove

 private void On_JoystickMove(MovingJoystick move)
 {
     float y = move.Axis2Angle(true);
     base.transform.rotation = Quaternion.Euler(new Vector3(0f, y, 0f));
     base.transform.Translate((Vector3) ((Vector3.forward * move.joystickValue.magnitude) * Time.deltaTime));
     this.model.animation.CrossFade("Run");
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:7,代码来源:ETPlayer.cs


示例2: On_JoystickMoveEnd

	void On_JoystickMoveEnd (MovingJoystick move)
	{
		if ("Move_Turn_Joystick" == move.joystickName) {
			throttle = 0.0f;
			steer = 0.0f;
		}
	}
开发者ID:gongchangyou,项目名称:Jackal,代码行数:7,代码来源:PlayerCarController.cs


示例3: On_JoystickMoveEnd

 private void On_JoystickMoveEnd(MovingJoystick move)
 {
     if (move.joystickName == "Move_Turn_Joystick")
     {
         base.animation.CrossFade("idle");
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:7,代码来源:JoystickEvent.cs


示例4: On_JoystickMove

    void On_JoystickMove(MovingJoystick move)
    {
        if (move.joystickName == "PlayerInputJoystick")
        {
            if (!GameMain.Instance.SceneManager.ChangeSceneComplete)
            {

                CommonFunction.DebugMsgFormat("換場中,不能移動!!");
                return;
            }
            if (GameMain.Instance.GameEventManager.DoingEvent)
            {
                CommonFunction.DebugMsgFormat("事件中,不能移動");
                return;
            }
            CommonFunction.DebugMsg(string.Format("JoyStick移動中 ({0})", move.joystickAxis));
            //

            if (move.joystickAxis.sqrMagnitude >= 0.25)
            {
                GameMain.Instance.MyRole.CrossAnimation("run");
            }
            else if (move.joystickAxis.sqrMagnitude > 0)
            {
                GameMain.Instance.MyRole.CrossAnimation("walk");
            }
            GameMain.Instance.MyRole.Move(move.Axis2Angle(true), move.joystickAxis.magnitude);
        }
    }
开发者ID:HEIENTAI,项目名称:SoulOfSword,代码行数:29,代码来源:PlayerInput.cs


示例5: On_JoystickMoveEnd

	void On_JoystickMoveEnd (MovingJoystick move)
	{
		if ("Rotate_straff_Joystick" == move.joystickName) {
						isShooting = false;
						gun.StopShoot ();
				}
	}
开发者ID:gongchangyou,项目名称:Jackal,代码行数:7,代码来源:PlayerWeaponController.cs


示例6: On_JoystickMove

    void On_JoystickMove( MovingJoystick move)
    {
        float angle = move.Axis2Angle(true);
        transform.rotation  = Quaternion.Euler( new Vector3(0,angle,0));
        transform.Translate( Vector3.forward * move.joystickValue.magnitude * Time.deltaTime);

        model.animation.CrossFade("Run");
    }
开发者ID:GGJ-CBA-RD,项目名称:RaisingDark,代码行数:8,代码来源:Player.cs


示例7: OnJoystickMoveEnd

 void OnJoystickMoveEnd(MovingJoystick move)
 {
     if (move.joystickName == "Myjoystick")
     {
         joyPositionX = 0;
         joyPositionY = 0;
     }
 }
开发者ID:1510649869,项目名称:ARPG_project,代码行数:8,代码来源:TouchControl.cs


示例8: OnJoystickMoveEnd

 //移动摇杆结束
 void OnJoystickMoveEnd(MovingJoystick move)
 {
     if (move.joystickName != "WalkJoystick"){
         return;
     }
     transform.Find("p1_walk").gameObject.GetComponent<Animator> ().SetBool ("Walk", false);
     transform.Find("p2_walk").gameObject.GetComponent<Animator> ().SetBool ("Walk", false);
 }
开发者ID:TzuChanChuang,项目名称:Revenge_UnityGame,代码行数:9,代码来源:walk.cs


示例9: On_JoystickMove

	void On_JoystickMove( MovingJoystick move)
	{
		if(!_playerAnim.getAnimBoolVar("isAttack") && !_playerAnim.getAnimBoolVar("isHit"))
		{
			_playerMovement.Move(move.joystickAxis.x, move.joystickAxis.y, speed);
			_playerAnim.SetAnimVar("isRun", true);
		}
	}
开发者ID:NusantaraBeta,项目名称:BrawlerRumble,代码行数:8,代码来源:PlayerController.cs


示例10: OnJoystickMove

 void OnJoystickMove(MovingJoystick move)
 {
     if (move.joystickName == "Movejoystick")
     {
         checkedMoving = true;
         _database.SetData<KeyOpt>("KeyCode", KeyOpt.MovingJoyStick);
         _database.SetData<MovingJoystick>("MovingJoystick", move);
     }
 }
开发者ID:zs9024,项目名称:Jungle,代码行数:9,代码来源:BTCheckEasyJoystick.cs


示例11: OnJoystickMoveEnd

 void OnJoystickMoveEnd(MovingJoystick move)
 {
     Debug.Log("OnJoystickMoveEnd : " + move.joystickName);
     if (move.joystickName == "Movejoystick")
     {
         checkedMoving = false;
         _database.RemoveData("KeyCode");
         _database.RemoveData("MovingJoystick");
     }
 }
开发者ID:zs9024,项目名称:Jungle,代码行数:10,代码来源:BTCheckEasyJoystick.cs


示例12: OnJoystickMoveEnd

    //移动摇杆结束
    void OnJoystickMoveEnd(MovingJoystick move)
    {
        //停止时,角色恢复idle

        if (move.joystickName == "MovingJoystick")

        {

        }
    }
开发者ID:ChadCSong,项目名称:Unity3DCarGameSample,代码行数:11,代码来源:CarScript.cs


示例13: On_JoystickMove

 //处理摇杆事件
 private void On_JoystickMove(MovingJoystick joystick)
 {
     if(joystick.joystickAxis.x < 0)
     {
         character.Run(-Vector2.right);
     }
     else if(joystick.joystickAxis.x > 0)
     {
         character.Run(Vector2.right);
     }
 }
开发者ID:NullPoint-Games,项目名称:Shingeki-no-Kise,代码行数:12,代码来源:PlayerController.cs


示例14: OnJoystickMoveEnd

 void OnJoystickMoveEnd(MovingJoystick move)
 {
     if (move.joystickName == "MoveJoystick")
     {
         gameObject.GetComponent<PlayerMove>().btnLeftPressed = false;
         gameObject.GetComponent<PlayerMove>().btnRightPressed = false;
         gameObject.GetComponent<PlayerMove>().btnDownPressed = false;
         gameObject.GetComponent<PlayerMove>().btnUpPressed = false;
         //animation.CrossFade("idle");
     }
 }
开发者ID:sundayliu,项目名称:HelloWorld-unity3d,代码行数:11,代码来源:MoveController.cs


示例15: OnJoystickMove

    //移动摇杆中 
    void OnJoystickMove(MovingJoystick move)
    {
        //获取摇杆中心偏移的坐标 
        float joyPositionX = move.joystickAxis.x;
        float joyPositionY = move.joystickAxis.y;
        if (joyPositionY != 0 || joyPositionX != 0)
        {
            print(joyPositionX+"  "+joyPositionY);
        }

    }
开发者ID:YaFengYi,项目名称:Unity,代码行数:12,代码来源:MoveController.cs


示例16: On_JoystickMove

    void On_JoystickMove( MovingJoystick move)
    {
        if (move.joystickName == "Move_Turn_Joystick"){
            if (Mathf.Abs(move.joystickAxis.y)>0 && Mathf.Abs(move.joystickAxis.y)<0.5){
                animation.CrossFade("walk");

            }
            else if (Mathf.Abs(move.joystickAxis.y)>=0.5){
                animation.CrossFade("run");
            }
        }
    }
开发者ID:sonygod,项目名称:ESPUnity,代码行数:12,代码来源:JoystickEvent.cs


示例17: OnJoystickMove

 //移动摇杆中  
 void OnJoystickMove(MovingJoystick move)
 {
     //获取摇杆中心偏移的坐标  
     joyPositionX = move.joystickAxis.x;
     joyPositionY = move.joystickAxis.y;
     if (move.joystickName == "Myjoystick")
     {
         if (joyPositionY != 0 || joyPositionX != 0)
         {    
         }    
     }
 }  
开发者ID:1510649869,项目名称:ARPG_project,代码行数:13,代码来源:TouchControl.cs


示例18: OnJoystickMove

    //移动摇杆中  

    void OnJoystickMove(MovingJoystick move)  

    {  

        if (move.joystickName != "MoveJoyStick")  

        {  

            return;  

        }  

          

        //获取摇杆中心偏移的坐标  

        float joyPositionX = move.joystickAxis.x;  

        float joyPositionY = move.joystickAxis.y;  

  

  

        if (joyPositionY != 0 || joyPositionX != 0)  

        {  

            //设置角色的朝向(朝向当前坐标+摇杆偏移量)  

            Vector3 mvoedist = new Vector3(joyPositionX, 0, joyPositionY).normalized;

            Vector3 forward = Camera.main.transform.TransformDirection(mvoedist);

            forward = new Vector3(forward.x, 0, forward.z);
          // mvoedist.R
           // Quaternion.
           // transform.LookAt(forward, Vector3.up);

            startSpeed = Mathf.Lerp(startSpeed, speed, Time.deltaTime);

            attack.agent.speed = startSpeed;

            attack.gotoDestination(transform.position + forward);

            //Debug.Log("forward:" + forward.x + "," + forward.y + "," + forward.z);
           //state = PlayerState.Moving;

          
        }  

    }  
开发者ID:satela,项目名称:xjhU3d,代码行数:54,代码来源:PlayerMove.cs


示例19: On_JoystickMove

	void On_JoystickMove( MovingJoystick move){

		if ("Rotate_straff_Joystick" == move.joystickName) {
						float angle = move.Axis2Angle (true);
//						Debug.Log ("move.joystickAxis.sqrMagnitude=" + move.joystickAxis.sqrMagnitude);
						Turret.transform.localRotation = Quaternion.Euler (new Vector3 (0, angle, 0));

						if (!isShooting) {
								isShooting = true;
								gun.Shoot ();
						}
				}
	}
开发者ID:gongchangyou,项目名称:Jackal,代码行数:13,代码来源:PlayerWeaponController.cs


示例20: On_JoystickMove

	void On_JoystickMove(MovingJoystick move){

		float h = move.joystickAxis.x;
		float v = move.joystickAxis.y;

		movement.Set(h, 0f, v);
		movement = movement.normalized * speed * Time.deltaTime;

		rigidbody.MovePosition (transform.position + movement);

		//this.GetComponent<PlayerMovement> ().Turning ();
		this.GetComponent<PlayerMovement> ().Animating (h, v);
	}
开发者ID:yun63,项目名称:unity_projects,代码行数:13,代码来源:Move.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Mozu类代码示例发布时间:2022-05-24
下一篇:
C# MovieTexture类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap