示例#1
0
        public void SetBossParams(bool Visible, string name, string subtitle, float curenerg, float maxenerg, hudColors colors, hudColors.EnergyBarColors barColors)
        {
            //calculateMode = calculate;
            hudColors       = colors;
            EnergyBarColors = barColors;

            visible = Visible;
            if (Visible)
            {
                bossBar.SetFilledColor(EnergyBarColors.filled);
                bossBar.SetShadowColor(EnergyBarColors.shadow);
                bossBar.SetEmptyColor(EnergyBarColors.empty);
                bossBar.SetColor2(Color.white);
                bossBar.SetFilledDrainSpeed(maxenerg);
                bossBar.SetCurrEnergy(curenerg, hudEnergyBar.ESetMode.Normal);
                bossBar.SetMaxEnergy(maxenerg);
                textBoss.text    = name;
                textBossSub.text = subtitle;
                //if (bossBar.GetComponent<Image>().color.a != 1 )
                //{
                //    Color a = new Color(bossBar.GetComponent<Image>().color.r, bossBar.GetComponent<Image>().color.g, bossBar.GetComponent<Image>().color.b, 1);
                //    bossBar.GetComponent<Image>().color = a;

                //    SamusPlugin.logger.Log(BepInEx.Logging.LogLevel.Message, "set bossBar image alpha to 1 manually");
                //}
            }

            curEnergy = curenerg;
            maxEnergy = maxenerg;
            bossIni   = true;
        }