Exemple #1
0
        private void Update()
        {
            if (colourPreset != lastColourPreset && colourPreset >= 0)
            {
                lastColourPreset = colourPreset;

                palette = ColourCatalogue.GetColourSet(colourPreset);
                UpdateShader();
            }
        }
Exemple #2
0
        private void UpdateUIColours(int colourSetIndex)
        {
            var colourSet = ColourCatalogue.GetColourSet(colourSetIndex);

            Color cFill = colourSet[colourFillIndex];

            cFill.a             = 1;
            colourBoxFill.color = cFill;

            Color cBorder = colourSet[colourBorderIndex];

            cBorder.a             = 1;
            colourBoxBorder.color = cBorder;
        }
Exemple #3
0
        public static void SetDragonAsPlayer(
            PlayerCustomisationData cData,
            GameObject dragon,
            bool changeColour = true)
        {
            PlayerInput pl = dragon.AddComponent <PlayerInput>();

            pl.leftKey  = cData.LeftButton;
            pl.rightKey = cData.RightButton;

            if (changeColour)
            {
                Palette pal = dragon.GetComponent <Palette>();
                pal.ColourSet = ColourCatalogue.GetColourSet(cData.ColourSetIndex);
            }
        }
Exemple #4
0
        private GameObject CreateDragon(int playerID)
        {
            GameObject newDragon = Instantiate(dragonPrefab, Vector2.zero, Quaternion.identity);

            // Scene Logic
            alivePlayers.Add(newDragon);
            newDragon.GetComponent <DamageController>().onDeath += OnDragonDeath;

            // Populating dragon
            var dc = newDragon.GetComponent <DragonController>();

            dc.playerID = playerID;
            newDragon.GetComponent <Palette>().ColourSet = ColourCatalogue.RandomColourSet();

            TrackDragonStats(playerID, dc);

            return(newDragon);
        }