public void SetWork(WorkType wType, PointObjectPrefab poPrefab) { CancelPendingWork(); workBrush = Vector3.one; workType = wType; selectPointObjectPrefab = poPrefab; //DebugOutput.Shout("Setting work: " + wType.Description + " " + poPrefab.ResourceName); }
public ActionSelectableButton(RectTransform source, ActionSelectorMenu menu,WorkType wType, PointObjectPrefab poType) { if (source == null) { DebugOutput.Shout("KABLAM!"); } workType = wType; pointObjectType = poType; SelectorMenu = menu; rectTransform = (RectTransform)Instantiate(source); rectTransform.name = wType.Description; ((Text)rectTransform.GetChild(0).GetComponent<Text>()).text = poType.Name; rectTransform.SetParent(source.parent); rectTransform.localScale = source.localScale; Button button = rectTransform.GetComponent<Button>(); button.onClick.AddListener(OnUse); }