本文整理汇总了C#中Pawn.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.GetComponent方法的具体用法?C# Pawn.GetComponent怎么用?C# Pawn.GetComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.GetComponent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActualUse
public override bool ActualUse(Pawn target)
{
if (info == null) {
target.GetComponent<InventoryManager> ().ChangePrefab (prefabWeapon);
} else {
target.GetComponent<InventoryManager> ().ChangePrefab (prefabWeapon,info);
}
return base.ActualUse(target);
}
示例2: ActualUse
public override bool ActualUse(Pawn target)
{
foreach (AmmoBoxPicker abp in ammoList) {
target.GetComponent<InventoryManager> ().AddAmmo (abp.ammo, abp.amount);
}
return base.ActualUse(target);
}
示例3: OnPawnSpawned
public void OnPawnSpawned(Pawn pawn)
{
if( !pawn.isEnemy )
{
playerPawn = pawn.GetComponent<PawnPlayer>();
if( playerPawn )
{
mc = playerPawn.gameObject;
Debug.Log("Found player pawn component");
}
playerController = pawn.GetComponent<PawnPlayerController>();
if( playerController )
{
Debug.Log("Found player controller component");
}
}
}
示例4: ActualUse
public override bool ActualUse(Pawn target)
{
target.GetComponent<InventoryManager>().AddAmmo(ammo,amount);
return base.ActualUse(target);
}
示例5: AfterSpawnSetting
public void AfterSpawnSetting(Pawn pawn,PawnType type,int rTeam)
{
if (photonView.isMine) {
photonView.RPC("RPCAfterSpawnSetting",PhotonTargets.AllBuffered,pawn.GetComponent<PhotonView>().viewID,(int)type,rTeam);
}
}
示例6: PawnBecameVisible
public void PawnBecameVisible(Pawn newPawn)
{
if(!pawnsOnScreen.Contains(newPawn)) {
pawnsOnScreen.Add(newPawn);
BotBase bot = newPawn.GetComponent<BotBase>();
if(bot != null) {
bot.Wakeup();
}
}
}
示例7: PawnBecameInvisible
public void PawnBecameInvisible(Pawn oldPawn)
{
if (pawnsOnScreen.Contains(oldPawn)) {
pawnsOnScreen.Remove(oldPawn);
BotBase bot = oldPawn.GetComponent<BotBase>();
if(bot != null) {
bot.SetAsleep();
}
}
}