/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { string appname = Common.GetAppNameDisplay(); textTitle.text = appname; string pic_name = Common.GAME_DATA_DIR + "/screenshot/icon/ad_bg"; string pic = pic_name + ".jpg"; if (!FileUtil.FileIsExistAsset(pic)) { pic = pic_name + ".png"; } imageBg.UpdateImage(pic); if (imageHuman != null) { imageHuman.UpdateImage(Common.GAME_DATA_DIR + "/screenshot/icon/human.png", imageShape0.keyImage); } uiGameShapeColor = GameViewController.main.gameBase as UIGameShapeColor; listShape = LevelManager.main.GetGuankaListOfAllPlace(); LayOut(); }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { imageHD.gameObject.SetActive(false); imageBoard.gameObject.SetActive(true); string pic_name = Common.GAME_DATA_DIR + "/screenshot/icon/bg"; string pic = pic_name + ".jpg"; if (!FileUtil.FileIsExistAsset(pic)) { pic = pic_name + ".png"; } imageBg.UpdateImage(pic); if (imageHuman != null) { imageHuman.UpdateImage(Common.GAME_DATA_DIR + "/screenshot/icon/human.png"); } uiGameShapeColor = GameViewController.main.gameBase as UIGameShapeColor; listShape = LevelManager.main.GetGuankaListOfAllPlace(); InitHighLight(); LayOut(); }
public void UpdateInfo(ShapeColorItemInfo info) { //Sprite sp = Resources.Load(info.pic, typeof(Sprite)) as Sprite; //imageBg.sprite = sp; //color // imageIcon.material = new Material(shaderColor); // Material mat = imageIcon.material; UIGameShapeColor game = GameViewController.main.gameBase as UIGameShapeColor; switch (itemType) { case ITEM_TYPE_SHAPE: { if (Common.isWeb) { TextureUtil texutil = new TextureUtil(); ShapeColorItemInfo infohttp = new ShapeColorItemInfo(); infohttp.color = colorSel; texutil.UpdateImageTextureWeb(imageIcon, HttpRequest.GetWebUrlOfAsset(info.pic), OnTextureHttpRequestFinished, infohttp, false); } else { Texture2D tex = TextureCache.main.Load(info.pic); UpdateIcon(tex, colorSel); } string key = game.LanguageKeyOfShape(info); string str = LanguageManager.main.languageGame.GetString(key); textTitle.text = str; textDetail.text = game.GameStatusOfShape(info); // mat.SetColor("_ColorShape", colorSel); } break; case ITEM_TYPE_COLOR: { indexShape = GameLevelParse.main.listShape.Count / 2; ShapeColorItemInfo infoshape = GameLevelParse.main.listShape[indexShape] as ShapeColorItemInfo; // imageIcon.sprite = LoadTexture.CreateSprieFromAsset(infoshape.pic); if (Common.isWeb) { TextureUtil texutil = new TextureUtil(); ShapeColorItemInfo infohttp = new ShapeColorItemInfo(); infohttp.color = info.color; texutil.UpdateImageTextureWeb(imageIcon, HttpRequest.GetWebUrlOfAsset(infoshape.pic), OnTextureHttpRequestFinished, infohttp, false); } else { Texture2D tex = TextureCache.main.Load(infoshape.pic); UpdateIcon(tex, info.color); } string str = game.ColorTitleOfItem(info); textTitle.text = str; textDetail.text = game.GameStatusOfColor(info); // mat.SetColor("_ColorShape", info.color); } break; } LayOut(); }