// Use this for initialization
    public void Start()
    {
        dynamicPalette = GetComponent <DynamicPalette> ();
        dynamicPalette.Init();

        BirdColorScheme chosenPalette = possibleColorSchemes [Random.Range(0, possibleColorSchemes.Length)];

        dynamicPalette.colorsToSwap [0].swapColor = chosenPalette.mainColor;
        dynamicPalette.colorsToSwap [1].swapColor = chosenPalette.bellyColor;
        dynamicPalette.colorsToSwap [2].swapColor = chosenPalette.outlineColor;
        dynamicPalette.colorsToSwap [3].swapColor = chosenPalette.hatColor;

        dynamicPalette.ChangeColor();
    }
Example #2
0
    public void ChangeItemPalette(DynamicPalette item, ColorSwap[] palette)
    {
        item.colorsToSwap = palette;

        //if teams, check oldpalette and shift
        //foreach color in item.colorsToSwap, color shift down amount
        //careful that this doesnt overwrite, you may need to create a new array and transfer instead of dierectly changing
        if (GameController.instance.game.currentGameMode == Game.Mode.TEAMS)
        {
            foreach (ColorSwap c in item.colorsToSwap)
            {
                c.swapColor.r -= (0.2f * oldColorIndex);
                c.swapColor.g -= (0.2f * oldColorIndex);
                c.swapColor.b -= (0.2f * oldColorIndex);
            }
        }


        item.ChangeColor();
    }
 private void Reset()
 {
     dynamicPalette = GetComponent <DynamicPalette>();
 }