Beispiel #1
0
 public void AddUI(UIEngineValue _uiValue)
 {
     if (!uiValues.Contains(_uiValue))
     {
         uiValues.Add(_uiValue);
     }
 }
Beispiel #2
0
    public void AddValue(UIEngineValue _uiValue)
    {
        var cat = GetCategory(_uiValue.Id);

        if (cat != null)
        {
            cat.AddUI(_uiValue);
        }
        else
        {
            cat = new EngineValueUICategory {
                id = _uiValue.Id
            };
            cat.AddUI(_uiValue);
            uiCategories.Add(cat);
        }
    }
Beispiel #3
0
    protected virtual void SyncItemUI()
    {
        if (!Data.syncValuesToUI)
        {
            return;
        }
        if (Data.layoutMaster)
        {
            UIEngineValueEntity itemUI = null;
            if (Data.itemSyncType == LayoutSync.UISyncType.SpawnedUI)
            {
                itemUI = ui;
            }
            else if (Data.itemSyncType == LayoutSync.UISyncType.EntityRootOwnerUI)
            {
                var root = transform.root.GetComponentInChildren <EngineEntity>();
                itemUI = root.UI;
            }

            if (itemUI)
            {
                ammoClipAmountChangedUI = itemUI.GetEngineValueUI(Data.layoutMaster,
                                                                  Data.ammoClipAmountSync.syncSelection.indexValue);
                clipAmountChanged += ammoClipAmountChangedUI.SetCurValue;
                OnClipAmountChanged();

                ammoClipIndexChangedUI = itemUI.GetEngineValueUI(Data.layoutMaster,
                                                                 Data.ammoIndSync.syncSelection.indexValue);
                clipIndexChanged += ammoClipIndexChangedUI.SetCurValue;
                OnClipIndexChanged();

                ammoReloadUI = itemUI.GetEngineValueUI(Data.layoutMaster,
                                                       Data.reloadSync.syncSelection.indexValue);
                reloadingTime += ammoReloadUI.SetCurValue;
                ammoReloadUI.SetMinMaxValue(0, Data.reloadTime);
                OnReloading();
            }
        }
    }
 public static void AddValue(UIEngineValue _uiValue)
 {
     Manager.AddValue(_uiValue);
 }