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

C# CharacterMotor类代码示例

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

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



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

示例1: Start

 // Use this for initialization
 public override void Start()
 {
     base.Start();
     motor = GetComponent<CharacterMotor>();
     animator = GetComponentInChildren<Animator>();
     StartCoroutine("AI");
 }
开发者ID:Gornel,项目名称:Overworld,代码行数:8,代码来源:GriswoldController.cs


示例2: Start

 // Use this for initialization
 void Start()
 {
     Input.multiTouchEnabled = true;
     characterMotorScript = objPlayer.GetComponent<CharacterMotor>();
     characterJumpScript = objPlayer.GetComponent<CharacterJump2>();
     characterShotScript = objPlayer.GetComponent<CharacterShot>();
 }
开发者ID:MilesMeacham,项目名称:JuniorProject,代码行数:8,代码来源:TouchInputs.cs


示例3: Start

 // Use this for initialization
 void Start()
 {
     chMotor =  GetComponent<CharacterMotor>();
     tr = transform;
     CharacterController ch = GetComponent<CharacterController>();
     dist = ch.height/2; // calculate distance to ground
 }
开发者ID:kwmcc,项目名称:Hoarder,代码行数:8,代码来源:RunCrouch.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     controller = gameObject.transform.root.GetComponent<CharacterController>();
     motor = gameObject.transform.root.GetComponent<CharacterMotor>();
     inventory = gameObject.transform.root.GetComponent<Inventory>();
     vitals = gameObject.transform.root.GetComponent<PlayerVitals>();
 }
开发者ID:sethnel99,项目名称:HungerGame,代码行数:8,代码来源:SpeedManager.cs


示例5: Awake

	//setup
	void Awake()
	{
		//create single floorcheck in centre of object, if none are assigned
		if(!floorChecks)
		{
			floorChecks = new GameObject().transform;
			floorChecks.name = "FloorChecks";
			floorChecks.parent = transform;
			floorChecks.position = transform.position;
			GameObject check = new GameObject();
			check.name = "Check1";
			check.transform.parent = floorChecks;
			check.transform.position = transform.position;
			Debug.LogWarning("No 'floorChecks' assigned to PlayerMove script, so a single floorcheck has been created", floorChecks);
		}
		//assign player tag if not already
		if(tag != "Player")
		{
			tag = "Player";
			Debug.LogWarning ("PlayerMove script assigned to object without the tag 'Player', tag has been assigned automatically", transform);
		}
		//usual setup
		mainCam = GameObject.FindGameObjectWithTag("MainCamera").transform;
		dealDamage = GetComponent<DealDamage>();
		characterMotor = GetComponent<CharacterMotor>();
		rigid = GetComponent<Rigidbody>();
		aSource = GetComponent<AudioSource>();
		//gets child objects of floorcheckers, and puts them in an array
		//later these are used to raycast downward and see if we are on the ground
		floorCheckers = new Transform[floorChecks.childCount];
		for (int i=0; i < floorCheckers.Length; i++)
			floorCheckers[i] = floorChecks.GetChild(i);
	}
开发者ID:ianburnette,项目名称:MarshBirds,代码行数:34,代码来源:PlayerMove.cs


示例6: Awake

    // Use this for initialization
    void Awake()
    {
        _Game = GameObject.Find("Game");
        c_Game = _Game.GetComponentInChildren<Game>();

        motor = GetComponent<CharacterMotor>();
    }
开发者ID:SeniorTeam,项目名称:MonkeyHead,代码行数:8,代码来源:Player_InputManager.cs


示例7: Start

    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {

            myTransform = transform;

            cameraHead = myTransform.FindChild("CameraHead");

            motorScript = myTransform.GetComponent<CharacterMotor>();

            //Access the PlayerStats script and get the player's max speed.
            //This is their normal movement speed outside of the water.

            GameObject gManager = GameObject.Find("GameManager");

            PlayerStats statScript = gManager.GetComponent<PlayerStats>();

            normalSpeed = statScript.maxSpeed;
        }

        else
        {
            enabled = false;
        }
    }
开发者ID:AnthonyB28,项目名称:FPS_Unity,代码行数:28,代码来源:WaterBehaviour.cs


