Exemplo n.º 1
0
        /// <summary>
        /// Drag & Drop ボックス描画
        /// </summary>
        private void DrawDragAndDropBox()
        {
            if (toolConfig == null)
            {
                return;
            }

            CustomUI.DrawDragAndDropBox(
                "[Drag & Drop ParticleSystems Here]",
                toolConfig.GetFrameTexture(),
                style,
                (objs) =>
            {
                if (internalGuiState.IsDragAndDropRecursive)
                {
                    var particleSystems = objs.Select(obj => obj as GameObject)
                                          .Where(go => go != null)
                                          .Select(go => go.GetComponentsInChildren <ParticleSystem>())
                                          .SelectMany(ps => ps)
                                          .Where(ps => ps != null)
                                          .Distinct()
                                          .ToArray();
                    internalGuiState.SetParticleSystems(particleSystems);
                }
                else
                {
                    var particleSystems = objs.Select(obj => obj as GameObject)
                                          .Where(go => go != null)
                                          .Select(go => go.GetComponent <ParticleSystem>())
                                          .Where(ps => ps != null)
                                          .ToArray();
                    internalGuiState.SetParticleSystems(particleSystems);
                }
            });
        }
Exemplo n.º 2
0
 /// <summary>
 /// ドラッグアンドドロップボックス
 /// </summary>
 private void DrawDragAndDropBox()
 {
     CustomUI.DrawDragAndDropBox(
         "[Drag & Drop Shaders Here]",
         VfxToolConfig.Get().GetFrameTexture(), style, objs =>
     {
         var shaders = DragAndDrop.objectReferences
                       .Select(o => o as Shader)
                       .Where(s => s != null)
                       .ToArray();
         guiState.SetShaders(shaders);
     });
 }