Exemplo n.º 1
0
  void OnEnable() {
    
    m_IconUp = Resources.Load("UI/up") as Texture2D;
    m_IconDown = Resources.Load("UI/down") as Texture2D;
    m_IconDelete = Resources.Load("UI/delete") as Texture2D;
    m_IconAdd = Resources.Load("UI/add") as Texture2D;

    var t = (target as Sequence);

    // Update source types
    for(int i = 0; i < t.m_FrameSources.Count; i++) {
      var f = t.m_FrameSources[i];
      if (f.m_Source)
        f.m_SourceType = SequenceUtils.GetAssetType(f.m_Source);
      t.m_FrameSources[i] = f;
    }
  }
Exemplo n.º 2
0
 string ProcessAsset(Object Asset, bool Add = false) {
   var type = SequenceUtils.GetAssetType(Asset);
   if (type == Sequence.SourceType.Folder) {
     if (Add) {
       var frames = EditorUtils.GetFramesFromFolder(Asset);
       foreach (var f in frames) {
         (target as Sequence).AddFrame(f, Sequence.SourceType.Model);
         EditorUtility.SetDirty(target);
       }
     }
     GUI.color = DRAGBOX_COLOR_ONDRAG_FOLDER;
     return string.Format("Adding folder '{0}'", Asset.name);
   } else if (type != Sequence.SourceType.Unsupported) {
     if (Add) {
       (target as Sequence).AddFrame(Asset as GameObject, type);
       EditorUtility.SetDirty(target);
     }
     GUI.color = DRAGBOX_COLOR_ONDRAG_FILE;
     return "Adding '" + Asset.name + "'";
   }
   DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
   GUI.color = DRAGBOX_COLOR_ERROR;
   return "This asset isn't compatible!";
 }