public void ShowChuPai(SEAT_DIR dir, MJType type) { sprite_ChuPai.gameObject.SetActive(true); sprite_ChuPai.spriteName = type.ToString() + "_MINE"; Vector3 pos = Vector3.zero; switch (dir) { case SEAT_DIR.DIR_LEFT: pos = new Vector3(-370, 0, 0); break; case SEAT_DIR.DIR_BOTTOM: pos = new Vector3(0, -150, 0); break; case SEAT_DIR.DIR_RIGHT: pos = new Vector3(370, 0, 0); break; case SEAT_DIR.DIR_TOP: pos = new Vector3(0, 230, 0); break; default: break; } sprite_ChuPai.transform.localPosition = pos; CancelInvoke("HideChuPai"); Invoke("HideChuPai", 0.7f); }
/// <summary> /// /// </summary> /// <param name="type">麻将类型</param> /// <param name="seatDir">方位</param> /// <param name="bIN">是否为手中的麻将</param> /// <param name="bBack">背面</param> /// <returns></returns> private string GetSpriteName(MJType type, SEAT_DIR seatDir, MJ_STAGE stage, bool bBack) { string spriteName = ""; switch (seatDir) { case SEAT_DIR.DIR_LEFT: { if (stage == MJ_STAGE.IN && !DataCenter.Instance.hFdata.IsHuiFanging) { spriteName = Tags.MJ_SpriteName_L; } else { spriteName = type.ToString() + "_L"; } if (bBack) { spriteName = Tags.MJ_SpriteName_Back_L; } } break; case SEAT_DIR.DIR_BOTTOM: { if (stage == MJ_STAGE.IN) { spriteName = type.ToString() + "_MINE"; } else { spriteName = type.ToString() + "_B"; } if (bBack) { spriteName = Tags.MJ_SpriteName_Back_B; } } break; case SEAT_DIR.DIR_RIGHT: { if (stage == MJ_STAGE.IN && !DataCenter.Instance.hFdata.IsHuiFanging) { spriteName = Tags.MJ_SpriteName_R; } else { spriteName = type.ToString() + "_R"; } if (bBack) { spriteName = Tags.MJ_SpriteName_Back_R; } } break; case SEAT_DIR.DIR_TOP: { if (stage == MJ_STAGE.IN && !DataCenter.Instance.hFdata.IsHuiFanging) { spriteName = Tags.MJ_SpriteName_T; } else { spriteName = type.ToString() + "_B"; } if (bBack) { spriteName = Tags.MJ_SpriteName_Back_T; } } break; default: break; } return(spriteName); }