Example #1
0
    public MonsterInfo(int creatureIndexId, int creatureId, PathInfo _pathInfo)
    {
        Id           = creatureIndexId;
        charId       = creatureId;
        creatureData = J_Creature.GetData(charId);
        charName     = creatureData._modelName;
        if (charName == null)
        {
            Debug.LogError("MonsterModelName" + charId + " is NULL");
        }

        creatureStateMachine = new StateMachine();
        creatureAtk          = new CreatureAtk(this);
        creatureDead         = new CreatureDead(this);
        creatureIdle         = new CreatureIdle(this);
        creatureMove         = new CreatureMove(this);

        hpMax        = creatureData._hp;
        hp           = hpMax;
        attackSpeed  = creatureData._attackSpeed;
        attackDamage = creatureData._attackDamage;
        defenceType  = creatureData._defenceType;
        attackSkill  = SkillManager.getInstance().AddSkill(1, this);
        pathInfo     = _pathInfo;
        curPathNum   = 0;
        //设置初始位置
        position = pathInfo.GetPoint(curPathNum);

        attackTime = AnimationCache.getInstance().getAnimation(charName).getMeshAnimation("attack").getAnimTime();
    }
Example #2
0
 public void InitStatusMachine()
 {
     creatureStateMachine = new StateMachine();
     creatureAtk          = new CreatureAtk(this);
     creatureDead         = new CreatureDead(this);
     creatureIdle         = new CreatureIdle(this);
     creatureMove         = new CreatureMove(this);
 }