public void init() { mManagerObject = UnityUtility.getGameObject(mGameFramework.getGameFrameObject(), "CharacterManager"); if (mManagerObject == null) { UnityUtility.logError("can not find Character Manager under GameFramework!"); } mCharacterFactoryManager.addFactory <Character>(CHARACTER_TYPE.CT_NORMAL); mCharacterFactoryManager.addFactory <CharacterNPC>(CHARACTER_TYPE.CT_NPC); mCharacterFactoryManager.addFactory <CharacterOther>(CHARACTER_TYPE.CT_OTHER); mCharacterFactoryManager.addFactory <CharacterMyself>(CHARACTER_TYPE.CT_MYSELF); if (mCharacterFactoryManager.getFactoryCount() != (int)CHARACTER_TYPE.CT_MAX) { UnityUtility.logError("not all character registered!"); } }
public void registeCharacter <T>(CHARACTER_TYPE type) where T : Character { mCharacterFactoryManager.addFactory <T>(type); }