示例8: Awake

	//setup
	void Awake()
	{		
		characterMotor = GetComponent<CharacterMotor>();
		dealDamage = GetComponent<DealDamage>();
		//avoid setup errors
		if(tag != "Enemy")
		{
			tag = "Enemy";
			Debug.LogWarning("'EnemyAI' script attached to object without 'Enemy' tag, it has been assign automatically", transform);
		}
		
		if(sightBounds)
		{
			sightTrigger = sightBounds.GetComponent<TriggerParent>();
			if(!sightTrigger)
				Debug.LogError("'TriggerParent' script needs attaching to enemy 'SightBounds'", sightBounds);
		}
		if(!sightBounds)
			Debug.LogWarning("Assign a trigger with 'TriggerParent' script attached, to 'SightBounds' or enemy will not be able to see", transform);
		
		if(attackBounds)
		{
			attackTrigger = attackBounds.GetComponent<TriggerParent>();
			if(!attackTrigger)
				Debug.LogError("'TriggerParent' script needs attaching to enemy 'attackBounds'", attackBounds);
		}
		else
			Debug.LogWarning("Assign a trigger with 'TriggerParent' script attached, to 'AttackBounds' or enemy will not be able to attack", transform);
	}
开发者ID:ianburnette,项目名称:MarshBirds,代码行数:30,代码来源:EnemyAI.cs


示例9: Start

	// Use this for initialization
	void Start () {
		audioSource.clip = audio;
		mouse = player.GetComponent<MouseLook>();
		motor = player.GetComponent<CharacterMotor>();
		triggered = false;
		charControl = player.GetComponent<CharacterController>();
	}
开发者ID:kxh337,项目名称:Sephone,代码行数:8,代码来源:ForceTurn.cs


示例10: Awake

    //setup
    void Awake()
    {
        if(transform.tag != "Enemy")
        {
            //add kinematic rigidbody
            if(!GetComponent<Rigidbody>())
                gameObject.AddComponent<Rigidbody>();
            GetComponent<Rigidbody>().isKinematic = true;
            GetComponent<Rigidbody>().useGravity = false;
            GetComponent<Rigidbody>().interpolation = RigidbodyInterpolation.Interpolate;
        }
        else
        {
            characterMotor = GetComponent<CharacterMotor>();
            enemyAI = GetComponent<EnemyAI>();
        }

        //get child waypoints, then detach them (so object can move without moving waypoints)
        foreach (Transform child in transform)
            if(child.tag == "Waypoint")
                waypoints.Add (child);

        foreach(Transform waypoint in waypoints)
            waypoint.parent = null;

        if(waypoints.Count == 0)
            Debug.LogError("No waypoints found for 'MoveToPoints' script. To add waypoints: add child gameObjects with the tag 'Waypoint'", transform);
    }
开发者ID:ChromaTower,项目名称:ChromaProtoTower,代码行数:29,代码来源:MoveToPoints.cs


示例11: Start

 // Use this for initialization
 protected virtual void Start()
 {
     SetInitialProperties();
     characterController = GetComponent<CharacterController>();
     control = GetComponent<Controller>();
     motor = GetComponent<CharacterMotor>();
 }
开发者ID:NumberFiles,项目名称:GGJ14,代码行数:8,代码来源:Character.cs


示例12: Start

    void Start()
    {
        worldManager = (WorldManager)FindObjectOfType (typeof(WorldManager));
        guiManager = (GUIManager)FindObjectOfType (typeof(GUIManager));

        characterMotor=worldManager.getPlayer().GetComponent<CharacterMotor>();
    }
开发者ID:Zulban,项目名称:viroid,代码行数:7,代码来源:LeaveMapTeleporter.cs


示例13: OnEnable

 // Use this for initialization
 private void OnEnable()
 {
     myTransform = transform;
     characterMotor = GetComponent<CharacterMotor>();
     characterController = GetComponent<CharacterController>();
     isFlying = false;
 }
开发者ID:jmschrack,项目名称:LudumDare33,代码行数:8,代码来源:FlyMode.cs


示例14: Start

    // Use this for initialization
    void Start()
    {
        motor = GetComponent(typeof(CharacterMotor)) as CharacterMotor;
        if (motor==null) Debug.Log("Motor is null!!");

        originalRotation = transform.localRotation;
    }
开发者ID:puzpuz,项目名称:LocomotionTest,代码行数:8,代码来源:MouseLookCharacterController.cs


