void CreateZone(PocketData zone, bool isNew = false, bool save = false) { var newZone = new GameObject().AddComponent <RZ>(); newZone.Activate(zone); RadiationZones.Add(newZone); if (isNew) { storedData.radData.Add(zone); } if (save) { SaveData(); } }
public void Activate(PocketData data) { this.data = data; transform.position = data.position; transform.rotation = new Quaternion(); UpdateCollider(); gameObject.SetActive(true); enabled = true; var Rads = gameObject.GetComponent <TriggerRadiation>(); Rads = Rads ?? gameObject.AddComponent <TriggerRadiation>(); Rads.RadiationAmountOverride = data.amount; Rads.radiationSize = data.radius; Rads.interestLayers = playerLayer; Rads.enabled = true; }