void SetupSlipways() { int yOff = -40; int interval = 1; foreach (SlipwayButtonUIManager g in Slipways) { Destroy(g.gameObject); } Slipways.Clear(); foreach (Slipway c in Shipyard.Slipways) { GameObject d = Instantiate(SlipwaysPrefab) as GameObject; SlipwayButtonUIManager e = d.GetComponent <SlipwayButtonUIManager> (); e.Manager = this; Slipways.Add(e); d.transform.SetParent(SlipwaysContentParent.transform); d.GetComponent <RectTransform> ().anchoredPosition3D = new Vector3(0f, interval * yOff, 0f); d.transform.localScale = new Vector3(1f, 1f, 1f); // d.GetComponent<RectTransform> ().rotation = Camera.main.transform.rotation; // SlipwaysContentParent.GetComponent<RectTransform> ().rotation; e.AssignSlip(c, interval.ToString()); interval++; } }
public void SelectSlipway(SlipwayButtonUIManager s) { SelectedSlipway = s; SelectedSlipwayText.text = string.Format("Selected Slipway: #{0}\n{1} Turns Remain", SelectedSlipway.Index, SelectedSlipway.Slip.TurnsToCompletion); }