public static GameDollDetailItemButton Create(Transform parent, string categoryName, int index) { GameDollDetailItemButton button = CocoLoad.Instantiate <GameDollDetailItemButton> ("prefabs/Dressup_Detail", parent); button.InitInfo(categoryName, index); return(button); }
public static CCGuideManager Create(Transform pParent = null) { if (pParent == null) { pParent = GameObject.FindWithTag("Canvas_UI").transform; } GameObject obj = CocoLoad.Instantiate("UI_Guide", pParent); obj.transform.localScale = Vector3.one; CCGuideManager guide = obj.GetComponent <CCGuideManager> (); Canvas uiCanvas = pParent.GetComponent <Canvas> (); if (uiCanvas != null) { guide.GuideCamera = uiCanvas.worldCamera; } else { guide.GuideCamera = CocoMainController.UICamera; } return(guide); }
public static GameDollItemButton Create(string prefabsPath, CocoRoleDressItemHolder item, Transform parent, string categoryName) { GameDollItemButton button = CocoLoad.Instantiate <GameDollItemButton> (prefabsPath, parent); button.InitInfo(item, categoryName); return(button); }
public static GameDollCategoryButton Create(string catergoryID, Transform parent) { GameDollCategoryButton button = CocoLoad.Instantiate <GameDollCategoryButton> (DefaultDressupCategoryPath, parent); button.InitInfo(catergoryID); return(button); }
protected override void InitObjects() { base.InitObjects(); m_AssetControl = CocoLoad.GetOrAddComponent <CocoAssetControl> (gameObject); BindValue(m_AssetControl); m_RoleControl = CocoLoad.GetOrAddComponent <CocoRoleControl> (gameObject); BindValue(m_RoleControl); }
protected override void Start() { base.Start(); dressGuide = CocoLoad.InstantiateOrCreate("character_rotate_arrow", transform, CocoLoad.TransStayOption.Local); Input.multiTouchEnabled = true; CocoNative.Log("===ShowDialog==Start_SceneName: " + m_SceneID.ToString()); if (GlobalData.curSelectRole != -1) { dressupData.m_DetailIndex = recordStateModel.RecordDolls[dressupData.m_DetailIndex].detailIndex; } else { m_CurRole.Dress.AddDressItem(new List <string> () { "eye_001", "body_001", "ear_001", "tail_001", "eye_001" }); } // dressupData.m_DetailIndex = GlobalData.m_DetailIndex; }
void Awake() { m_Logo.SetLocal_Y(800); m_Loading.SetActive(false); int playType = Random.Range(0, 5); isOnlyX = CCTool.RandomBool; m_CurPlayIndexs = new List <int[]> (); // if (playType == 0) { // m_CurPlayIndexs.Add (new int[]{ 1, 26 }); // m_CurPlayIndexs.Add (new int[]{ 2, 3, 14, 25 }); // m_CurPlayIndexs.Add (new int[]{ 9, 10, 4, 24, 20, 8 }); // m_CurPlayIndexs.Add (new int[]{ 15, 16, 17, 11, 5, 23, 19, 13, 7, 22 }); // m_CurPlayIndexs.Add (new int[]{ 21, 18, 12, 6 }); // } else { // int[] block1 = new int[]{ 1, 2, 9, 15 }; // int[] block2 = new int[]{ 3, 10, 16, 17, 21 }; // int[] block3 = new int[]{ 4, 11, 18, 22 }; // int[] block4 = new int[]{ 5, 12, 19, 23 }; // int[] block5 = new int[]{ 6, 13, 20, 24 }; // int[] block6 = new int[]{ 7, 8, 14, 25, 26 }; // // if (playType == 1) { // m_CurPlayIndexs.Add (block1); // m_CurPlayIndexs.Add (block2); // m_CurPlayIndexs.Add (block3); // m_CurPlayIndexs.Add (block4); // m_CurPlayIndexs.Add (block5); // m_CurPlayIndexs.Add (block6); // m_DelayTime = 0.15f; // } else if (playType == 2) { // m_CurPlayIndexs.Add (block6); // m_CurPlayIndexs.Add (block5); // m_CurPlayIndexs.Add (block4); // m_CurPlayIndexs.Add (block3); // m_CurPlayIndexs.Add (block2); // m_DelayTime = 0.15f; // m_CurPlayIndexs.Add (block1); // } else { // m_CurPlayIndexs.Add (new int[]{ 1, 2, 9, 15, 7, 8, 14, 25, 26 }); // m_CurPlayIndexs.Add (new int[]{ 3, 10, 16, 17, 21, 6, 13, 20, 24 }); // m_CurPlayIndexs.Add (new int[]{ 4, 11, 18, 22, 5, 12, 19, 23 }); // } // } foreach (RectTransform rtf in m_Images) { Image mask = CocoLoad.InstantiateOrCreate <Image> (string.Empty, rtf.transform); CCTool.SetImageAlpha(mask, 0.3515f); mask.GetComponent <RectTransform> ().sizeDelta = rtf.sizeDelta; if (isOnlyX) { rtf.localScale = new Vector3(0, 1, 1); } else { rtf.localScale = new Vector3(0, 0, 1); } } }
void ResetRoleTransform(CocoRoleEntity pRole) { CocoLoad.SetParent(pRole, pRole.transform.parent); }