Example #1
0
        /// <summary>
        ///  <see cref="T:Character.Enemy"/> classのコンストラクタ
        /// </summary>
        /// <param name="builder">このキャラクターの初期設定を保持するEnemyBuilerクラス</param>
        public Enemy(EnemyBuilder builder)
        {
            this.ID             = builder.getId();
            this.NAME           = builder.getName();
            this.abilities      = builder.getAbilities();
            this.DEF            = builder.getDef();
            this.LV             = builder.getLevel();
            this.NORMAL_DROP_ID = builder.getNormalDropId();
            this.RARE_DROP_ID   = builder.getRareDropId();
            this.MODEL_ID       = builder.getModelName();
            this.FACTION        = builder.getFaction();

            this.MAX_HP = builder.getMaxHp();

            this.MAX_MP = builder.getMaxMp();

            this.hp = MAX_HP;
            this.mp = MAX_MP;

            GameObject prefab     = (GameObject)Resources.Load(MODEL_ID);
            GameObject gameobject = MonoBehaviour.Instantiate(prefab);

            this.container = gameobject.GetComponent <Container> ();
            container.setCharacter(this);

            this.UNIQE_ID = UniqueIdCreator.creatUniqueId();

            activeSkillSet   = ActiveSkillSetMasterManager.getInstance().getActiveSkillSetFromId(builder.getActiveSkillSetId(), this);
            reactionSkillSet = ReactionSkillSetMasterManager.getInstance().getReactionSkillSetFromId(builder.getReactionSkillSetId());
            this.ai          = EnemyAISummarizingManager.getInstance().getAiFromId(builder.getAiId(), this, activeSkillSet, reactionSkillSet);

            attributeResistances = builder.getAttributeRegists();
            observer             = new EnemyObserver(ID);
        }