private int mLaguageType;//0为中文,1为英文 // Use this for initialization void Start() { mBss = GameMain.Singleton.BSSetting; if (mBss.LaguageUsing.Val == Scripts.Game.FishGame.Common.core.Language.Cn) { mLaguageType = 0; } else { mLaguageType = 1; } mUpdateDatas = new int[] { mBss.His_GainTotal.Val , mBss.His_GainCurrent.Val , mBss.His_CoinUp.Val , mBss.His_CoinDown.Val , mBss.His_CoinInsert.Val , mBss.His_CoinOut.Val , mBss.His_TicketOut.Val , mBss.GetRemainRuntime() }; UpdateView(); }
/// <summary> /// 直接设置押分 /// </summary> public void SetNeedScore(int newScore, int playerIndex) { BackStageSetting bss = GameMain.Singleton.BSSetting; SetNeedCoinLabel(newScore); Text_NeedCoin.Commit(); bss.Dat_PlayersGunScore[playerIndex].Val = newScore;//记录 //音效 Facade.Instance <MusicManager>().Play("changegun"); }
public bool SetScore(int value) { BackStageSetting bss = GameMain.Singleton.BSSetting; if (value < mScoreChangeLowest) { return(false); } bss.Dat_PlayersScore[Idx].Val = value; return(true); }
public void Fire(Player from, Fish tar, Quaternion dir) { GameMain gm = GameMain.Singleton; _mTargetFish = tar; IsLockingFish = tar != null; _mTs.rotation = dir; _mTs.parent = gm.TopLeftTs; var old = _mTs.localPosition; old.z = 0; _mTs.localPosition = old; Text_CoinNum.text = Score.ToString(); Text_CoinNum.Commit(); Owner = from; ++Owner.GunInst.NumBulletInWorld; BackStageSetting bss = gm.BSSetting; MoveArea = gm.WorldDimension; if (_mBulletGo == null) { _mBulletGo = Pool_GameObj.GetObj(Prefab_GoAnisprBullet); tk2dSpriteAnimator aniSprBullet = _mBulletGo.GetComponent <tk2dSpriteAnimator>(); if (aniSprBullet != null) { //aniSprBullet.clipId = aniSprBullet.GetClipIdByName(Prefab_SpriteNameSet.Texts[from.Idx % Prefab_SpriteNameSet.Texts.Length]); //YxDebug.Log(Prefab_SpriteNameSet.Texts[from.Idx % Prefab_SpriteNameSet.Texts.Length]); aniSprBullet.Play(Prefab_SpriteNameSet.Texts[from.Idx % Prefab_SpriteNameSet.Texts.Length]); //aniSprBullet.PlayFrom("1",0.1F); } _mBulletGo.SetActive(true); _mBulletGo.transform.parent = _mTs; var pos = Vector3.zero; _mBulletGo.transform.localPosition = pos; pos.z -= 10; Text_CoinNum.transform.localPosition = pos; _mBulletGo.transform.localRotation = Quaternion.identity; } }
/// <summary> /// 外部调用自定义放水值 /// </summary> /// <param name="coin">币值</param> public void FreeGainCustom(int coin) { if (mBss == null) { mBss = GameMain.Singleton.BSSetting; } if (mBss.Dat_GainAdjustIdx.Val != 0) { YxDebug.LogWarning("在抽放水状态下调用自定义抽放水,FreeGainCustom()调用无效"); return; } mBss.Dat_GainAdjustIdx.Val = 24; LossProfitData[24] = coin; var gdata = App.GetGameData <FishGameData>(); gdata.EvtPlayerGunFired += Handle_PlayerFire; gdata.EvtPlayerGainScoreFromFish += Handle_PlayerGainScoreFromFish; if (GainAdjust_GainScoreRT == null) { GainAdjust_GainScoreRT = new PersistentData <int, int>("GainAdjust_GainScoreRT"); } if (GainAdjust_LossScoreRT == null) { GainAdjust_LossScoreRT = new PersistentData <int, int>("GainAdjust_LossScoreRT"); } mScoreGain = GainAdjust_GainScoreRT.Val = 0; mScoreLoss = GainAdjust_LossScoreRT.Val = 0; mCurLossProfitScore = LossProfitData[mBss.Dat_GainAdjustIdx.Val] * mBss.InsertCoinScoreRatio.Val; StopCoroutine("_Coro_SaveGainData"); StartCoroutine("_Coro_SaveGainData"); StopCoroutine("_Coro_LossOrProfitprocess"); StartCoroutine("_Coro_LossOrProfitprocess"); }
public void AdvanceNeedScore() { BackStageSetting bss = GameMain.Singleton.BSSetting; int gunScoreCurrent = bss.Dat_PlayersGunScore[_owner.Idx].Val; gunScoreCurrent += bss.ScoreChangeValue.Val; if (gunScoreCurrent > bss.ScoreMax.Val) { gunScoreCurrent = bss.GetScoreMin(); } SetNeedCoinLabel(gunScoreCurrent); Text_NeedCoin.Commit(); bss.Dat_PlayersGunScore[_owner.Idx].Val = gunScoreCurrent;//记录 //音效 if (_owner.Idx == App.GameData.SelfSeat % 6) { Facade.Instance <MusicManager>().Play("changegun"); } }
//GunType mCurGunType = GunType.Normal; //void OnGUI() //{ // if (Idx == 0 && GUILayout.Button("change gun")) // { // if (mCurGunType == GunType.Normal) // { // ChangeGun(GunType.Lizi); // mCurGunType = GunType.Lizi; // } // else if (mCurGunType == GunType.Lizi) // { // ChangeGun(GunType.Normal); // mCurGunType = GunType.Normal; // } // } //} public void ScoreUp(bool isMultiTen) { BackStageSetting bss = GameMain.Singleton.BSSetting; int numCoin = 10 * (isMultiTen ? 10 : 1); int score = bss.InsertCoinScoreRatio.Val * numCoin; //判断是否爆机 if (bss.Dat_PlayersScore[Idx].Val + score >= Defines.NumScoreUpMax) { return; } ChangeScore(score); //上分 bss.His_CoinUp.Val += numCoin; bss.His_GainCurrent.Val += numCoin; bss.UpdateGainCurrentAndTotal(); //声音 // GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.SndShangFen); // Facade.Instance<MusicManager>().Play("onscore"); }
void Awake() { mBss = GameMain.Singleton.BSSetting; }