コード例 #1
0
ファイル: EntityManager.cs プロジェクト: pixar2016/Assets
    public SoliderInfo AddSolider(int soliderId)
    {
        soliderIndexId += 1;
        if (!soliderPrototypes.ContainsKey(soliderId))
        {
            soliderPrototypes.Add(soliderId, new CharacterPrototype(soliderId, CharacterType.Solider));
        }
        CharacterPrototype proto    = soliderPrototypes[soliderId];
        SoliderInfo        charInfo = proto.CloneSolider(soliderIndexId);

        //soliders.Add(soliderIndexId, charInfo);
        //标记为“添加”
        charInfo.SetDirtySign(false);
        soliderTempList.Add(soliderIndexId, charInfo);
        this.eventDispatcher.Broadcast("AddSolider", charInfo);
        return(charInfo);
    }