void HandleTreasureUpdateAfterEnemyDies() { foreach (GameObject e in EnemyMgr.inst.enemies) { Entity381 enemy_entity = e.GetComponent <Entity381>(); if (enemy_entity.currentHealth == 0 && !enemy_entity.dead) { treasure_count += 1; e.SetActive(false); enemy_entity.dead = true; } } }
// Update is called once per frame void Update() { foreach (GameObject e in enemies) { Entity381 enemy_entity = e.GetComponent <Entity381>(); if (Vector3.Distance(enemy_entity.position, ControlMgr.inst.player_entity.position) > 50) { Intercept m = new Intercept(enemy_entity, ControlMgr.inst.player_entity.position, 50); enemy_entity.SetCommand(m); } else { } } }
public Command(Entity381 ent) { entity = ent; }
public Follow(Entity381 src, Entity381 dst) : base(src) { source = src; destination = dst; }
public Intercept(Entity381 src, Entity381 dst, int d) : base(src) { source = src; destination = dst; distance = d; }
public Move(Entity381 e, Vector3 pos, float d) : base(e) { ent = e; targetPosition = pos; deltaDistance = d; }