public void WeaponStoppedFiring(Packet packet)
    {
        Message_WeaponStoppedFiring message = ((PacketSingle)packet).message as Message_WeaponStoppedFiring;

        if (message.UID != networkUID)
        {
            return;
        }
        weaponManager.EndFire();
    }
Esempio n. 2
0
    private void Awake()
    {
        lastMessage              = new Message_PlaneUpdate(false, 0, 0, 0, 0, 0, 0, false, false, networkUID);
        lastFiringMessage        = new Message_WeaponFiring(-1, networkUID);
        lastStoppedFiringMessage = new Message_WeaponStoppedFiring(networkUID);


        wheelsController = GetComponent <WheelsController>();
        aeroController   = GetComponent <AeroController>();
        vRThrottle       = gameObject.GetComponentInChildren <VRThrottle>();
        if (vRThrottle == null)
        {
            Debug.Log("Cound't find throttle");
        }
        else
        {
            vRThrottle.OnSetThrottle.AddListener(SetThrottle);
        }

        weaponManager = GetComponent <WeaponManager>();
        if (weaponManager == null)
        {
            Debug.LogError("Weapon Manager was null on our vehicle");
        }
        cmManager = GetComponentInChildren <CountermeasureManager>();
        if (cmManager == null)
        {
            Debug.LogError("CountermeasureManager was null on our vehicle");
        }
        fuelTank = GetComponent <FuelTank>();
        if (fuelTank == null)
        {
            Debug.LogError("FuelTank was null on our vehicle");
        }

        Networker.WeaponSet += WeaponSet;

        traverse = Traverse.Create(weaponManager);
        Debug.Log("Done Plane Sender");
    }