Esempio n. 1
0
 public void Setup(int player = 1, bool isHuman = true, BoatLivery livery = new BoatLivery())
 {
     _playerIndex         = player - 1;
     cam.gameObject.layer = LayerMask.NameToLayer("Player" + player); // assign player layer
     SetupController(isHuman);                                        // create or change controller
     Colorize(livery);
 }
Esempio n. 2
0
 /// <summary>
 /// This sets both the primary and secondary colour and assigns via a MPB
 /// </summary>
 private void Colorize(BoatLivery livery)
 {
     boatRenderer?.material?.SetColor(LiveryPrimary, livery.primaryColor);
     engineRenderer?.material?.SetColor(LiveryPrimary, livery.primaryColor);
     boatRenderer?.material?.SetColor(LiveryTrim, livery.trimColor);
     engineRenderer?.material?.SetColor(LiveryTrim, livery.trimColor);
 }
Esempio n. 3
0
        private void Colorize(Color primaryColor, Color trimColor, bool random = false)
        {
            var livery = new BoatLivery
            {
                primaryColor = random ? ConstantData.GetRandomPaletteColor : primaryColor,
                trimColor    = random ? ConstantData.GetRandomPaletteColor : trimColor
            };

            Colorize(livery);
        }
Esempio n. 4
0
        BoatLivery RandomLivery()
        {
            var livery = new BoatLivery
            {
                primaryColor = ConstantData.GetRandomPaletteColor,
                trimColor    = ConstantData.GetRandomPaletteColor
            };

            return(livery);
        }
Esempio n. 5
0
        private void Colorize(Color primaryColor, Color trimColor)
        {
            var livery = new BoatLivery
            {
                primaryColor = primaryColor,
                trimColor    = trimColor
            };

            Colorize(livery);
        }
Esempio n. 6
0
        private static void GenerateRandomBoats(int count, bool ai = true)
        {
            for (var i = 0; i < count; i++)
            {
                var boat = new BoatData();
                Random.InitState(ConstantData.SeedNow + i);
                boat.boatName = ConstantData.AiNames[Random.Range(0, ConstantData.AiNames.Length)];
                BoatLivery livery = new BoatLivery
                {
                    primaryColor = ConstantData.GetRandomPaletteColor,
                    trimColor    = ConstantData.GetRandomPaletteColor
                };
                boat.livery     = livery;
                boat.boatPrefab = Instance.boats[Random.Range(0, Instance.boats.Length)];

                if (ai)
                {
                    boat.human = false;
                }

                RaceData.boats.Add(boat);
            }
        }