示例15: Awake

    void Awake()
    {
        cameraScript = GetComponent<MouseLook>();
        cameraScript2 = camera.GetComponent<MouseLook>();
        controllerScript = GetComponent<CharacterMotor>();
        shotScript = GetComponent<Shot>();

         if (photonView.isMine)
        {
            this.camera.camera.enabled=true;
            cameraScript.enabled = true;
            cameraScript2.enabled = true;
            controllerScript.canControl = true;
            shotScript.enabled=true;
        }
        else
        {
            this.camera.camera.enabled=false;
            cameraScript.enabled = false;
            cameraScript2.enabled = false;
            controllerScript.canControl = false;
            shotScript.enabled=false;
        }

        gameObject.name = gameObject.name + photonView.viewID.ID;
    }
开发者ID:vagerant,项目名称:FPSforPhotonCloud-Unity,代码行数:26,代码来源:FirstPersonNetwork.cs


示例16: Awake

 void Awake()
 {
     movement 	= pc.GetComponent <CharacterMotor> ();
     message 	= text.GetComponent <uiSystem> ();
     cam 		= holder.GetComponent <cameraScript> ();
     menu 		= holder.GetComponent <menuScript> ();
 }
开发者ID:ZachOlivier,项目名称:SavePoint,代码行数:7,代码来源:pictureScript.cs


示例17: Start

//	bool inReload { get { return animation[reloadAnimation.name].enabled; } }
//	bool inTransition { get { return animation[gunOffAnimation.name].enabled || animation[gunOnAnimation.name].enabled;	} }
//	bool inFire { get { return animation[fireAnimation.name].enabled; } }
	
	// Set up upper body animation
	/*private void SetupGunAnimation (AnimationClip animationClip) {
		AnimationState a = animation[animationClip.name];
				a.wrapMode = WrapMode.Once;
				a.layer = 1;
				a.AddMixingTransform(spine);
				a.AddMixingTransform(rightGun);
	}*/

	// Use this for initialization
	void Start () {
	//	if (gunOnAnimation == null || gunOffAnimation == null || reloadAnimation == null || fireAnimation == null || muzzleFlash == null)
			enabled = false;
			
	/*	SetupGunAnimation(gunOnAnimation);
			SetupGunAnimation(gunOffAnimation);
			SetupGunAnimation(reloadAnimation);*/
		
		// setup additive fire animation
		/*AnimationState fireAS = animation[fireAnimation.name];
				fireAS.wrapMode = WrapMode.Once;
				fireAS.layer = 101; // we put it in a separate layer than impact animations
				fireAS.blendMode = AnimationBlendMode.Additive;*/
		
		motor = GetComponent(typeof(CharacterMotor)) as CharacterMotor;
		
		LegController legC = GetComponent(typeof(LegController)) as LegController;
		IMotionAnalyzer[] motions = legC.motions;
		foreach (IMotionAnalyzer motion in motions) {
			if (motion.name == "RunForward")
				maxSpeedWithGun = motion.cycleSpeed;
			if (motion.name == "RunForwardNoGun")
				maxSpeedWithoutGun = motion.cycleSpeed;
			//if (motion.name == "RunForwardFastNoGun")
			//	maxSpeedWithoutGun = motion.cycleSpeed;
		}
		
		muzzleFlash.enabled = false;
	}
开发者ID:NeoWang1986614,项目名称:games-development-project,代码行数:43,代码来源:WeaponStateController.cs


示例18: Awake

    private float y = 0.0f; // Storing camera angle

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Awake()
    {
        motor = GetComponent<CharacterMotor>();
        game = GameObject.Find ("_GAMECORE").GetComponent<Game> ();
        if (!firstPersonCam) {
            firstPersonCam = (Camera)this.transform.FindChild ("PlayerView").GetComponent<Camera>();
        }
    }
开发者ID:TELEPAT0,项目名称:UnityNetworkExample,代码行数:15,代码来源:FPSInputController.cs


示例19: Awake

	void Awake()
	{
        m_charController = gameObject.AddComponent<CharacterController>();
        m_charMotor = gameObject.AddComponent<CharacterMotor>();

        IsMoving = false;
        CanMove = true;
	} 
开发者ID:BubbleRap,项目名称:ExploreTheDarkness,代码行数:8,代码来源:MovementController.cs


示例20: Start

    public void Start()
    {
        theCharacterMotor = GetComponent<CharacterMotor> ();
        jumpTimeCounter = jumpTime;

        groundCheckObj = transform.FindChild ("GroundCheck").gameObject;
        groundCheck = groundCheckObj.GetComponent<Collider2D> ();
    }
开发者ID:MilesMeacham,项目名称:TankGame,代码行数:8,代码来源:CharacterJump.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CharacterState类代码示例发布时间:2022-05-24
下一篇:
C# CharacterData类代码示例发布时间: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