本文整理汇总了C#中GameObject.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.GetType方法的具体用法?C# GameObject.GetType怎么用?C# GameObject.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameObject_OnCreate
private static void GameObject_OnCreate(GameObject sender, EventArgs args)
{
if (!sender.IsValid || !sender.Name.Contains("Baron"))
return;
if (sender.Name.Contains("Minion") || sender.Name.Contains("_Turret_Cas.troy") || sender.Name.Contains("SRU") || sender.GetType().Name == "MissileClient" || sender.Name.Contains("FeelNoPain") || sender.Name.Contains("crystal_beam"))
return;
Console.WriteLine("Add\tType: {0} | Name: {1} | NetID: {2} | objectName: {3}", sender.GetType().Name, sender.Name, sender.NetworkId, sender.BaseObjectName());
}
示例2: OnTouch
internal override void OnTouch(GameObject touchedObject)
{
if (touchedObject.GetType() == typeof(Marimo) && Marimo.IsStarMario((Marimo)touchedObject))
{
UpsideDownDeath();
}
else if (touchedObject.GetType() == typeof(Shell) && Shell.ShellIsMoving((Shell)touchedObject))
{
UpsideDownDeath();
}
}
示例3: GameObject_OnDelete
private static void GameObject_OnDelete(GameObject sender, EventArgs args)
{
if (!sender.IsValid || !sender.Name.Contains("Baron"))
return;
if (sender.Name.Contains("NAV") || sender.Name.Contains("Odin") || sender.Name.Contains("Shopkeeper") ||
sender.GetType().Name == "MissileClient" || sender.GetType().Name == "DrawFX" || sender.Name.Contains("empty.troy") || sender.Name.Contains("LevelProp")
|| sender.Name.Contains("FeelNoPain") || sender.Name.Contains("LaserSight") || sender.Name.Contains("SRU"))
return;
Console.WriteLine("Delete\tType: {0} | Name: {1}", sender.GetType().Name, sender.Name);
}
示例4: OnCreateObj_FizzMarinerDoom
private static void OnCreateObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
{
if (obj.GetType() != typeof(MissileClient) || !((MissileClient) obj).IsValidMissile())
return;
MissileClient missile = (MissileClient)obj;
if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
missile.SData.Name == "FizzMarinerDoomMissile")
{
SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
spellData, null, 500, true, SpellType.Circular, false, spellData.SecondaryRadius);
/*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
{
var spell = entry.Value;
if (spell.info.spellName == "FizzMarinerDoom" &&
spell.spellObject != null && spell.spellObject.NetworkId == missile.NetworkId)
{
if (spell.spellType == SpellType.Circular)
{
spell.spellObject = null;
}
}
}*/
}
}
示例5: OnTouch
internal override void OnTouch(GameObject touchedObject)
{
if (touchedObject.GetType().Name == "Fireball")
{
UpsideDownDeath();
FireballExplode((Fireball)touchedObject);
}
else if (touchedObject.GetType() == typeof(Marimo) && Marimo.IsStarMario((Marimo)touchedObject))
{
UpsideDownDeath();
}
else if (touchedObject.GetType().Name == "Shell" && Shell.ShellIsMoving((Shell)touchedObject))
{
UpsideDownDeath();
}
}
示例6: validateCase
//------------------------------------------------------------------------------------------------------------------------
// validateCase()
//------------------------------------------------------------------------------------------------------------------------
private void validateCase(GameObject gameObject)
{
MethodInfo info = gameObject.GetType().GetMethod("Update", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (info != null) {
throw new Exception("'Update' function was not binded for '" + gameObject + "'. Please check it's case. (capital U?)");
}
}
示例7: OnCreate
private static void OnCreate(GameObject sender, EventArgs args)
{
#if DEBUG
Console.WriteLine("Type: {0} | Name: {1}", sender.GetType().Name, sender.Name);
#endif
foreach (var avoidObject in ObjectDatabase.AvoidObjects)
{
var baseObject = sender as Obj_AI_Base;
var objectName = baseObject == null ? sender.Name : baseObject.BaseSkinName;
if (avoidObject.ObjectName == objectName)
{
#if !DEBUG
if (!string.IsNullOrWhiteSpace(avoidObject.BuffName) && !sender.IsEnemy)
{
continue;
}
#endif
// Fire the event
if (OnAvoidObjectAdded != null)
{
OnAvoidObjectAdded(sender, avoidObject);
}
break;
}
}
}
示例8: CheckType
public static string CheckType(GameObject obj)
{
if (obj.GetType() == typeof(BulletBill))
{
return "BulletBill";
}
if (obj.GetType() == typeof(Goomba))
{
return "Goomba";
}
if (obj.GetType() == typeof(KoopaGreen))
{
return "KoopaGreen";
}
return "GameObject";
}
示例9: OnTouch
internal override void OnTouch(GameObject touchedObject)
{
if (touchedObject.GetType().Name == "Marimo")
{
shouldRemove = true;
Player.AddPoints(points);
}
}
示例10: OnSideCollision
public override void OnSideCollision(GameObject touchedObject)
{
if (touchedObject.GetType().Namespace == "SuperMarimoBros.Blocks")
{
Explode();
}
base.OnSideCollision(touchedObject);
}
示例11: OnHeadbutt
public override void OnHeadbutt(GameObject touchedObject)
{
if (touchedObject.GetType() == typeof(Marimo))
{
this.shouldRemove = true;
World.AddObject(new Shell(position, false));
}
base.OnHeadbutt(touchedObject);
}
示例12: OnSideCollision
public override void OnSideCollision(GameObject touchedObject)
{
if (touchedObject.GetType().Name == "Marimo")
{
Kick(touchedObject);
}
else
base.OnSideCollision(touchedObject);
}
示例13: OnHeadbutt
public override void OnHeadbutt(GameObject touchedObject)
{
if (touchedObject.GetType().Name == "Marimo")
{
wasStomped = true;
Player.AddPoints(points);
}
base.OnHeadbutt(touchedObject);
}
示例14: OnTouch
internal override void OnTouch(GameObject touchedObject)
{
if (touchedObject.GetType() == typeof(Marimo))
{
Player.AddCoin();
shouldRemove = true;
}
base.OnTouch(touchedObject);
}
示例15: OnStomp
public override void OnStomp(GameObject touchedObject)
{
if (touchedObject.GetType().Namespace == "SuperMarimoBros.Blocks")
{
velocity.Y = -150f;
}
base.OnStomp(touchedObject);
isOnSolidTile = false;
}