示例#1
0
    public override void InjectVO(UnitVO input)
    {
        type = ComponentType.Movement;
        switch (input.type)
        {
        case UnitType.creature:
            CreatureVO vo = input as CreatureVO;
            data.position = vo.positon;
            data.forward  = vo.forward;
            data.speed    = vo.speed;
            data.movetype = vo.movetype;
            data.bodySize = vo.bodysize;
            data.type     = UnitType.creature;
            break;

        case UnitType.effect:
            EffectVO evo = input as EffectVO;
            data.position = evo.positon;
            data.forward  = evo.forward;
            data.speed    = evo.speed;
            data.movetype = evo.movetype;
            data.bodySize = evo.bodysize;
            data.type     = UnitType.effect;
            break;
        }
    }
示例#2
0
 public override void InjectVO(UnitVO input)
 {
     type = ComponentType.Avatar;
     switch (input.type)
     {
     case UnitType.creature:
         CreatureVO vo = input as CreatureVO;
         foreach (var an in vo.anims)
         {
             Dictionary <AnimType, AnimationData> diction = new Dictionary <AnimType, AnimationData>();
             AnimationData data = new AnimationData();
             if (!animations.TryGetValue(an.avatarType, out diction))
             {
                 if (!diction.TryGetValue(an.animationType, out data))
                 {
                     data = an;
                 }
                 else
                 {
                     data = new AnimationData();
                     data = an;
                     diction.Add(an.animationType, data);
                 }
             }
             else
             {
                 diction = new Dictionary <AnimType, AnimationData>();
                 data    = new AnimationData();
                 diction.Add(an.animationType, data);
                 data = an;
             }
         }
         break;
     }
 }
示例#3
0
 public override void InjectVO(UnitVO input)
 {
     type = ComponentType.Health;
     switch (input.type)
     {
     case UnitType.creature:
         CreatureVO vo = input as CreatureVO;
         basedata.hp        = vo.hp;
         basedata.maxHp     = vo.maxHp;
         basedata.attr      = vo.attr;
         basedata.physicDef = vo.physicDef;
         basedata.magicDef  = vo.magicDef;
         realdata.hp        = vo.hp;
         realdata.maxHp     = vo.maxHp;
         realdata.attr      = vo.attr;
         realdata.physicDef = vo.physicDef;
         realdata.magicDef  = vo.magicDef;
         break;
     }
 }