Ejemplo n.º 1
0
    public override void Fire(PhotonMessageInfo info)
    {
        float            lag   = (float)(PhotonNetwork.Time - info.SentServerTime);
        TorpedoBehaviour _shot = bulletPool.Dequeue();

        _shot.gameObject.SetActive(true);
        _shot.GetComponent <TorpedoBehaviour>().FireTorpedo(pb, sbb.GetCannonPlace.transform.position + sbb.GetCannonPlace.transform.right, Quaternion.LookRotation(pb.SubMesh.transform.right, pb.SubMesh.transform.up), lag);
        bulletPool.Enqueue(_shot);
    }
Ejemplo n.º 2
0
    private void CreateBulletPool()
    {
        GameObject _bul = Instantiate(projectilePrefab.gameObject, transform.position, Quaternion.identity, bulletsParent.transform);

        _bul.SetActive(false);
        TorpedoBehaviour _behav = _bul.GetComponent <TorpedoBehaviour>();

        _behav.CreatePool(pb.PlayerName, GameManager.SP.GetPlayerB.GetPlayerColor);
        bulletPool.Enqueue(_behav);
    }