public void SetChoseMusicUI(FileObj fileObj)
    {
        currentObj  = fileObj;
        currentInfo = fileObj.info;
        RandomPanel.SetActive(false);

        foreach (var item in difficultiesButton)
        {
            item.interactable = false;
        }

        foreach (var item in DifficultiesTMPro)
        {
            item.text = "";
        }


        foreach (SerializableSheet item in fileObj.sheets)
        {
            int l, t; double d;
            l = item.modeLine;
            t = item.difficultyType;
            d = item.difficulty;

            choosing[LineIndex(l), t] = item;

            if (LineIndex(l) == currentLineIndex)
            {
                DifficultiesTMPro[t].text          = d.ToString("0.0");
                difficultiesButton[t].interactable = true;
            }
        }
    }
Beispiel #2
0
 public override void OnRemoveConnection(NodePort port)
 {
     base.OnRemoveConnection(port);
     if (port.fieldName == nameof(Data) && port.node == this)
     {
         SerializableInfos.Clear();
         SelectedSerializableInfo = null;
     }
 }
Beispiel #3
0
    public void GetSheetManager(SerializableSheet h, SerializableInfo i)
    {
        modeLine = h.modeLine;

        noteList = h.regNoteList;
        noteList.AddRange(h.longNoteList);

        bpmList = h.bpmList.Count == 0 ? i.bpmList : h.bpmList;

        noteList.Sort();
        noteCount = noteList.Count;
    }
Beispiel #4
0
 public override void OnRemoveConnection(NodePort port)
 {
     if (port.fieldName == nameof(Data))
     {
         foreach (NodePort nodePort in GetPort(nameof(Output)).GetConnections())
         {
             nodePort.ClearConnections();
         }
         SerializableInfos.Clear();
         SelectedSerializableInfo = null;
     }
 }
Beispiel #5
0
 public void UpdateData <T>()
 {
     // Check if context type has change
     if (!string.Equals(typeof(T).AssemblyQualifiedName, _declaringTypeName))
     {
         _declaringTypeName = typeof(T).AssemblyQualifiedName;
         foreach (KeyValuePair <string, SerializableInfo> pair in InfoDictionary)
         {
             pair.Value.DeclaringTypeName = _declaringTypeName;
         }
     }
     // Handle fields
     FieldInfo[] fieldInfos = typeof(T).GetFields(SerializableInfo.DefaultBindingFlags);
     foreach (FieldInfo fieldInfo in fieldInfos)
     {
         if (PortDictionary.ContainsKey(fieldInfo.Name))
         {
             continue;
         }
         SerializableInfo serializableFieldInfo = new SerializableInfo(fieldInfo);
         PortDictionary.Add(fieldInfo.Name, serializableFieldInfo.PortName);
         NodePort newPort = AddDynamicOutput(serializableFieldInfo.Type, ConnectionType.Multiple, TypeConstraint.None, serializableFieldInfo.PortName);
         InfoDictionary.Add(serializableFieldInfo.PortName, serializableFieldInfo);
         // Redirect port using FormerlySerializedAsAttribute
         FormerlySerializedAsAttribute attribute = fieldInfo.GetCustomAttribute <FormerlySerializedAsAttribute>();
         if (attribute != null && PortDictionary.ContainsKey(attribute.oldName))
         {
             GetPort(PortDictionary[attribute.oldName]).SwapConnections(newPort);
         }
     }
     // Handle properties
     PropertyInfo[] propertyInfos = typeof(T).GetProperties(SerializableInfo.DefaultBindingFlags);
     foreach (PropertyInfo propertyInfo in propertyInfos)
     {
         if (PortDictionary.ContainsKey(propertyInfo.Name))
         {
             continue;
         }
         SerializableInfo serializablePropertyInfo = new SerializableInfo(propertyInfo);
         PortDictionary.Add(propertyInfo.Name, serializablePropertyInfo.PortName);
         NodePort newPort = AddDynamicOutput(serializablePropertyInfo.Type, ConnectionType.Multiple, TypeConstraint.None, serializablePropertyInfo.PortName);
         InfoDictionary.Add(serializablePropertyInfo.PortName, serializablePropertyInfo);
         // Redirect port using FormerlySerializedAsAttribute
         FormerlySerializedAsAttribute attribute = propertyInfo.GetCustomAttribute <FormerlySerializedAsAttribute>();
         if (attribute != null && PortDictionary.ContainsKey(attribute.oldName))
         {
             GetPort(PortDictionary[attribute.oldName]).SwapConnections(newPort);
         }
     }
     // Remove old ports
     for (int i = PortDictionary.Count - 1; i >= 0; i--)
     {
         if (fieldInfos.Any(info => info.Name == PortDictionary.ElementAt(i).Key))
         {
             continue;
         }
         if (propertyInfos.Any(info => info.Name == PortDictionary.ElementAt(i).Key))
         {
             continue;
         }
         RemoveDynamicPort(PortDictionary.ElementAt(i).Value);
         InfoDictionary.Remove(PortDictionary.ElementAt(i).Value);
         PortDictionary.Remove(PortDictionary.ElementAt(i).Key);
     }
 }
Beispiel #6
0
 public FileObj(DirectoryInfo directory, SerializableInfo info, List <SerializableSheet> sheets)
 {
     this.directory = directory;
     this.info      = info;
     this.sheets    = sheets;
 }