コード例 #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);
 }
コード例 #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);
     }
 }