예제 #1
0
        public void RotateOrbColors(int direction)
        { // direction > 0 = next, direction < 0 = prev. USE 1 and -1
            int l = orbColors.Length;

            if (direction > 0)
            {                                                       // next
                KRaB.Enemy.Colors.PrimaryColor temp = orbColors[0]; // first
                for (int i = 0; i < l; ++i)
                {
                    if (i <= l - 2)
                    { // if before last in array
                        orbColors[i] = orbColors[i + 1];
                    }
                    else if (i == l - 1)
                    { // if last in array
                        orbColors[i] = temp;
                    }
                }
            }
            else if (direction < 0)
            {                                                           // previous
                KRaB.Enemy.Colors.PrimaryColor temp = orbColors[l - 1]; // last
                for (int i = l - 1; i >= 0; --i)
                {
                    if (i > 0)
                    { // if before first in array
                        orbColors[i] = orbColors[i - 1];
                    }
                    else if (i == 0)
                    { // if first in array
                        orbColors[i] = temp;
                    }
                }
            }
            else
            {
                Debug.Log("Error: the method RotateOrbsColor received an unknown direction");
            }
            //Debug.Log(orbColors[0] + " " + orbColors[1] + " " + orbColors[2]);
            orbUI.UpdateOrbs(this);
            UpdateBucketColor(orbColors[0]);
        }
예제 #2
0
 public void SetColor(KRaB.Enemy.Colors.PrimaryColor c)
 {
     color = c;
 }
예제 #3
0
 public void UpdateBucketColor(KRaB.Enemy.Colors.PrimaryColor color)
 {
     bucketSR.color = color.color;
     bucketScript.SetColor(color);
 }