Ejemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.tag == myColorName.ToString())         //colors match
     {
         particleCount++;
     }
 }
Ejemplo n.º 2
0
    void checkPaint(ColorName paintColor)
    {
        if (innerColor != ColorName.White)
        {
            Debug.Log("MIXED: " + paintColor.ToString() + " " + innerColor.ToString());
            ColorName colorName = Palette.getSimpleMix(new List <ColorName> {
                paintColor, innerColor
            });
            //ColorName colorName = Palette.getColorName(newColor);
            //print(Palette.getColorName(newColor));
            if (colorName != ColorName.White)
            {
                paintColor = colorName;
            }
        }

        if (required.ContainsKey(paintColor) || paintColor == outerColor)
        {
            changeColor(paintColor);
            checkNeighbors(paintColor);
        }
        else
        {
            Debug.Log("Not Required: " + paintColor);
            // List<ColorName> keys = new List<ColorName>(required.Keys);
            // foreach(ColorName requiredColor in keys)
            // {
            //     required[requiredColor] = false;
            // }
            // setInnerColor(Palette.getWhite());
            // innerColor = ColorName.White;
        }
    }
Ejemplo n.º 3
0
    private void Awake()
    {   // Asignacion aleatoria del color
        int random = Random.Range(0, ConfigurationUtils.MaxColors);

        color = (ColorName)random;
        GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/" + color.ToString());
        explosion = Resources.Load <GameObject>("Prefabs/explosion_" + color.ToString());
    }
Ejemplo n.º 4
0
    public void setup()
    {
        ColorName currColor = level.getPalette().getCurrColor();
        Color     newColor  = Palette.getColorValue(currColor);

        cannon.GetComponent <MeshRenderer>().material.color = newColor;
        textPro.text  = currColor.ToString();
        textPro.color = newColor;
    }
Ejemplo n.º 5
0
    private GameObject CreateTarget(ColorName targetColor, int position)
    {
        GameObject temp = Instantiate(target, GameObject.Find("Targets").transform);

        temp.transform.localScale    = new Vector2(5f / size, 5f / size);
        temp.transform.localPosition = spaces[position].gameObject.transform.position;
        temp.name = targetColor.ToString().ToLower() + "Target";

        return(temp);
    }
Ejemplo n.º 6
0
    private GameObject CreateFirefly(ColorName fireflyColor, float yPos)
    {
        GameObject temp = Instantiate(firefly, GameObject.Find("Fireflies").transform);

        temp.transform.localScale    = new Vector2(5f / size, 5f / size);
        temp.transform.localPosition = new Vector2(5, yPos);
        temp.name = fireflyColor.ToString().ToLower();

        return(temp);
    }
Ejemplo n.º 7
0
        public string PickHexColor(ColorName name)
        {
            Load();

            string color = (string)xele.Element(name.ToString()).Element(hex);

            color = "#" + color;

            return(color);
        }
Ejemplo n.º 8
0
    public void changeColor(int direction)
    {
        // Debug.Log(getPalette().changeColor(direction));
        level.getPalette().changeColor(direction);
        ColorName currColor = level.getPalette().getCurrColor();
        Color     newColor  = Palette.getColorValue(currColor);

        cannon.GetComponent <MeshRenderer>().material.color = newColor;
        textPro.text  = currColor.ToString();
        textPro.color = newColor;
    }
Ejemplo n.º 9
0
        public Color PickColor(ColorName name)
        {
            Load();

            XElement e = xele.Element(name.ToString()).Element(rgba);
            byte     r = (byte)(int)e.Element(red);
            byte     g = (byte)(int)e.Element(green);
            byte     b = (byte)(int)e.Element(blue);
            byte     a = (byte)(int)e.Element(alpha);

            return(new Color32(r, g, b, a));
        }
Ejemplo n.º 10
0
 public static string ToClass(this ColorName c) => c.ToString().ToLower();
Ejemplo n.º 11
0
 public override string ToString()
 {
     return(ColorName.ToString());
 }
Ejemplo n.º 12
0
        // ===================================================================================
        // PARAMETERS ------------------------------------------------------------------------

        /// <summary>
        /// Selects the color property to change.
        /// </summary>
        /// <param name="p_colorName">
        /// The propertyName/colorName to change (see Unity's <see cref="Material.SetColor"/> if you don't know how it works),
        /// set via the <see cref="PlugSetColor.ColorName"/> enum.
        /// </param>
        public PlugSetColor Property(ColorName p_colorName)
        {
            return(Property(p_colorName.ToString()));
        }
Ejemplo n.º 13
0
        // ===================================================================================
        // PARAMETERS ------------------------------------------------------------------------

        /// <summary>
        /// Selects the color property to change.
        /// </summary>
        /// <param name="p_colorName">
        /// The propertyName/colorName to change (see Unity's <see cref="Material.SetColor"/> if you don't know how it works),
        /// set via the <see cref="PlugSetColor.ColorName"/> enum.
        /// </param>
        public PlugSetColor Property(ColorName p_colorName)
        {
            return Property(p_colorName.ToString());
        }
Ejemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        public static ColorKey Parse(ColorName ColorName)
        {
            string name = (string)ColorNameTable[ColorName.ToString().ToLower()];

            return((ColorKey)Enum.Parse(typeof(ColorKey), name, true));
        }