Ejemplo n.º 1
0
 override public void Fire <T> (T props, Weapon weapon)
 {
     this.Weapon        = weapon;
     attr               = props as SphereAttr;
     transform.position = attr.Pos;
     rb.AddForce(attr.Dir * (weapon as PaintballMarker).ForceAmount, ForceMode.Impulse);
 }
Ejemplo n.º 2
0
 void Update()
 {
     if (bShootPerformed && Timer.IsFinished)
     {
         Parent.LookAtCrosshair();
         Timer.Reset();
         GameObject o        = LeanPool.Spawn(BulletPrefab);
         Paintball  pb       = o.GetComponent <Paintball>();
         SphereAttr passAttr = new SphereAttr(ShootPoint.position, attr.Length, (Crosshair.position - ShootPoint.position).normalized);
         pb.Fire <SphereAttr>(passAttr, this);
     }
 }