Exemplo n.º 1
0
 public Weapon(string datablockName, Body body, Transform transform, Scene scene)
 {
     this.ignorePred = new IgnoreSkinPredicate(body);
     this.scene = scene;
     this.datablock = ResourceManager.Inst.GetWeaponDatablock(datablockName);
     this.fpsModel = new ViewModel(datablock.MeshName);
     this.fpsModel.SetRenderAlways(true, scene);
     this.ammo = datablock.AmmoPerClip;
     this.ReserveAmmo = datablock.DefaultAmmo;
     fpsModel.SetTransform(transform);
     fpsModel.SetCustomMatrix(datablock.CustomMatrix);
     fpsModel.GetAnimationLayer().SetActiveAnimation(datablock.GetAnimation(WeaponAnimations.Idle), true);
 }
Exemplo n.º 2
0
 public WeaponDatablock[] GetWeaponDatablocks()
 {
     WeaponDatablock[] datablocks = new WeaponDatablock[resources[(int)ResourceTypes.WeaponDatablock].Count];
     resources[(int)ResourceTypes.WeaponDatablock].Values.CopyTo(datablocks, 0);
     return datablocks;
 }