public void SetTubeDefinition(TubeDefinition def)
 {
     definition = def;
     setDisplayText();
     setupBreadcrumbs();
     loadIcon();
     getTubeData();
     onSelectedTubeChanged(tubeData.SelectedTubeId);
 }
示例#2
0
 private bool tryGetTubeDefinitionById(int tubeId, out TubeDefinition tubeDefinition)
 {
     foreach (KeyValuePair <int, TubeDefinition> tubeDefinition2 in tubeDefinitions)
     {
         if (tubeDefinition2.Key == tubeId)
         {
             tubeDefinition = tubeDefinition2.Value;
             return(true);
         }
     }
     tubeDefinition = null;
     return(false);
 }
示例#3
0
        private IEnumerator loadIconsForTubeDefinition(TubeDefinition tubeDefinition)
        {
            CoroutineGroup coroutineGroup = new CoroutineGroup();

            addCoroutineToGroup(CoroutineRunner.Start(loadIcon(0, tubeDefinition.ButtonIconKeyDisabled.Key), this, ""), coroutineGroup);
            addCoroutineToGroup(CoroutineRunner.Start(loadIcon(1, tubeDefinition.ButtonIconKeyOff.Key), this, ""), coroutineGroup);
            addCoroutineToGroup(CoroutineRunner.Start(loadIcon(2, tubeDefinition.ButtonIconKeyOn.Key), this, ""), coroutineGroup);
            addCoroutineToGroup(CoroutineRunner.Start(loadIcon(3, tubeDefinition.ButtonIconKeyOn.Key), this, ""), coroutineGroup);
            while (!coroutineGroup.IsFinished)
            {
                yield return(null);
            }
            coroutineGroup.Clear();
            trayInputButton.Icon.sprite = trayInputButton.IconSprite.Sprites[(int)trayInputButton.CurrentViewState];
        }