private void OnDestroy() { EventBase.Instance().EveCloseOtherTweenBar -= CloseOtherTweenBar; EventBase.Instance().StepToNext -= _stepInfo.UpdateDesc; EventBase.Instance().StepToNext -= UpdateScore; EventBase.Instance().DoGameOver -= UpdateScore; }
private void ProgramStart_eventTest(GameObject go, string str) { Debug.LogWarning(go.name + "/" + str); var result = EventBase.Instance().DoDelTest(); //if (result) Debug.Log(result); }
public void ChangeGameState(StepState state) { GameState = state; if (state == StepState.Gameing) { EventBase.Instance().StepToNext(); OverTime = DateTime.Now.AddSeconds(1800); } }
void Update() { if (_timer > 0) { _timer -= Time.deltaTime; } else { _timer = 5f; //EventBase.Instance().DoEvent(gameObject, Time.time.ToString()); EventBase.Instance().DoEventTestTime(Time.time.ToString()); } }
private void Start() { BtnNext.onClick.AddListener(OnClickNext); BtnLast.onClick.AddListener(OnClickLast); BtnClose.onClick.AddListener(() => { UIManager.Instance().HidePanel(UIManager.PanelType.PanelShowDes); if (StepManager.Instance().GameState == StepManager.StepState.None) { EventBase.Instance().DoEleIntroduceMove(); } }); mIndex = 0; ShowTargetImage(); }
void Start() { UIManager.Instance().ShowPanel(UIManager.PanelType.PanelTopBar); UIManager.Instance().ShowPanel(UIManager.PanelType.PanelShowDes); EventBase.Instance().eventTest += ProgramStart_eventTest; EventBase.Instance().DoDelTest = DoDelTest; EventBase.Instance().eventTestTime += EventTestTime; //ConfigEleObjs tab = ConfigEleObjs.TryGet("1"); // ConfigEleObjs tab1 = ConfigEleObjs.TryGet("1"); // ConfigEleObjs tab2 = ConfigEleObjs.TryGet("1"); ConfigManager.Instance().LoadTxt(); //ConfigStep config = (ConfigStep)ConfigManager.Instance().GetConfig(ConfigType.ConfigStep); //Debug.LogFormat("id:{0} dragName:{1} castName:{2}",config[2].id, config[2].dragName, config[2].castName); //ConfigStepDesc configDesc = (ConfigStepDesc)ConfigManager.Instance().GetConfig(ConfigType.ConfigStepDesc); //Debug.LogFormat("id:{0} desc:{1}", configDesc[2].id, configDesc[2].Desc); }
public void ShowOrHide(bool close = false) { if (Go.activeInHierarchy || close) { if (AllDesc.gameObject.activeInHierarchy) { AllDesc.gameObject.SetActive(false); } Go.SetActive(false); } else { EventBase.Instance().EveCloseOtherTweenBar(-1); Go.SetActive(true); string str = StepManager.Instance().GetCurStepDesc(); SetCurDesc(str);//(Regex.Unescape(str)); } }
void Start() { Score.text = "0"; LeftTime.text = "30:00"; for (int i = 0; i < 4; i++) { if (i == 1)//教学按钮跳过 { continue; } if (!Trans[i]) { continue; } TweenBar tempBar = new TweenBar(Trans[i], TweenBarId); _tweenBars[i] = tempBar; Button temp = Btns[i]; temp.onClick.AddListener(() => tempBar.Tween()); } Btns[1].onClick.AddListener(() => { EventBase.Instance().EveCloseOtherTweenBar(-1); UIManager.Instance().ShowPanel(UIManager.PanelType.PanelShowDes, false); }); _changeColor = new TweenBar(ChangeColor, TweenBarId); TweenBarBg = transform.Find("Bg").GetComponent <Image>(); _changeColor.AddCallToBtn(0, () => TweenBarBg.color = Color.red); _changeColor.AddCallToBtn(1, () => TweenBarBg.color = Color.green); _changeColor.AddCallToBtn(2, () => TweenBarBg.color = Color.white); _changeColor.AddCallToBtn(3, () => TweenBarBg.color = Color.Lerp(Color.red, Color.white, 0.5f)); _tweenBars[0].AddCallToBtn(1, _changeColor); _tweenBars[0].AddCallToBtn(2, () => UIManager.Instance().ShowPanel(UIManager.PanelType.PanelQuit)); _stepInfo = new StepInfo(transform.Find("StepInfo")); Btns[4].onClick.AddListener(() => _stepInfo.ShowOrHide()); EventBase.Instance().EveCloseOtherTweenBar += CloseOtherTweenBar; EventBase.Instance().StepToNext += _stepInfo.UpdateDesc; EventBase.Instance().StepToNext += UpdateScore; EventBase.Instance().DoGameOver += UpdateScore; }
private void OnDestroy() { EventBase.Instance().StepToNext -= StepNext; EventBase.Instance().DoEleIntroduceMove -= DoEleIntroduceMove; }
void Start() { EventBase.Instance().StepToNext += StepNext; EventBase.Instance().DoEleIntroduceMove += DoEleIntroduceMove; }
private void OnDestroy() { EventBase.Instance().DoDelTest -= DoDelTest; EventBase.Instance().eventTest -= ProgramStart_eventTest; EventBase.Instance().eventTestTime -= EventTestTime; }
/// <summary> /// 弹出 /// </summary> private void TweenDown() { Go.transform.DOLocalMoveY(_defaultY - _tweenDistance, 0.3f); EventBase.Instance().EveCloseOtherTweenBar(ID); }