private void SpawnCrate() { _marker = GameManager.server.CreateEntity(MARKER_PREFAB, _position) as MapMarkerGenericRadius; if (_marker == null) { return; } _marker.enableSaving = false; _marker.color1 = GetColor(_settings.MarkerColor); _marker.color2 = GetColor(_settings.MarkerBorderColor); _marker.alpha = _settings.MarkerOpacity; _marker.radius = 0.5f; _marker.Spawn(); _crate = GameManager.server.CreateEntity(CRATE_PREFAB, _position, Quaternion.identity) as HackableLockedCrate; if (_crate == null) { return; } _crate.enableSaving = false; _crate.shouldDecay = false; _crate.SetWasDropped(); _crate.Spawn(); _crate.gameObject.GetOrAddComponent <DropComponent>(); _marker.SetParent(_crate); _marker.transform.localPosition = Vector3.zero; _marker.SendUpdate(); }
private void DespawnMarker() { if (!IsValid(_marker)) { return; } _marker.SetParent(null); _marker.Kill(); }