Exemplo n.º 1
0
 internal void OnGameStart()
 {
     // We have to wait a bit for the default Game Cameras to init
     SharedCoroutineStarter.instance.StartCoroutine(SEUtilities.DoAfter(0.1f, () => {
         Refresh();
     }));
 }
Exemplo n.º 2
0
 protected void ReloadShaders()
 {
     _shaderAssetLoader.Reload();
     SetupShaderList();
     _shaderManager.RefreshCameraManager();
     _shaderManager.ClearAllMaterials();
     SetupActiveShaderStackList();
     SEUtilities.UpdateScrollIndicator(customListTableData.tableView, scrollIndicator);
 }
Exemplo n.º 3
0
 public Sprite GetPreviewImage(ShaderEffectData sfx)
 {
     if (sfx == null || sfx.PreviewImage == null)
     {
         return(SEUtilities.GetDefaultShaderIcon());
     }
     if (_spriteCache.TryGetValue(sfx.PreviewImage, out Sprite image))
     {
         return(image);
     }
     return(Util.SEUtilities.GetDefaultShaderIcon());
 }
Exemplo n.º 4
0
        protected void SetupShaderList()
        {
            customListTableData.data.Clear();
            if (_spriteCache != null)
            {
                _spriteCache.Clear();
            }
            else
            {
                _spriteCache = new Dictionary <Texture2D, Sprite>();
            }

            _selection = -1;
            shadersCleared?.Invoke();

            List <ShaderEffectData> sfxList = _shaderAssetLoader.ShaderEffectList;

            foreach (ShaderEffectData sfx in sfxList)
            {
                Sprite icon = SEUtilities.GetDefaultShaderIcon();

                if (sfx.PreviewImage != null && _spriteCache.TryGetValue(sfx.PreviewImage, out Sprite image))
                {
                    icon = image;
                }
                else if (sfx.PreviewImage != null)
                {
                    icon = Sprite.Create(sfx.PreviewImage, new Rect(0.0f, 0.0f, sfx.PreviewImage.width, sfx.PreviewImage.height), new Vector2(0.5f, 0.5f), 100.0f);
                    _spriteCache.Add(sfx.PreviewImage, icon);
                }

                CustomListTableData.CustomCellInfo customCellInfo = new CustomListTableData.CustomCellInfo(sfx.Name, sfx.Author, icon);
                customListTableData.data.Add(customCellInfo);
            }

            customListTableData.tableView.ReloadData();
            SEUtilities.UpdateScrollIndicator(customListTableData.tableView, scrollIndicator, true);
        }
Exemplo n.º 5
0
 protected void ScrollDown() => SEUtilities.ScrollTheScrollIndicator(false, customListTableData.tableView, scrollIndicator, _scrollIndicatorCoroutine);