Esempio n. 1
0
 // Instantiates arrow and particle effects
 void spawnVFX(bool _hitScan)
 {
     if (!isLocalPlayer)
     {
         return;
     }
     if (firePoint != null)
     {
         GameObject MoveArrow;
         MoveArrow = Instantiate(effectToSpawn, firePoint.transform.position, Quaternion.identity);
         MoveArrow.GetComponent <MoveArrow>().nameTag = transform.name;
         MoveArrow.transform.localRotation            = firstPerson.GetCamRotation();
         MoveArrow.GetComponent <MoveArrow>().UpdateSpeed(increaseSpeed, _hitScan, gameObject);
         print(isClient + " client | server " + isServer);
         if (isClient && !isServer)
         {
             CmdOnShoot(increaseSpeed, _hitScan);
         }
         else
         {
             RpcDoShootEffect(increaseSpeed, _hitScan);
         }
     }
     else
     {
         Debug.Log("No fire point!");
     }
 }
Esempio n. 2
0
    void RpcDoShootEffect(float increaseSpeed, bool _hitScan)
    {
        if (isLocalPlayer)
        {
            return;
        }
        GameObject MoveArrow;

        MoveArrow = Instantiate(vfx[1], firePoint.transform.position, Quaternion.identity);
        MoveArrow.transform.localRotation = firstPerson.GetCamRotation();
        MoveArrow.GetComponent <MoveServerArrow>().UpdateSpeed(increaseSpeed, _hitScan, null);
        increaseSpeed = speed;
    }