/** 生成处理器 */ public void Generation() { int winId = War.sceneData.stageConfig.winId; if (winId <= 0) { return; } WinConfig winConfig = War.sceneData.stageConfig.winConfig; Debug.Log(string.Format("<color=yello>Generation winId={0} winConfig={1}</color>", winId, winConfig)); Type type; if (ProcessorConfig.TryGetValue(winConfig.winType, out type)) { winProcessor = gameObject.AddComponent(type) as WinProcessor; int index = ((int)winConfig.winType) - 1; GameObject viewGO = null; if (index < views.Length) { viewGO = views[index]; } winProcessor.Init(winConfig, viewGO); if (viewGO != null) { viewGO.SetActive(true); } } }
public void Show() { winProcessor = War.winManager.winProcessor; if (winProcessor == null) { return; } winConfig = winProcessor.winConfig; int index = ((int)winConfig.winType) - 1; GameObject viewGO = null; if (index < views.Length) { viewGO = views[index]; } if (viewGO != null) { viewGO.SetActive(true); } gameObject.SetActive(true); winProcessor.SetInfoPanel(viewGO); StartCoroutine(DelayPause()); }
public void OnRest() { if (winProcessor != null) { Destroy(winProcessor); winProcessor = null; } }