private void SetAccuracy(float accc, TakePhotosGameShowState state) { Image accuracy = transform.Find("Accuracy/Image").GetImage(); string r_path = "UIAtlas_TakePhotosGame_Score" + state.ToString(); accuracy.sprite = AssetManager.Instance.GetSpriteAtlas(r_path); int acc = (int)accc; var nums = GetEveryNumString(acc); int showIdx = 0; for (int i = 0; i < 4; i++) { Image img = transform.GetImage("Accuracy/Num/Image" + i.ToString()); if (showIdx > nums.Count) { img.gameObject.Hide(); continue; } img.gameObject.Show(); string path = ""; if (showIdx < nums.Count) { path = "UIAtlas_TakePhotosGame_Score" + nums[showIdx]; } else { path = "UIAtlas_TakePhotosGame_Percent"; } img.sprite = AssetManager.Instance.GetSpriteAtlas(path); img.SetNativeSize(); showIdx++; } }
private Transform GetObjByState(TakePhotosGameShowState showState) { return(transform.Find(showState.ToString())); }