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


C# PlayerController.GetComponentInChildren方法代码示例

本文整理汇总了C#中PlayerController.GetComponentInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerController.GetComponentInChildren方法的具体用法?C# PlayerController.GetComponentInChildren怎么用?C# PlayerController.GetComponentInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerController的用法示例。


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

示例1: Start

    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
        if (!player)
            Debug.Log("EndControll.cs: Player not Found!");

		playerAnimator = player.GetComponentInChildren<PlayerAnimator>();
		if (!playerAnimator)
			Debug.Log("EndControll.cs: PlayerAnimator not Found!");

        gridManager = GameObject.FindObjectOfType<GridManager>();
        if (!gridManager)
            Debug.Log("EndControll.cs: Grid Manager not Found!");

        ui = GameObject.FindObjectOfType<UICollectionItems>();
        if (!ui)
            Debug.Log("EndControll.cs: ui not Found!");

        data =  GameObject.FindObjectOfType<ParkourData>();
        if (!data)
            Debug.Log("EndControll.cs: ParkourData not Found!");

		mainParkour = GameObject.FindObjectOfType<MainParkour>();
		if (!mainParkour)
			Debug.Log("EndControll.cs: MainParkour not Found!");
    }
开发者ID:Mattys410305,项目名称:Magical-Girl-Shop,代码行数:26,代码来源:EndControll.cs

示例2: Awake

 protected override void Awake()
 {
     base.Awake();
     playerCtrl = PlayerController.GetController ();
     playerAnim = playerCtrl.GetComponentInChildren<Animator> ();
     hpMax = initHpMax;
     hp = hpMax;
     speed = initSpeed;
 }
开发者ID:meetingmeeting,项目名称:ninjagame,代码行数:9,代码来源:EnemyController.cs

示例3: Start

 void Start()
 {
     player = (PlayerController)FindObjectOfType(System.Type.GetType("PlayerController"));
     playerAnim = player.GetComponentInChildren<Animator>();
     playerHashIds = player.GetComponent<PlayerHashIDs>();
     aSource = GetComponent <AudioSource> ();
 }
开发者ID:TheDeadMemoriesTeam,项目名称:TheDeadMemories,代码行数:7,代码来源:EnemySight.cs


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