예제 #1
0
        /** 生成处理器 */
        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);
                }
            }
        }
예제 #2
0
        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());
        }
예제 #3
0
 public void OnRest()
 {
     if (winProcessor != null)
     {
         Destroy(winProcessor);
         winProcessor = null;
     }
 }