本文整理汇总了C#中GameEvents.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# GameEvents.GetType方法的具体用法?C# GameEvents.GetType怎么用?C# GameEvents.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameEvents
的用法示例。
在下文中一共展示了GameEvents.GetType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("Restart"))
{
Application.LoadLevel(2);
}
if(e.GetType().Name.Equals("Win"))
{
Invoke ("TriggerWin", 3f);
}
}
示例2: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("EnterRoom"))
{
target = ((EnterRoom) e).getNewRoom();
}
if(e.GetType ().Name.Equals("CameraShake"))
{
jiggleAmt = ((CameraShake) e).getAmount();
StartCoroutine(jiggleCam2(((CameraShake) e).getDuration()));
}
}
示例3: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("UpdateHud"))
{
updateHud();
}
}
示例4: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("CelebrateEvent"))
{
confetti.Play();
}
}
示例5: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("PassGateEvent"))
{
PassGate();
}
}
示例6: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("CelebrateEvent"))
{
GetComponent<BalloonFaceAnim>().Celebrate();
}
}
示例7: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("BackgroundScrollEvent"))
{
amountToMoveX += ((BackgroundScrollEvent) e).MoveX;
amountToMoveY += ((BackgroundScrollEvent) e).MoveY;
}
}
示例8: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
string gateExistScreenEventName = "GateExitScreenEvent";
if(e.GetType().Name.Equals(gateExistScreenEventName))
{
AddGateToPool(((GateExitScreenEvent) e).GetGate());
}
}
示例9: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("InputEvent"))
{
InputEvent inputEvent = (InputEvent) e;
GetInput(inputEvent.GetDevice());
}
}
示例10: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("DamagePlayer"))
{
int damage = ((DamagePlayer) e).getDamageValue();
bool doKnockback = !(tookDamage || invunerable) && ((DamagePlayer) e).bounceAfterTakingDamage();
doDamage(damage);
if(doKnockback)
{
GameObject damager = ((DamagePlayer) e).getDamager();
if(damager.tag.Equals("Enemy"))
{
Vector2 direction = new Vector2(transform.position.x - damager.transform.position.x,
transform.position.y - damager.transform.position.y);
rigidbody2D.AddForce(direction * bounceForce);
}
else
{
Vector2 direction = rigidbody2D.velocity.normalized * -1;;
rigidbody2D.AddForce(direction * bounceForce);
}
}
}
else if(e.GetType().Name.Equals("EnterRoom"))
{
bool isFirstTime = ((EnterRoom) e).isFirstTime();
if(isFirstTime)
{
gainShieldCharge();
}
}
else if(e.GetType().Name.Equals("CollectPower"))
{
shipSounds.playPowerup();
int type = ((CollectPower) e).getPowerupType();
if(type == 1)
{
gainShield();
}
else if(type == 2)
{
gainDamage();
}
else if(type == 3)
{
gainRateofFire();
}
else if(type == 4)
{
has5Shot = true;
}
}
}
示例11: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("InputEvent"))
{
InputEvent inputEvent = (InputEvent) e;
if(inputEvent.GetPlayerNumber() == playerNumber)
{
GetInput(inputEvent.GetDevice());
}
}
}