コード例 #1
0
        private void M_OnDestroy(object sender, OnDestroyEventArgs e)
        {
            Monster monster = (Monster)e.destroyTarget;
            Reward  reward  = monster.Reward;

            Experience += reward.exp;
            foreach (Item item in reward.items)
            {
                Inventory.AddItem(item);
            }
            monster.OnDestroy -= M_OnDestroy;
        }
コード例 #2
0
ファイル: MapController.cs プロジェクト: Level1Rookie/TextRPG
 private static void GameEntity_OnDestroy(object sender, OnDestroyEventArgs e)
 {
     if (bindings.ContainsKey(e.destroyTarget))
     {
         Vector2 destroyPosition = e.destroyTarget.Position;
         bindings[e.destroyTarget].SetChar(destroyPosition, groundChar[e.destroyTarget]);
         groundChar.Remove(e.destroyTarget);
         UnBind(e.destroyTarget);
     }
     else
     {
         throw new Exception(string.Format("Destroy Target {0} doesn't exists", e.destroyTarget.name));
     }
 }
コード例 #3
0
 private void Ge_OnDestroy(object sender, OnDestroyEventArgs e)
 {
     gameEntities.Remove(e.destroyTarget);
 }