Ejemplo n.º 1
0
 public void ChangeColors(Pl_WeaponData.WeaponColors colors)
 {
     spr_dark.color = colors.colorDark;
     if (spr_dark.color.a == 0)
     {
         spr_dark.color = defaultColors.colorDark;
     }
     spr_light.color = colors.colorLight;
     if (spr_light.color.a == 0)
     {
         spr_light.color = defaultColors.colorLight;
     }
     spr_outline.color = colors.colorOutline;
     spr_solids.color  = colors.colorOutline;
     if (spr_outline.color.a == 0)
     {
         spr_outline.color = defaultColors.colorOutline;
         spr_solids.color  = defaultColors.colorOutline;
     }
 }
Ejemplo n.º 2
0
    public IEnumerator SetWeapon(Pl_WeaponData.Weapons weapon)
    {
        Pl_WeaponData.Weapons oldWeapon = curWeapon;
        Pl_WeaponData         wpn       = Pl_WeaponData.WeaponList[(int)weapon];

        if (Player.instance != null)
        {
            if (Player.instance.bodyColorDark && Player.instance.bodyColorDark.GetComponent <Misc_CopySprite>() != null)
            {
                cοpy_dark.spritePath = Player.instance.bodyColorDark.GetComponent <Misc_CopySprite>().spritePath;
            }
            if (Player.instance.bodyColorLight && Player.instance.bodyColorLight.GetComponent <Misc_CopySprite>() != null)
            {
                cοpy_light.spritePath = Player.instance.bodyColorLight.GetComponent <Misc_CopySprite>().spritePath;
            }
            if (Player.instance.bodyColorOutline && Player.instance.bodyColorOutline.GetComponent <Misc_CopySprite>() != null)
            {
                cοpy_outline.spritePath = Player.instance.bodyColorOutline.GetComponent <Misc_CopySprite>().spritePath;
            }
            cοpy_solids.spritePath = GameManager.GetPlayerSpritePath(Player.instance.curPlayer);
            cοpy_solids.spritePath = cοpy_solids.spritePath.Substring(0, cοpy_solids.spritePath.Length - 4) + "Blank";

            if (wpn != null)
            {
                defaultColors = wpn.baseColors;

                if (defaultColors.colorDark.a == 0)
                {
                    spr_dark.color = Player.instance.defaultColors.colorDark;
                }
                else
                {
                    spr_dark.color = defaultColors.colorDark;
                }
                if (defaultColors.colorLight.a == 0)
                {
                    spr_light.color = Player.instance.defaultColors.colorLight;
                }
                else
                {
                    spr_light.color = defaultColors.colorLight;
                }
                if (defaultColors.colorOutline.a == 0)
                {
                    spr_outline.color = Player.instance.defaultColors.colorOutline;
                    spr_solids.color  = Player.instance.defaultColors.colorOutline;
                }
                else
                {
                    spr_outline.color = defaultColors.colorOutline;
                    spr_solids.color  = defaultColors.colorOutline;
                }

                ChangeColors(new Pl_WeaponData.WeaponColors(spr_light.color, spr_dark.color, spr_outline.color));
                defaultColors = new Pl_WeaponData.WeaponColors(spr_light.color, spr_dark.color, spr_outline.color);
            }
            else
            {
                spr_dark.color    = Player.instance.defaultColors.colorDark;
                spr_light.color   = Player.instance.defaultColors.colorLight;
                spr_outline.color = Player.instance.defaultColors.colorOutline;
                spr_solids.color  = Player.instance.defaultColors.colorOutline;

                defaultColors = new Pl_WeaponData.WeaponColors(spr_light.color, spr_dark.color, spr_outline.color);
            }

            cοpy_dark.Reload();
            cοpy_light.Reload();
            cοpy_outline.Reload();
            cοpy_solids.Reload();

            curPlayer = Player.instance.curPlayer;
            curWeapon = weapon;
        }
        else
        {
            cοpy_solids.spritePath = GameManager.GetPlayerSpritePath(GameManager.Players.MegaMan);
            cοpy_solids.spritePath = cοpy_solids.spritePath.Substring(0, cοpy_solids.spritePath.Length - 4) + "Blank";
            cοpy_solids.Reload();

            curWeapon = weapon;
        }

        if (curWeapon != oldWeapon)
        {
            charge = 0.0f;
        }

        yield return(new WaitForSeconds(0.125f));
    }