private void Hide() { GameApp.Instance.FadeHelperInstance.FadeIn(0.05f, Color.black, () => { for (int i = 0; i < HideObjsWhenColoringShow.Length; i++) { HideObjsWhenColoringShow[i].SetActive(true); } GameApp.Instance.UICurrency.Show(true); IsFirstSelPencil = true; IsFirstSelWaterColor = true; IsFirstSelPaintingCan = true; Destroy(Model); BackToColoringFromSeaScene(); gameObject.SetActive(false); ColoringMgr.CleanCurrentShapeScreen(); GameApp.Instance.FadeHelperInstance.FadeOut(0.05f, () => { }); }); }
IEnumerator Init() { while (ColoringMgr == null) { yield return(new WaitForEndOfFrame()); } while (PencilTool == null || WaterColorTool == null || PaintingCanTool == null || StampTool == null || EraserTool == null) { yield return(new WaitForEndOfFrame()); } if (IsFirstInit) { IsFirstInit = false; } else { ColoringMgr.InstantiateDrawingContents(); yield return(new WaitForEndOfFrame()); ShapesCanvas.instance.InstantiateShapes(); yield return(new WaitForEndOfFrame()); ColoringMgr.LoadCurrentShape(); } ToolBtnList[(int)EColorinToolType.ePencil].OnClick_Sel(); MyTools.DestroyImmediateChildNodes(ColorListGrid.transform); for (int i = 0; i < PencilTool.contents.Count; i++) { GameObject newUnit = NGUITools.AddChild(ColorListGrid.gameObject, ColorUnitPrefab); newUnit.SetActive(true); newUnit.name = "Color_" + i; newUnit.transform.localPosition = new Vector3(0, -74 * i, 0); UI_ColorUnit fu = newUnit.GetComponent <UI_ColorUnit>(); fu.Set(PencilTool.contents[i].GetComponent <ToolContent>()); ColorListGrid.repositionNow = true; yield return(new WaitForEndOfFrame()); } MyTools.DestroyImmediateChildNodes(StampListGrid.transform); for (int i = 0; i < StampTool.contents.Count; i++) { GameObject newUnit = NGUITools.AddChild(StampListGrid.gameObject, StampUnitPrefab); newUnit.SetActive(true); newUnit.name = "Stamp_" + i; newUnit.transform.localPosition = new Vector3(0, -74 * i, 0); UI_StampUnit su = newUnit.GetComponent <UI_StampUnit>(); su.Set(StampTool.contents[i].GetComponent <Image>().mainTexture); StampListGrid.repositionNow = true; yield return(new WaitForEndOfFrame()); } }