private void Awake() { if (SlotPrefab == null) { SlotPrefab = Resources.Load <GameObject>("Prefabs/PanelSubMision"); } SelectedMision = LoadMision(); foreach (SubMision sub in SelectedMision.SubMisions) { GameObject _slot = Instantiate(SlotPrefab, Vector3.zero, Quaternion.identity, transform); SubMisionSlot slot = SubMisionSlot.CreateComponent(_slot, sub); slots.Add(slot); } TurnOff(); Mision.OnMisionCompleted += OnMisionComplete; }
public void UpdateSelectedMision() { misionName.text = ""; foreach (Transform child in subMisionPanel) { if (child != subMisionPanel) { Destroy(child.gameObject); } } if (selectedSlot != null) { misionName.text = selectedSlot.name; //misionIcon.sprite = foreach (subMisionInfo si in SelectedMision.SubMisions) { GameObject _slot = Instantiate(subMisionSlot, Vector3.zero, Quaternion.identity, subMisionPanel); SubMisionSlot slot = SubMisionSlot.CreateComponent(_slot, new SubMision(si)); } } }