public void SetColorPalette() { // not all bonus items have the ColorSwap component // only the Extra Life, Magnet Beam and Weapon Energies if (colorSwap != null) { // default to megabuster / magnetbeam colors // dark blue, light blue colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x0073F7)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0x00FFFF)); // find the player's controller to access the weapon type PlayerController player = GameObject.FindObjectOfType <PlayerController>(); if (player != null) { // apply new selected color scheme with ColorSwap switch (player.playerWeapon) { case PlayerController.WeaponTypes.HyperBomb: // green, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x009400)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); break; case PlayerController.WeaponTypes.RollingCutter: // dark gray, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x747474)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); break; case PlayerController.WeaponTypes.ThunderBeam: // dark gray, light yellow colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x747474)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCE4A0)); break; case PlayerController.WeaponTypes.FireStorm: // dark orange, yellow gold colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0xD82800)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xF0BC3C)); break; case PlayerController.WeaponTypes.SuperArm: // orange red, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0xC84C0C)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); break; case PlayerController.WeaponTypes.IceSlasher: // dark blue, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x2038EC)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); break; } } // apply the color changes colorSwap.ApplyColor(); } }
public void SetMenuPalette(int block1Color, int block2Color, int backgroundColor) { // use a custom color scheme with ColorSwap colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(block1Color)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(block2Color)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(backgroundColor)); // apply the color changes colorSwap.ApplyColor(); }
public void SetWeapon(WeaponTypes weapon) { /* ColorSwap and Shader to change MegaMan's color scheme * * his spritesheets have been altered to greyscale for his outfit * Red 64 for the helmet, gloves, boots, etc ( SwapIndex.Primary ) * Red 128 for his shirt, pants, etc ( SwapIndex.Secondary ) * * couple ways to code this but I settled on #2 * * #1 using Lists * * var colorIndex = new List<int>(); * var playerColors = new List<Color>(); * colorIndex.Add((int)SwapIndex.Primary); * colorIndex.Add((int)SwapIndex.Secondary); * playerColors.Add(ColorSwap.ColorFromIntRGB(64, 64, 64)); * playerColors.Add(ColorSwap.ColorFromIntRGB(128, 128, 128)); * colorSwap.SwapColors(colorIndex, playerColors); * * #2 using SwapColor as needed then ApplyColor * * colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x0073F7)); * colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0x00FFFF)); * colorSwap.ApplyColor(); * * Also, we'll change the color of our weapon energy bar * and adjust the energy value as given in the playerWeaponsStruct * */ // set new selected weapon (determines color scheme) playerWeapon = weapon; // calculate weapon energy value to adjust the bars int currentEnergy = weaponsData[(int)playerWeapon].currentEnergy; int maxEnergy = weaponsData[(int)playerWeapon].maxEnergy; float weaponEnergyValue = (float)currentEnergy / (float)maxEnergy; // apply new selected color scheme with ColorSwap and set weapon energy bar switch (playerWeapon) { case WeaponTypes.MegaBuster: // dark blue, light blue colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x0073F7)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0x00FFFF)); // the player weapon energy doesn't apply but we'll just set the default and hide it if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.PlayerLife); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, false); } break; case WeaponTypes.MagnetBeam: // dark blue, light blue colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x0073F7)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0x00FFFF)); // magnet beam energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.MagnetBeam); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.HyperBomb: // green, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x009400)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); // bombman's hyper bomb weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.HyperBomb); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.RollingCutter: // dark gray, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x747474)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); // cutman's rolling cutter weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.RollingCutter); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.ThunderBeam: // dark gray, light yellow colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x747474)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCE4A0)); // elecman's thunderbeam weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.ThunderBeam); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.FireStorm: // dark orange, yellow gold colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0xD82800)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xF0BC3C)); // fireman's firestorm weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.FireStorm); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.SuperArm: // orange red, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0xC84C0C)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); // gutman's super arm weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.SuperArm); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; case WeaponTypes.IceSlasher: // dark blue, light gray colorSwap.SwapColor((int)SwapIndex.Primary, ColorSwap.ColorFromInt(0x2038EC)); colorSwap.SwapColor((int)SwapIndex.Secondary, ColorSwap.ColorFromInt(0xFCFCFC)); // iceman's ice slasher weapon energy and set visible if (UIEnergyBars.Instance != null) { UIEnergyBars.Instance.SetImage(UIEnergyBars.EnergyBars.PlayerWeapon, UIEnergyBars.EnergyBarTypes.IceSlasher); UIEnergyBars.Instance.SetValue(UIEnergyBars.EnergyBars.PlayerWeapon, weaponEnergyValue); UIEnergyBars.Instance.SetVisibility(UIEnergyBars.EnergyBars.PlayerWeapon, true); } break; } // apply the color changes colorSwap.ApplyColor(); }
public void SetMenuPalette(MenuPalettes palette) { menuPalette = palette; // apply new selected color scheme with ColorSwap switch (menuPalette) { case MenuPalettes.Custom: // custom colors colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(customColorBlockLight)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(customColorBlockDark)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(customColorBackground)); break; case MenuPalettes.BombMan: // light green, dark green, brown colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0x80D010)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0x009400)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x7C0800)); break; case MenuPalettes.CutMan: case MenuPalettes.Wily3: // white, medium gray, dark gray colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFCFCFC)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xBCBCBC)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x747474)); break; case MenuPalettes.ElecMan: case MenuPalettes.Wily4: // white, orange, dark orange colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFCFCFC)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xFC9838)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0xC84C0C)); break; case MenuPalettes.FireMan: // white, medium gray, dark red colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFCFCFC)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xBCBCBC)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0xA40000)); break; case MenuPalettes.GutsMan: // pink, dark orange, brown colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFC7460)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xC84C0C)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x7C0800)); break; case MenuPalettes.IceMan: // white, dark green, teal colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFCFCFC)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0x004400)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x008088)); break; case MenuPalettes.Wily1: // white, dark gray, blue colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xFCFCFC)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0x747474)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x0000A8)); break; case MenuPalettes.Wily2: // green, mustard, teal colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0x58F898)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0x887000)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x008088)); break; case MenuPalettes.Wily4_1: // red, pink, black colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0xD82800)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xFC7460)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0x000000)); break; case MenuPalettes.Wily4_2: // brown, light yellow, orange colorSwap.SwapColor((int)SwapIndex.Block1, ColorSwap.ColorFromInt(0x7C0800)); colorSwap.SwapColor((int)SwapIndex.Block2, ColorSwap.ColorFromInt(0xFCD8A8)); colorSwap.SwapColor((int)SwapIndex.Background, ColorSwap.ColorFromInt(0xC84C0C)); break; } // apply the color changes colorSwap.ApplyColor(); }