void OnEntitySpawned(SupplyDrop supply) { BuoyantComponent sfloat = supply.gameObject.AddComponent <BuoyantComponent>(); sfloat.BuoyancyScale = 1f; sfloat.DetectionRate = _config.DetectionRate; }
public void CreateForSupplyDrop(SupplyDrop drop) { Vector3 position = drop.transform.position; float radius = Instance.Options.Zones.EventZoneRadius; float lifespan = Instance.Options.Zones.EventZoneLifespanSeconds; Create(ZoneType.SupplyDrop, "Supply Drop", drop, radius, GetEventEndTime()); }
void Awake() { _drop = GetComponent <SupplyDrop>(); if (_drop == null) { Destroy(this); return; } }
private void SpawnSupplyCrate(string prefab, Vector3 position) { Vector3 newPosition = position + new Vector3(0, 20, 0); BaseEntity SupplyCrateEntity = GameManager.server.CreateEntity(prefab, newPosition); if (SupplyCrateEntity != null) { SupplyDrop Drop = SupplyCrateEntity.GetComponent <SupplyDrop>(); Drop.Spawn(); } }
private void processDrop(SupplyDrop drop) { bool proceed = randomNumber(airdropChance); if (!proceed) { return; } var lootDrop = drop.GetComponent <LootContainer>(); assignTraps(drop); }
public void RPC_DestroySupply(int no) { for (int i = 0; i < supplyDrops.Count; i++) { SupplyDrop tempDrop = supplyDrops[i].GetComponent <SupplyDrop>(); if (tempDrop.dropNo == no) { supplyDrops.Remove(tempDrop.gameObject); Destroy(tempDrop.gameObject); } } }
void OnEntitySpawned(SupplyDrop drop) { if (!configData.alerts.supplyDrop) { return; } if (drop == null) { return; } SendMsg(Lang("SupplyDrop", null, GetLocation(drop.transform.position, null, null))); }
private void OnEntitySpawned(BaseEntity Entity) { if (Entity == null) { return; } if (Entity is SupplyDrop) { SupplyDrop dropped = Entity as SupplyDrop; dropped.RemoveParachute(); } }
void OnSupplyDropLanded(SupplyDrop drop) { if (!configData.alerts.supplyDropLand) { return; } if (drop == null) { return; } if (!landedDrops.Contains(drop.net.ID)) { SendMsg(Lang("SupplyDropLanded", null, GetLocation(drop.transform.position, null, null))); landedDrops.Add(drop.net.ID); } }
private void OnSupplyDropLanded(SupplyDrop entity) { if (entity == null || IsEntityInList(entity.net.ID)) { return; } if (_configData.SupplyDropSettings.Enabled) { if (_configData.GlobalSettings.LoggingEnabled) { Puts("SupplyDrop landed at " + GetGridPosition(entity.transform.position)); } SendMessage(Lang("SupplyDropLanded", null, GetGridPosition(entity.transform.position)), _configData.SupplyDropSettings.WebhookURL); _lastEntities.Add(entity.net.ID, Time.realtimeSinceStartup + 60); } }
public bool CheckStrikeDrop(SupplyDrop drop) { bool istrue = false; var supplyDrop = drop.GetComponent <LootContainer>(); foreach (var plane in StrikePlanes) { if (plane.Plane == null) { return(false); } float dropDistance = ((Vector3.Distance(plane.Plane.transform.position, supplyDrop.transform.position))); if (dropDistance < 100) { supplyDrop.KillMessage(); } istrue = true; } return(istrue); }
private void OnEntitySpawned(BaseEntity Entity) { if (Entity == null) { return; } if (Entity is CargoPlane) { DisplayBannerToAll("spawn"); if (debug) { Puts($"SPAWN - CARGO"); } //CargoHUD("spawn", null); } if (Entity is SupplyDrop) { DisplayBannerToAll("dropped"); SupplyDrop dropped = Entity as SupplyDrop; entsupply.Add(Entity, dropped); Vector3 supplyposition = Entity.transform.position; float supplyx = Entity.transform.position.x; float supplyz = Entity.transform.position.z; if (debug) { Puts($"SUPPLY SPAWNED x={supplyx} z={supplyz}"); } dropposition.Add(Entity, supplyposition); GenerateMarkers(); Destroytimer(); cargorefresh = timer.Repeat(5, 0, () => { if (Entity != null) { CargoHUD("dropped"); } }); //dropped.RemoveParachute(); } }
private void OnSupplyDropLanded(SupplyDrop drop) { // Display banner to user DisplayBannerToAll("dropped"); DisplayDropHUD("dropped"); // Store the drop data BaseEntity entity = drop.GetEntity(); Vector3 dropPosition = drop.transform.position; bool show = true; Vector3 thatPos = Vector3.zero; foreach (Vector3 position in supplySignalPosition) { if ((dropPosition.x - 10) <= position.x && (dropPosition.x + 10) >= position.x && (dropPosition.z - 10) <= position.z && (dropPosition.z + 10) >= position.z) { show = false; thatPos = position; break; } } if (show) { // Remove the previous data if there is then add the new data entsupply.Remove(entity); dropposition.Remove(entity); entsupply.Add(entity, drop); dropposition.Add(entity, dropPosition); // Generate Marker GenerateMarkers(); } else { supplySignalPosition.Remove(thatPos); } }
void OnEntitySpawned(SupplyDrop drop) { if (!configData.Alerts.SupplyDrop) { return; } if (drop == null) { return; } var pos = drop.transform.position; string msg = Lang("SupplyDrop", null, GetLocation(pos, null, null)); Server.Broadcast(msg); if (configData.Misc.LogToConsole) { Puts(msg); } if (configData.Misc.LogToFile) { LogToFile("log", $"[{DateTime.Now.ToString("HH:mm:ss")}] {msg}", this); } }
private void OnEntitySpawned(SupplyDrop entity) { HandleEntity(entity); }