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


C# CharacterMotor类代码示例

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


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


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