| | |
| | | |
| | | if (root == null) |
| | | { |
| | | root = new GameObject("ManagerRoot"); |
| | | root.AddComponent<DoNotDestory>(); |
| | | root.AddComponent<MasterSocket>(); |
| | | root.AddComponent<TDAA_SDKManager>(); |
| | | root.AddComponent<AudioSourceManager>(); |
| | | root.AddComponent<JsonDataReader>(); |
| | | root.AddComponent<JsonDataInit>(); |
| | | if (Application.platform == RuntimePlatform.WindowsEditor || |
| | | Application.platform == RuntimePlatform.WindowsPlayer) |
| | | { |
| | | GameConfig.useSDK = false; |
| | | } |
| | | |
| | | root = new GameObject("ManagerRoot"); |
| | | |
| | | root.AddComponent<DoNotDestory>(); |
| | | root.AddComponent<MasterSocket>(); |
| | | root.AddComponent<TDAA_SDKManager>(); |
| | | root.AddComponent<AudioSourceManager>(); |
| | | root.AddComponent<JsonDataReader>(); |
| | | root.AddComponent<JsonDataInit>(); |
| | | } |
| | | firstStart = true; |
| | | //EventCenter.Ins.Add((int)KTGMGemClient.EventType.JsonDataReadDone, JsonDataReadDone); |
| | |
| | | InitSDK(); |
| | | bGameStart = false; |
| | | bFirstLoaded = false; |
| | | GameConfig.IsUpgradeTowerLevel = false; |
| | | GameConfig.CreateRandomTower = true; |
| | | |
| | | bVibrate = new bool[4]; |
| | |
| | | skillSliderVStartP = skillSliderValueRect.anchoredPosition; |
| | | skillSliderVStartHeight = skillSliderValueRect.sizeDelta; |
| | | |
| | | skillPS1 = transform.Find("Panel/Energy/FireSkillBg/Effect_UI_JiNengTuBiao/03").GetComponent<ParticleSystem>(); |
| | | skillPS2 = transform.Find("Panel/Energy/FireSkillBg/Effect_UI_JiNengTuBiao_02/03").GetComponent<ParticleSystem>(); |
| | | skillPS1 = transform.Find("Panel/Energy/FireSkillBg/Effect_UI_JiNengTuBiao/03").gameObject; |
| | | skillPS2 = transform.Find("Panel/Energy/FireSkillBg/Effect_UI_JiNengTuBiao_02/03").gameObject; |
| | | |
| | | skillPS1.SetActive(false); |
| | | skillPS2.SetActive(false); |
| | | |
| | | transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(false); |
| | | transform.Find("Panel/SwitchSpeed").gameObject.SetActive(false); |
| | |
| | | int guide = PlayerPrefs.GetInt("GemBattleGuide"); |
| | | GameConfig.IsNewbie = guide == 0; |
| | | |
| | | //GameConfig.IsNewbie = false; |
| | | //GameConfig.IsNewbie = true; |
| | | |
| | | GameConfig.IsNewbieStart = GameConfig.IsNewbie; |
| | | |
| | |
| | | { |
| | | transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(true); |
| | | transform.Find("Panel/SwitchSpeed").gameObject.SetActive(true); |
| | | GMBtn.SetActive(true); |
| | | // cx test |
| | | // GMBtn.SetActive(true); |
| | | } |
| | | |
| | | fireSkillCost = JsonDataCenter.GetSkillLevelInfo(fireSkillID, GameConfig.SkillLevel).cost; |
| | |
| | | private Color disColor = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | private Text fireSkillLevelText; |
| | | private Image fireSkillBgImg; |
| | | private ParticleSystem skillPS1, skillPS2; |
| | | private GameObject skillPS1, skillPS2; |
| | | |
| | | /// <summary> |
| | | /// 点击火技能 |
| | |
| | | { |
| | | if (GameConfig.EnergyCount == energyMax) |
| | | { |
| | | |
| | | //Debug.Log("能量已满"); |
| | | if (fireSkillBgImg.color != disColor) |
| | | { |
| | | fireSkillBgImg.color = disColor; |
| | | } |
| | | skillPS1.Play(); |
| | | skillPS2.Play(); |
| | | if (!skillPS1.activeSelf) skillPS1.SetActive(true); |
| | | if (!skillPS2.activeSelf) skillPS2.SetActive(true); |
| | | |
| | | //skillPS1.Play(); |
| | | //skillPS2.Play(); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | fireSkillBgImg.color = normalColor; |
| | | } |
| | | if (skillPS1.isPlaying) skillPS1.Stop(); |
| | | if (!skillPS2.isPlaying) skillPS2.Play(); |
| | | if (skillPS1.activeSelf) skillPS1.SetActive(false); |
| | | if (!skillPS2.activeSelf) skillPS2.SetActive(true); |
| | | //if (skillPS1.isPlaying) skillPS1.Stop(); |
| | | //if (!skillPS2.isPlaying) skillPS2.Play(); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | fireSkillBgImg.color = normalColor; |
| | | } |
| | | if (skillPS1.isPlaying) skillPS1.Stop(); |
| | | if (skillPS2.isPlaying) skillPS2.Stop(); |
| | | if (skillPS1.activeSelf) skillPS1.SetActive(false); |
| | | if (skillPS2.activeSelf) skillPS2.SetActive(false); |
| | | // if (skillPS1.isPlaying) skillPS1.Stop(); |
| | | // if (skillPS2.isPlaying) skillPS2.Stop(); |
| | | |
| | | } |
| | | } |