コード例 #1
0
ファイル: GameMgr.cs プロジェクト: ryan-tech/BattleBoats
 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;
         }
     }
 }
コード例 #2
0
ファイル: EnemyMgr.cs プロジェクト: ryan-tech/BattleBoats
 // 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
         {
         }
     }
 }
コード例 #3
0
 public Command(Entity381 ent)
 {
     entity = ent;
 }
コード例 #4
0
 public Follow(Entity381 src, Entity381 dst) : base(src)
 {
     source      = src;
     destination = dst;
 }
コード例 #5
0
 public Intercept(Entity381 src, Entity381 dst, int d) : base(src)
 {
     source      = src;
     destination = dst;
     distance    = d;
 }
コード例 #6
0
ファイル: Move.cs プロジェクト: ryan-tech/BattleBoats
 public Move(Entity381 e, Vector3 pos, float d) : base(e)
 {
     ent            = e;
     targetPosition = pos;
     deltaDistance  = d;
 }