本文整理汇总了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!");
}
示例2: Awake
protected override void Awake()
{
base.Awake();
playerCtrl = PlayerController.GetController ();
playerAnim = playerCtrl.GetComponentInChildren<Animator> ();
hpMax = initHpMax;
hp = hpMax;
speed = initSpeed;
}
示例3: Start
void Start()
{
player = (PlayerController)FindObjectOfType(System.Type.GetType("PlayerController"));
playerAnim = player.GetComponentInChildren<Animator>();
playerHashIds = player.GetComponent<PlayerHashIDs>();
aSource = GetComponent <AudioSource> ();
}