/// <summary>
        /// On Enable, we initialize our button colors. Why? Because we can.
        /// </summary>
        protected virtual void OnEnable()
        {
            _masterColorMute   = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 1f);
            _masterColorUnmute = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 0.9f);
            _masterColorPause  = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 0.8f);
            _masterColorStop   = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 0.7f);
            _masterColorPlay   = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 0.5f);
            _masterColorFree   = MMColors.MMColorize(_baseColor, _masterColorBase, _coloringMode, 0.4f);

            _musicColorMute   = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 1f);
            _musicColorUnmute = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 0.9f);
            _musicColorPause  = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 0.8f);
            _musicColorStop   = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 0.7f);
            _musicColorPlay   = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 0.5f);
            _musicColorFree   = MMColors.MMColorize(_baseColor, _musicColorBase, _coloringMode, 0.4f);

            _sfxColorMute   = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 1f);
            _sfxColorUnmute = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 0.9f);
            _sfxColorPause  = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 0.8f);
            _sfxColorStop   = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 0.7f);
            _sfxColorPlay   = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 0.5f);
            _sfxColorFree   = MMColors.MMColorize(_baseColor, _sfxColorBase, _coloringMode, 0.4f);

            _uiColorMute   = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 1f);
            _uiColorUnmute = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 0.9f);
            _uiColorPause  = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 0.8f);
            _uiColorStop   = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 0.7f);
            _uiColorPlay   = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 0.5f);
            _uiColorFree   = MMColors.MMColorize(_baseColor, _uiColorBase, _coloringMode, 0.4f);
        }
예제 #2
0
 public void InitializeIfNeeded(int id, int bandID)
 {
     if (!_initialized)
     {
         Mode          = Modes.Normalized;
         BeatValueMode = BeatValueModes.Remapped;
         Name          = "Beat " + id;
         BeatColor     = MMColors.RandomColor();
         BandID        = bandID;
         Threshold     = 0.3f + id * 0.02f;
         if (Threshold > 0.6f)
         {
             Threshold -= 0.5f;
         }
         Threshold = Threshold % 1f;
         MinimumTimeBetweenBeats = 0.25f + id * 0.02f;
         RemappedAttack          = 0.05f + id * 0.01f;
         RemappedDecay           = 0.2f + id * 0.01f;
         _initialized            = true;
     }
 }
        protected virtual void Initialization()
        {
            if (DrawerInitialized)
            {
                return;
            }

            List <FieldInfo>          fieldInfoList;
            MMInspectorGroupAttribute previousGroupAttribute = default;
            int fieldInfoLength = MMMonoBehaviourFieldInfo.GetFieldInfo(target, out fieldInfoList);

            for (int i = 0; i < fieldInfoLength; i++)
            {
                MMInspectorGroupAttribute group = Attribute.GetCustomAttribute(fieldInfoList[i], typeof(MMInspectorGroupAttribute)) as MMInspectorGroupAttribute;
                MMInspectorGroupData      groupData;
                if (group == null)
                {
                    if (previousGroupAttribute != null && previousGroupAttribute.GroupAllFieldsUntilNextGroupAttribute)
                    {
                        _shouldDrawBase = false;
                        if (!GroupData.TryGetValue(previousGroupAttribute.GroupName, out groupData))
                        {
                            GroupData.Add(previousGroupAttribute.GroupName, new MMInspectorGroupData
                            {
                                GroupAttribute = previousGroupAttribute,
                                GroupHashSet   = new HashSet <string> {
                                    fieldInfoList[i].Name
                                },
                                GroupColor = MMColors.GetColorAt(previousGroupAttribute.GroupColorIndex)
                            });
                        }
                        else
                        {
                            groupData.GroupColor = MMColors.GetColorAt(previousGroupAttribute.GroupColorIndex);
                            groupData.GroupHashSet.Add(fieldInfoList[i].Name);
                        }
                    }

                    continue;
                }

                previousGroupAttribute = group;

                if (!GroupData.TryGetValue(group.GroupName, out groupData))
                {
                    bool groupIsOpen = EditorPrefs.GetBool(string.Format($"{group.GroupName}{fieldInfoList[i].Name}{target.GetInstanceID()}"), false);
                    GroupData.Add(group.GroupName, new MMInspectorGroupData
                    {
                        GroupAttribute = group,
                        GroupColor     = MMColors.GetColorAt(previousGroupAttribute.GroupColorIndex),
                        GroupHashSet   = new HashSet <string> {
                            fieldInfoList[i].Name
                        }, GroupIsOpen = groupIsOpen
                    });
                }
                else
                {
                    groupData.GroupHashSet.Add(fieldInfoList[i].Name);
                    groupData.GroupColor = MMColors.GetColorAt(previousGroupAttribute.GroupColorIndex);
                }
            }

            SerializedProperty iterator = serializedObject.GetIterator();

            if (iterator.NextVisible(true))
            {
                do
                {
                    FillPropertiesList(iterator);
                } while (iterator.NextVisible(false));
            }

            DrawerInitialized = true;
        }
예제 #4
0
 /// <summary>
 /// On Reset we initialize our gizmo color
 /// </summary>
 protected virtual void Reset()
 {
     GizmosColor   = MMColors.RandomColor();
     GizmosColor.a = 0.2f;
 }