using System.Collections; using System.Collections.Generic; using System.Xml; using UnityEngine; using UnityEngine.UI; public class CDMinigamePanelManager : Regist { #region Config private static Text Title; private static Text CoinCostText; private static Text DiamondCostText; private static Text ComfirmButtonTitle; private static Text CoinDescriptionText; private static Text DiamondDescriptionText; private static Button CloseButton; private static Button ComfirmButton; private static Toggle CoinToggle; private static Toggle DiamondToggle; private static Transform Mask; private static float CoinCDAmount; private static string CoinCostFormula; private static string DiamondCostFormula; private static bool IsPanelOpen; private static float RefreshTime = 1f; private static float RefreshTimer; private static double CoinCost; private static double DiamondCost; private static Current CDCurrent = Current.Coin; #endregion private void Update() { if (!IsPanelOpen) { return; } RefreshTimer += Time.deltaTime; if (RefreshTimer > RefreshTime) { RefreshTimer = 0; RefreshCost(); } } private void Init() { XmlDocument document = ConfigManager.GetXmlDocument(ResourceLabel.MinigameConfig); XmlAttributeCollection attributes = document.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode).Attributes; int index = 2; CoinCDAmount = float.Parse(attributes[index++].Value); CoinCostFormula = attributes[index++].Value; DiamondCostFormula = attributes[index++].Value; } public override void RegistReference() { Init(); Title = ResourceManager.Get(CanvasLabel.AD_Title); CoinCostText = ResourceManager.Get(CanvasLabel.AD_CoinCostText); DiamondCostText = ResourceManager.Get(CanvasLabel.AD_DiamondCostText); ComfirmButtonTitle = ResourceManager.Get(CanvasLabel.AD_ConfirmButtonTitle); CoinDescriptionText = ResourceManager.Get(CanvasLabel.AD_CoinDescription); DiamondDescriptionText = ResourceManager.Get(CanvasLabel.AD_DiamondDescription); Mask = ResourceManager.Get(CanvasLabel.AD_CDMinigameMask); CoinToggle = ResourceManager.Get(CanvasLabel.AD_CoinToggle); DiamondToggle = ResourceManager.Get(CanvasLabel.AD_DiamondToggle); CloseButton = ResourceManager.Get