本文整理汇总了C#中GameObjectType类的典型用法代码示例。如果您正苦于以下问题:C# GameObjectType类的具体用法?C# GameObjectType怎么用?C# GameObjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameObjectType类属于命名空间,在下文中一共展示了GameObjectType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEnemyKS
public static Obj_AI_Base GetEnemyKS(GameObjectType type, AttackSpell spell, bool EwithQ = false)
{
float range = 0;
if (spell == AttackSpell.Q)
range = Program.Q.Range;
else if (spell == AttackSpell.E)
range = Program.E.Range + 200;
else if (spell == AttackSpell.Ignite)
range = Program.Ignite.Range;
else if (spell == AttackSpell.R)
range = int.MaxValue;
//ksing
return ObjectManager.Get<Obj_AI_Base>().OrderBy(a => a.Health).Where(a => a.IsEnemy
&& a.Type == type
&& a.Distance(GP) <= range
&& !a.IsDead
&& !a.IsInvulnerable
&& a.Name != "Barrel"
&& a.IsValidTarget(range)
&&
(
(a.Health <= GPCalcs.Q(a) && AttackSpell.Q == spell && !NearbyBarrel(350, a.Position)) ||
(a.Health <= GPCalcs.E(a, EwithQ) && AttackSpell.E == spell) ||
(a.Health <= (GPCalcs.RDamagePerWave(a) * 8) && AttackSpell.R == spell) ||
(a.Health <= GPCalcs.Ignite(a) && AttackSpell.Ignite == spell)
)).FirstOrDefault();
}
示例2: CreateNewObject
public GameObject CreateNewObject(GameObjectType type)
{
GameObject go = null;
switch (type)
{
case GameObjectType.Stone:
go = GameObject.Instantiate(ObjectPoolObjects.Instance.Stones[UnityEngine.Random.Range(0, ObjectPoolObjects.Instance.Stones.Count)]);
break;
case GameObjectType.Tree:
go = GameObject.Instantiate(ObjectPoolObjects.Instance.Trees[UnityEngine.Random.Range(0, ObjectPoolObjects.Instance.Trees.Count)]);
break;
case GameObjectType.Decoration:
//go = GameObject.Instantiate(MapGenerator.GetInstance().decoration[UnityEngine.Random.Range(0, MapGenerator.GetInstance().decoration.Count)]);
break;
}
if (go != null)
{
PoolList list = this.GetList(type);
if (list != null)
{
list.AddGameObject(go);
}
}
return go;
}
示例3: GetEnemy
public static Obj_AI_Base GetEnemy(GameObjectType type, AttackSpell spell)
{
var eminion =
EntityManager.MinionsAndMonsters.GetJungleMonsters(Program.Eve.Position, Program.E.Range)
.FirstOrDefault(
m =>
m.Distance(Program.Eve) <= Program.E.Range &&
m.Health <= Misc.Ecalc(m) &&
m.IsValidTarget());
if (Program.E.IsReady() && Program.LaneJungleClear["LCE"].Cast<CheckBox>().CurrentValue && eminion != null &&
!Orbwalker.IsAutoAttacking)
{
Program.E.Cast(eminion);
}
if (spell == AttackSpell.Q)
{
return ObjectManager.Get<Obj_AI_Base>().OrderBy(a => a.Health).FirstOrDefault(a => a.IsEnemy
&& a.Type == type
&&
a.Distance(Evelynn) <=
Program.Q.Range
&& !a.IsDead
&& !a.IsInvulnerable
&&
a.IsValidTarget(
Program.Q.Range)
&&
a.Health <=
Misc.Qcalc(a));
}
return null;
}
示例4: MinionLh
public static Obj_AI_Base MinionLh(GameObjectType type, AttackSpell spell)
{
return EntityManager.MinionsAndMonsters.EnemyMinions.OrderBy(a => a.Health).FirstOrDefault(a => a.IsEnemy
&&
a.Type ==
type
&&
a.Distance(
Vladimir) <=
Program.Q
.Range
&& !a.IsDead
&&
!a
.IsInvulnerable
&&
a
.IsValidTarget
(
Program
.Q
.Range)
&&
a.Health <=
Misc.Qdmg(a));
}
示例5: GetBestELocation
public static Obj_AI_Base GetBestELocation(GameObjectType type)
{
var numEnemiesInRange = 0;
Obj_AI_Base enem = null;
foreach (var enemy in ObjectManager.Get<Obj_AI_Base>()
.OrderBy(a => a.Health)
.Where(a => a.Distance(Vladimir) <= Program.E.Range
&& a.IsEnemy
&& a.Type == type
&& !a.IsDead
&& !a.IsInvulnerable))
{
var tempNumEnemies =
ObjectManager.Get<Obj_AI_Base>()
.OrderBy(a => a.Health)
.Where(
a =>
a.Distance(Vladimir) <= Program.E.Range && a.IsEnemy && !a.IsDead && a.Type == type &&
!a.IsInvulnerable)
.Count(enemy2 => enemy != enemy2 && enemy2.Distance(enemy) <= 75);
if (tempNumEnemies > numEnemiesInRange)
{
enem = enemy;
numEnemiesInRange = tempNumEnemies;
}
}
return enem;
}
示例6: Create
public void Create(int gameObjectId, GameObjectType gameObjectType, Vector2 position, Vector2 velocity)
{
GameObjectType = gameObjectType;
GameObjectId = gameObjectId;
Position = position;
Velocity = velocity;
}
示例7: GetEnemyKS
public static Obj_AI_Base GetEnemyKS(GameObjectType type, AttackSpell spell)
{
float range = 0;
if (spell == AttackSpell.W)
range = Program.W.Range;
else if (spell == AttackSpell.R)
range = Program.R.Range + (Program.R.Width /2);
else if (spell == AttackSpell.Q)
range = Program.Q.Range;
else if (spell == AttackSpell.Ignite)
range = Program.Ignite.Range;
//ksing
return ObjectManager.Get<Obj_AI_Base>().OrderBy(a => a.Health).Where(a => a.IsEnemy
&& a.Type == type
&& a.Distance(Annie) <= range
&& !a.IsDead
&& !a.IsInvulnerable
&& a.IsValidTarget(range)
&&
(
(a.Health <= AnnieCalcs.W(a) && AttackSpell.W == spell) ||
(a.Health <= AnnieCalcs.Q(a) && AttackSpell.Q == spell) ||
(a.Health <= AnnieCalcs.R(a) && AttackSpell.R == spell) ||
(a.Health <= AnnieCalcs.Ignite(a) && AttackSpell.Ignite == spell)
)).FirstOrDefault();
}
示例8: GetEnemyKS
public static Obj_AI_Base GetEnemyKS(GameObjectType type, AttackSpell spell)
{
float range = 0;
if (spell == AttackSpell.Q)
range = Program.Q.Range;
else if (spell == AttackSpell.E)
range = Program.E.Range;
else if (spell == AttackSpell.W)
range = Program.W.Range;
else if (spell == AttackSpell.Ignite)
range = Program.Ignite.Range;
//ksing
return ObjectManager.Get<Obj_AI_Base>().OrderBy(a => a.Health).Where(a => a.IsEnemy
&& a.Type == type
&& a.Distance(Ryze) <= range
&& !a.IsDead
&& !a.IsInvulnerable
&& a.IsValidTarget(range)
&&
(
(a.Health <= RyzeCalcs.W(a) && AttackSpell.W == spell) ||
(a.Health <= RyzeCalcs.Q(a) && Program.Q.GetPrediction(a).HitChance >= HitChance.Low && AttackSpell.Q == spell) ||
(a.Health <= RyzeCalcs.E(a) && AttackSpell.E == spell) ||
(a.Health <= RyzeCalcs.Ignite(a) && AttackSpell.Ignite == spell)
)).FirstOrDefault();
}
示例9: MinionWlh
private static Obj_AI_Base MinionWlh(GameObjectType type, AttackSpell spell)
{
return EntityManager.MinionsAndMonsters.EnemyMinions.OrderBy(a => a.Health).FirstOrDefault(a => a.IsEnemy
&&
a.Type ==
type
&&
a.Distance(
Kennen) <=
Program.W
.Range
&& !a.IsDead
&&
!a
.IsInvulnerable
&&
a
.IsValidTarget
(
Program
.W
.Range)
&&
a.Health <=
Misc.Wcalc(a));
}
示例10: GetAlly
// Grab Ally
public static Obj_AI_Base GetAlly(float range, GameObjectType gametype)
{
return ObjectManager.Get<Obj_AI_Base>()
.OrderBy(a => a.Health).FirstOrDefault(a => a.IsAlly
&& a.Type == gametype && !Player.IsRecalling()
&& !a.IsDead && a.IsValidTarget(range) && !a.IsInvulnerable
&& a.Distance(Player) <= range);
}
示例11: GameObject
/// <summary>
/// Construct a game object and insert it into an object table.
/// </summary>
/// <param name="ObjectId">The engine object id.</param>
/// <param name="ObjectType">The object type code.</param>
/// <param name="ObjectManager">The object manager to attach the object
/// to.</param>
public GameObject(uint ObjectId, GameObjectType ObjectType, GameObjectManager ObjectManager)
{
this.GameObjectId = ObjectId;
this.GameObjectTypeCode = ObjectType;
this.ObjectManager = ObjectManager;
ObjectManager.AddGameObject(this);
}
示例12: GetEnemy
public static Obj_AI_Base GetEnemy(float range, GameObjectType t)
{
switch (t)
{
default:
return EntityManager.Heroes.Enemies.OrderBy(a => a.Health).FirstOrDefault(
a => a.Distance(Player.Instance) < range && !a.IsDead && !a.IsInvulnerable);
}
}
示例13: GameObject
/// <summary>
/// Creates an instance of a game object using the specified type and content.
/// </summary>
/// <param name="type">The type of game object to create.</param>
/// <param name="spriteContent">The image content to use for the game object's sprite.</param>
public GameObject(GameObjectType type, string spriteContent)
: this()
{
// Set the type of game object
Type = type;
// Initialize the sprite with the specified content
InitWithFile(spriteContent);
}
示例14: GetEnemy
public static Obj_AI_Base GetEnemy(float range, GameObjectType type)
{
return ObjectManager.Get<Obj_AI_Base>().OrderBy(a => a.Health).Where(a => a.IsEnemy
&& a.Type == type
&& a.Distance(Annie) <= range
&& !a.IsDead
&& !a.IsInvulnerable
&& a.IsValidTarget(range)).FirstOrDefault();
}
示例15: Projectile
public Projectile(Game game, Model model, Vector3 pos, Vector3 vel, GameObjectType targetType)
: base(game)
{
this.model = model;
this.pos = pos;
this.vel = vel;
this.targetType = targetType;
squareHitRadius = hitRadius * hitRadius;
}