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


C# CharacterController类代码示例

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


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

示例1: Start

 void Start()
 {
     _t = transform;
     _animator = GetComponent<Animator>();
     _controller = GetComponent<CharacterController>();
     _rigidbody = GetComponent<Rigidbody>();
 }
开发者ID:choang05,项目名称:Puzzle-2,代码行数:7,代码来源:SrpgcMouseMovementController.cs

示例2: Start

    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");

        anim = GetComponent<Animator>();
        charControl = GetComponent<CharacterController>();
    }
开发者ID:DanStout,项目名称:FablesOfSol,代码行数:7,代码来源:ChasesPlayer.cs

示例3: Start

    // Constants

    // Use this for initialization
	void Start ()
	{
    	// Set up the character controller and movement
        m_npcController = GetComponentInParent<CharacterController>();
        m_finalMovement = Vector3.zero;
		behaviour = NpcBehaviour.Linear       ;
	}
开发者ID:Aze22,项目名称:GGJ2016,代码行数:10,代码来源:NPCScript.cs

示例4: Start

    // Use this for initialization
    private void Start()
    {
        m_CharacterController = GetComponent<CharacterController>();
        m_StepCycle = 0f;
        m_NextStep = m_StepCycle / 2f;
        m_Jumping = false;
        m_AudioSource = GetComponent<AudioSource>();

        // Get the controller to player map from the MultiSceneVariablesScripts
        ControllerID = -1;
        int player = PlayerID;
        MultiSceneVariablesScript script = GameObject.Find( "MultiSceneVariables" ).GetComponent<MultiSceneVariablesScript>();
        {
            int playeriter = 0;
            foreach ( int playercon in script.PlayerToController.ToArray() )
            {
                if ( ( player - 1 ) == playeriter )
                {
                    ControllerID = playercon;
                    break;
                }
                playeriter++;
            }
        }
        // Disable unused players
        if ( ControllerID == -1 )
        {
            gameObject.SetActive( false );
            enabled = false;
        }
    }
开发者ID:DrMelon,项目名称:PotionCommotion,代码行数:32,代码来源:PlayerControllerScript.cs

示例5: Start

 public void Start()
 {
     seeker = GetComponent<Seeker>();
     controller = GetComponent<CharacterController>();
     //Start a new path to the targetPosition, return the result to the OnPathComplete function
     seeker.StartPath(transform.position, targetPosition, OnPathComplete);
 }
开发者ID:Super-Goat-Herders,项目名称:ProjectGoat,代码行数:7,代码来源:AiStar4.cs

示例6: Awake

    // =============================================================================
    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------
    void Awake()
    {
        Config = GameObject.FindWithTag( "Config" ).GetComponent<Config>();
        Trans = transform;

        CC = gameObject.GetComponent<CharacterController>();
    }
开发者ID:Jonas90,项目名称:iss,代码行数:10,代码来源:PlayerMovement.cs

示例7: Update

	// Update is called once per frame
	void Update () {
		if(Vector3.Distance(transform.position,player.position)<10){
			sighted = true;
			target = player.position;
			Debug.Log(sighted);
		}	
		float distA = Vector3.Distance(transform.position,pointA.position);
		float distB = Vector3.Distance(transform.position,pointB.position);
		if(distA<2){
			atA = true;
			atB = false;
			target = pointB.position;
		}
		if(distB<2){
			atB = true;
			atA = false;
			target = pointA.position;
		}
		if(Time.time > curTime+waitTime){
			seeker = GetComponent<Seeker>();
			seeker.StartPath(transform.position,target,OnPathComplete);
			charctlr = GetComponent<CharacterController>();
			curTime = Time.time;
		}
	}
开发者ID:kxh337,项目名称:Sephone,代码行数:26,代码来源:GhostTwoPoint.cs

示例8: Start

	// Use this for initialization
	void Start () 
	{
        _animator = GetComponent<Animator>();
		_charCtrl = GetComponent<CharacterController>();
		m_AudioSource = GetComponent<AudioSource>();
		currTexture = myBody.GetComponent<SkinnedMeshRenderer> ().material.mainTexture;
	}
开发者ID:kamilion,项目名称:UNETMovement,代码行数:8,代码来源:LocomotionPlayer.cs

示例9: Start

 void Start()
 {
     characterController = GetComponent<CharacterController>();
     characterParticles = GameObject.Find("Player/Flute Radius").GetComponent<ParticleSystem>();
     fluteCall1 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute1");
     fluteCall2 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute2");
 }
开发者ID:mightypants,项目名称:apackofalpacas,代码行数:7,代码来源:PlayerMovement.cs

示例10: Awake

    void Awake()
    {
        gc = GameObject.FindWithTag("GameController").GetComponent<GameController>();

        cc = GetComponent<CharacterController>();
        move = new Vector3();
    }
开发者ID:EternalGB,项目名称:ldjam33,代码行数:7,代码来源:PlayerController.cs

示例11: Awake

    void Awake()
    {
        yaw = transform.localEulerAngles.y;

        // get a reference to the Character Controller
        characterController = GetComponent<CharacterController>();
    }
开发者ID:yunspace,项目名称:unite15-network-game,代码行数:7,代码来源:PlayerController.cs

示例12: Start

 void Start()
 {
     state = new ClientWiiState();
     playerCam = transform.FindChild("Main Camera");
     controller = GetComponent<CharacterController>();
     bJump = true;
 }
开发者ID:timmutton,项目名称:r2d2_assignment,代码行数:7,代码来源:playerMovement.cs

示例13: Reset

 void Reset()
 {
     characterController = GetComponentInChildren<CharacterController>();
     navMeshAgent = GetComponentInChildren<NavMeshAgent>();
     joystickNavigationController = GetComponent<JoystickNavigationController>();
     camera = GetComponentInChildren<Camera>().gameObject;
 }
开发者ID:Foxshiver,项目名称:Projet_Immersia,代码行数:7,代码来源:NavigationManager.cs

示例14: FixedUpdate

    //Update is called once per frame
    void FixedUpdate()
    {
        //Defines how player movement works
        controller = GetComponent<CharacterController>();
        movement.x = 0;

        if(Input.GetKey(moveLeft))
            movement.x = -moveSpeed;
        else if(Input.GetKey(moveRight))
            movement.x = moveSpeed;

        if(controller.isGrounded){
            vertSpeed = 0.0f;

            if(Input.GetKey(moveJump)){
                vertSpeed = jumpSpeed;
            }
        }

        vertSpeed -= gravity*Time.deltaTime;
        movement.y = vertSpeed;

        controller.Move(movement * Time.deltaTime);
        //End player movement
    }
开发者ID:Shadowist,项目名称:OGM2013February,代码行数:26,代码来源:PlayerMovement.cs

示例15: Start

 public void Start()
 {
     seeker = GetComponent<Seeker>();
     controller = GetComponent<CharacterController>();
     FindTarget();
     StartCoroutine(GetNewPath());
 }
开发者ID:uudkdevs2013,项目名称:TheSonOfBSF,代码行数:7,代码来源:AstarAI.cs


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