Ejemplo n.º 1
0
 public void AddStageObject(StageObjectCategory category, int id, BaseStageObject obj)
 {
     stageObjects[category].Add(id, obj);
     if (id > maxIDs[category])
     {
         maxIDs[category] = id;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到能够构建出给定StageObject的BuildInfo,通用方法
 /// </summary>
 /// <param name="obj">给定的StageObject</param>
 /// <returns></returns>
 public BaseBuildInfo GenerateBuildInfo(BaseStageObject obj)
 {
     /*
      * if (obj.prefabName == string.Empty && obj.builder == null)
      * {
      *  Debug.Log("StageObject的Prefab信息缺失,无法生成info");
      *  return null;
      * }
      */
     return(GenerateInfo((T)obj));
 }
Ejemplo n.º 3
0
        public void RemoveFromTeam(int playerID, int playerScore = -1)
        {
            BaseStageObject obj = StageManager.instance.GetStageObject(StageObjectCategory.Player, playerID);

            if (obj)
            {
                Player player = obj as Player;
                if (playerScore > 0)
                {
                    player.Score = playerScore;
                }
                RemoveFromTeam(player);
            }
        }
Ejemplo n.º 4
0
        public BaseStageObject RemoveStageObject(StageObjectCategory category, int id)
        {
            BaseStageObject obj = GetStageObject(category, id);

            if (obj)
            {
                obj.LastWord(); //遗言
                stageObjects[category].Remove(id);
                if (maxIDs[category] == id)
                {
                    maxIDs[category]--; //或许能让maxid增长慢一点,估计没啥效果
                }
            }
            return(obj);
        }