Esempio n. 1
0
    public void BindReferences()
    {
        SysLog.Log("SysRef.BindReferences");
        UiRef = GameObject.FindObjectOfType <UiRef>();

        sysState = GameObject.FindObjectOfType <SysState>();
        sysClock = GameObject.FindObjectOfType <SysClock>();
    }
Esempio n. 2
0
    public void Refresh()
    {
        int child = 0;

        while (child < RegularConsumableParent.childCount)
        {
            Destroy(RegularConsumableParent.GetChild(child++).gameObject);
        }

        foreach (var data in ConsumableManager.Instance.SaveData)
        {
            var it         = Instantiate(RegularConsumablePrefab, RegularConsumableParent);
            var consumable = UiRef.Init <ConsumableItem>(it.gameObject);
            consumable.Icon.sprite = DataManager.Instance.AllItems.First(item => item.ID == data.Id).Image;
        }

        foreach (var data in BaitBuffController.Instance.SaveData)
        {
            var it         = Instantiate(RegularConsumablePrefab, RegularConsumableParent);
            var consumable = UiRef.Init <ConsumableItem>(it.gameObject);
            consumable.Icon.sprite = DataManager.Instance.AllItems.First(item => item.ID == data.BaitId).Image;
        }
    }