Exemple #1
0
    public void SetWork(WorkType wType, PointObjectPrefab poPrefab)
    {
        CancelPendingWork();

        workBrush = Vector3.one;
        workType = wType;
        selectPointObjectPrefab = poPrefab;
        //DebugOutput.Shout("Setting work: " + wType.Description + " " + poPrefab.ResourceName);
    }
Exemple #2
0
        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);
        }