Ejemplo n.º 1
0
 IEnumerator repainter()
 {
     if (states == null || states.Length < 8)
     {
         states = new int[8];
     }
     for (int i = 0; i < 8; i++)
     {
         APCManager.setNote((int)lastColumn - 1, i, 0);
         int nextColor = 0;
         if (mono.isActiveAndEnabled)
         {
             if (states[i] == 1)
             {
                 nextColor = (int)availableColor;
             }
             else
             if (states[i] == 2)
             {
                 nextColor = (int)activeColor;
             }
         }
         APCManager.setNote((int)column - 1, i, nextColor);
         yield return(null);
     }
     lastColumn = column;
 }
Ejemplo n.º 2
0
 IEnumerator ClearColumn(int clmn)
 {
     for (int i = 0; i < 8; i++)
     {
         APCManager.setNote(clmn - 1, i, 0);
         yield return(null);
     }
 }
Ejemplo n.º 3
0
 void OnEnable()
 {
     if (mappings == null)
     {
         mappings = new APCMapping[9];
     }
     instance = this;
 }/*    public static void OnMappingEnable(APCMapping source)
Ejemplo n.º 4
0
 void unmap(int index)
 {
     if (mappings[index] == null)
     {
         return;
     }
     mappings[index].column = APCColumn.None;
     APCManager.startColummClean((int)lastColumn);
 }
Ejemplo n.º 5
0
    public void OnValidate(MonoBehaviour source)
    {
        if (mappings == null)
        {
            mappings = new APCMapping[9];
        }
        if (mono == null)
        {
            mono = source;
        }
        if (lastColumn != column)
        {
            for (int i = 0; i < mappings.Length; i++)
            {
                if (mappings[i] == this)
                {
                    mappings[i] = null;
                }
            }
            if (mappings[(int)column] != null && mappings[(int)column] != this)
            {
                unmap((int)column);
            }
            mappings[(int)column] = this;
            APCManager.refreshBottm();
        }

        if (availableColor == APCManager.APCColors.Blank)
        {
            availableColor = APCManager.APCColors.Green;
        }
        if (activeColor == APCManager.APCColors.Blank)
        {
            activeColor = APCManager.APCColors.Orange;
        }

        /*  for (int i = 0; i < mappings.Length; i++)
         * {
         *    // s += "// " + i + " - " + (mappings[i] == null ? "#" : mappings[i].mononame);
         *    s += " . " + (mappings[i] == null ? " " : mappings[i].mononame);
         *
         * }
         * Debug.Log(s, mono.gameObject);*/
        Repaint();
    }