void PickupPotatoEffects() { isPotato = true; potatoEffects = GetComponentInChildren <PotatoEffects>(); NetworkPlayerVehicle npv = GetComponent <NetworkPlayerVehicle>(); myGunnerId = npv.GetGunnerID(); myGunnerId = npv.GetGunnerID(); potatoEffects.ActivatePotatoEffects(myDriverId, myGunnerId); }
void RemovePotato_RPC() { isPotato = false; PhotonView otherpv = GetComponent <PhotonView>(); NetworkPlayerVehicle npv = otherpv.GetComponentInParent <NetworkPlayerVehicle>(); HealthManager hm = otherpv.gameObject.GetComponentInChildren <HealthManager>(); TeamNameSetup tns = otherpv.gameObject.GetComponentInParent <TeamNameSetup>(); HotPotatoManager hpm = otherpv.gameObject.GetComponentInParent <HotPotatoManager>(); canPickupPotato = false; Invoke(nameof(ReactivatePickupPotato), 5f); myDriverId = npv.GetDriverID(); myGunnerId = npv.GetGunnerID(); tns.ChangeColour(false); potatoEffects = GetComponentInChildren <PotatoEffects>(); potatoEffects.DeactivatePotatoEffects(myDriverId, myGunnerId); }