123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using wf;
- public class SlotManager : MonoBehaviour
- {
- public long credit
- {
- get
- {
- return this.m_Mycredit;
- }
- set
- {
- this.m_Mycredit = wf.Math.RoundMinMax(value, 0L, 999999L);
- }
- }
- private void Start()
- {
- SceneCasinoSlot component = GameObject.Find("_SceneCasinoSlot_").GetComponent<SceneCasinoSlot>();
- this.slotMachine = component.slotMachine;
- this.lever = component.lever;
- this.ballLamp = component.ballLamp;
- this.topLamp = component.topLamp;
- this.winMark = component.winMark;
- this.heartLamp = component.heartLamp;
- this.startButton = component.startButton;
- this.fadeMask = component.fadeMask;
- this.reels = component.reels;
- this.reelLights = component.reelLights;
- this.buttons = component.buttons;
- this.slotLight = component.slotLight;
- this.hitLight = component.hitLight;
- this.payoutNumber = component.payoutNumber;
- this.creditNumber = component.creditNumber;
- this.customMaidLamp = component.customMaidLamp;
- this.sevenLamp = component.sevenLamp;
- this.bigbonus = component.bigbonus;
- this.tex = component.tex;
- this.sprite = component.sprite;
- this.dispState = "初期状態";
- this.dispSymbol = "確定絵柄なし";
- for (int i = 0; i < 3; i++)
- {
- this.buttonFlg[i] = true;
- this.StopButtons[i].interactable = false;
- base.StartCoroutine(this.LightLamp(this.buttons[i].transform.GetChild(0).gameObject, false, this.lightingTime));
- this.stopIdArray[i] = -1;
- this.idReach[i] = 0;
- }
- this.GetCsv();
- ExChangeUI instance = ExChangeUI.Instance;
- instance.FadeOutStartAction = (Action)Delegate.Combine(instance.FadeOutStartAction, new Action(delegate
- {
- this.credit = GameMain.Instance.CharacterMgr.status.casinoCoin;
- this.CreditUpdate();
- }));
- this.Init();
- }
- private void Init()
- {
- this.isChanceMode = false;
- this.reachFlg = false;
- this.cherryWin = 0;
- this.normalCount = 0;
- this.chanceModeCount = 0;
- this.chanceCorrect = 0;
- this.credit = GameMain.Instance.CharacterMgr.status.casinoCoin;
- this.CreditUpdate();
- this.stopCount = 0;
- this.PayoutUpdate(0);
- this.state = 0;
- this.fixedWinSymbol = -1;
- this.fixedLine = -1;
- this.fixedBar = false;
- this.isBlock = true;
- this.reachSymbolList = new List<int>();
- this.idList = new List<int>();
- this.reelNoList = new List<int>();
- this.reachLine = new List<int>();
- this.fadeMask.SetActive(false);
- Material[] materials = this.slotMachine.GetComponent<Renderer>().materials;
- foreach (Material material in materials)
- {
- Debug.Log("mat = " + material.name);
- if (material.name == "Slot_Panel (Instance)")
- {
- Debug.Log("mat.texture = " + material.mainTexture);
- material.mainTexture = this.tex[3];
- }
- }
- }
- private void GetCsv()
- {
- CsvImporter component = GameObject.Find("SlotManager").GetComponent<CsvImporter>();
- this.msCount = component.GetCsvDataMs("casino_slot_byou.nei");
- component.GetCsvData("casino_slot_haitou.nei");
- this.normalMaxProb = component.GetCsvDataParse(0);
- this.chanceMaxProb = component.GetCsvDataParse(1);
- this.payDividend = component.GetCsvDataParseList(0);
- this.normalDividend = component.GetCsvDataParseList(1);
- this.chanceDividend = component.GetCsvDataParseList(2);
- }
- private void Update()
- {
- this.StateCheck();
- this._UpdateDispDescription();
- }
- public void _UpdateDispDescription()
- {
- int num = this.fixedWinSymbol;
- switch (num + 1)
- {
- case 0:
- this.dispSymbol = "確定絵柄なし";
- break;
- case 1:
- this.dispSymbol = "スリーセブン";
- break;
- case 2:
- this.dispSymbol = "BAR";
- break;
- case 3:
- this.dispSymbol = "ピエロ";
- break;
- case 4:
- this.dispSymbol = "ベル";
- break;
- case 5:
- this.dispSymbol = "サイ";
- break;
- case 6:
- this.dispSymbol = "マスカット";
- break;
- case 7:
- this.dispSymbol = "チェリー";
- break;
- }
- switch (this.state)
- {
- case 0:
- this.dispState = "初期状態";
- break;
- case 1:
- this.dispState = "開始待機";
- break;
- case 2:
- this.dispState = "ベット開始";
- break;
- case 3:
- this.dispState = "ベット中";
- break;
- case 4:
- this.dispState = "レバーオン開始";
- break;
- case 5:
- this.dispState = "レバーオン中";
- break;
- case 6:
- this.dispState = "プレイ開始";
- break;
- case 7:
- this.dispState = "プレイ中";
- break;
- case 8:
- this.dispState = "1個目停止";
- break;
- case 9:
- if (this.reachFlg)
- {
- this.dispState = "リーチ";
- }
- else
- {
- this.dispState = "2個目停止";
- }
- break;
- case 10:
- this.dispState = "全部停止";
- break;
- case 11:
- this.dispState = "停止後の処理";
- break;
- case 12:
- this.dispState = "当選時の処理";
- break;
- case 13:
- this.dispState = "チャンスモード判定";
- break;
- case 14:
- this.dispState = "BIGBONUS当選";
- break;
- case 15:
- this.dispState = "BIGBONUS処理";
- break;
- }
- }
- public void StateCheck()
- {
- if (this.state == 0)
- {
- this.cherryWin = 0;
- this.isBigBonusBgmPlay = false;
- this.winLine = new List<int>();
- this.fixedWinSymbol = -1;
- this.stopCount = 0;
- this.chanceCorrect = 0;
- this.fixedLine = -1;
- this.winSynbol = -1;
- this.isBlock = true;
- this.startButton.GetComponent<Image>().sprite = this.sprite[0];
- if (!this.isChanceMode)
- {
- for (int i = 0; i < 3; i++)
- {
- base.StartCoroutine(this.LightLamp(this.slotLight[i], false, this.lightingTime));
- }
- for (int j = 0; j < 10; j++)
- {
- base.StartCoroutine(this.LightLamp(this.customMaidLamp[j], false, this.lightingTime));
- }
- this.normalCount++;
- }
- else
- {
- this.chanceModeCount++;
- }
- for (int k = 0; k < 3; k++)
- {
- base.StartCoroutine(this.LightLamp(this.sevenLamp[k], false, this.lightingTime));
- Vector4 value = new Vector4(0f, 0f, 0f, 0f);
- this.reelLights[k].GetComponent<Renderer>().material.SetVector("_Mask1", value);
- this.reelLights[k].GetComponent<Renderer>().material.SetVector("_Mask2", value);
- this.reelLights[k].GetComponent<Renderer>().material.SetVector("_Mask3", value);
- this.idReach[k] = 0;
- }
- for (int l = 0; l < 5; l++)
- {
- base.StartCoroutine(this.LightLamp(this.hitLight[l], false, this.lightingTime));
- }
- for (int m = 0; m < 8; m++)
- {
- base.StartCoroutine(this.LightLamp(this.bigbonus[m], false, this.lightingTime));
- }
- base.StartCoroutine(this.LightLamp(this.heartLamp, false, this.lightingTime));
- base.StartCoroutine(this.LightLamp(this.ballLamp, false, this.lightingTime));
- base.StartCoroutine(this.LightLamp(this.topLamp, false, this.lightingTime));
- this.reachFlg = false;
- this.reachSymbolList = new List<int>();
- this.idList = new List<int>();
- this.reelNoList = new List<int>();
- this.reachLine = new List<int>();
- if (SlotManager.reelArray != null)
- {
- this.state = 1;
- }
- }
- else if (this.state == 2)
- {
- base.StartCoroutine(this.AutoBet());
- }
- else if (this.state == 4)
- {
- base.StartCoroutine(this.AutoLeverOn());
- }
- else if (this.state == 7)
- {
- this.AllReelsStopWait();
- }
- else if (this.state == 6)
- {
- this.isBlock = false;
- }
- else if (this.state == 8)
- {
- this.AllReelsStopWait();
- }
- else if (this.state == 9)
- {
- this.AllReelsStopWait();
- }
- else if (this.state == 10)
- {
- this.WinCheck();
- }
- else if (this.state == 11)
- {
- this.Win();
- }
- else if (this.state == 13)
- {
- this.ChanceModeCheck();
- }
- else if (this.state == 14)
- {
- base.StartCoroutine(this.BigBonus());
- }
- }
- public void ChanceModeCheck()
- {
- if (!this.isChanceMode)
- {
- if (UnityEngine.Random.Range(0, 100) < 1 + this.chanceCorrect)
- {
- this.StartChanceMode();
- }
- }
- else if (this.chanceModeCount >= 15)
- {
- this.EndChanceMode();
- }
- this.state = 0;
- SlotUImgr.Instance.UpdateUI();
- }
- public void StartChanceMode()
- {
- GameMain.Instance.SoundMgr.PlaySe("casino_SE011.ogg", false);
- this.isChanceMode = true;
- this.normalCount = 0;
- this.chanceModeCount = 0;
- base.StartCoroutine(this.ChenceModeFade(1.5f));
- }
- public void EndChanceMode()
- {
- this.isChanceMode = false;
- this.normalCount = 0;
- this.chanceModeCount = 0;
- Material[] materials = this.slotMachine.GetComponent<Renderer>().materials;
- foreach (Material material in materials)
- {
- Debug.Log("mat = " + material.name);
- if (material.name == "Slot_Panel (Instance)")
- {
- Debug.Log("mat.texture = " + material.mainTexture);
- material.mainTexture = this.tex[3];
- this.nowTexId = 0;
- }
- }
- }
- public IEnumerator ChenceModeFade(float time)
- {
- SlotUImgr.Instance.SetUIActive(false);
- float endTime = Time.time + time;
- this.fadeMask.SetActive(true);
- GameMain.Instance.MainCamera.FadeOut(time, false, null, false, Color.white);
- while (GameMain.Instance.MainCamera.IsFadeProc())
- {
- yield return null;
- }
- Material[] mats = this.slotMachine.GetComponent<Renderer>().materials;
- foreach (Material material in mats)
- {
- Debug.Log("mat = " + material.name);
- if (material.name == "Slot_Panel (Instance)")
- {
- Debug.Log("mat.texture = " + material.mainTexture);
- int num = UnityEngine.Random.Range(0, 3);
- material.mainTexture = this.tex[num];
- this.nowTexId = num + 1;
- }
- }
- for (int j = 0; j < 10; j++)
- {
- base.StartCoroutine(this.LightLamp(this.customMaidLamp[j], true, this.lightingTime));
- }
- GameMain.Instance.MainCamera.FadeIn(time, false, null, false, true, Color.white);
- while (GameMain.Instance.MainCamera.IsFadeProc())
- {
- yield return null;
- }
- SlotUImgr.Instance.SetUIActive(true);
- this.fadeMask.SetActive(false);
- yield return null;
- yield break;
- }
- public void AllReelsStopWait()
- {
- int num = 0;
- int num2 = -1;
- int num3 = -1;
- for (int i = 0; i < 3; i++)
- {
- if (this.reels[i].GetComponent<Reel>().state == 5)
- {
- num++;
- num3 = i;
- }
- if (!this.buttonFlg[i])
- {
- num2 = i;
- }
- }
- if (num == 0 && this.fixedBar)
- {
- this.fixedWinSymbol = 1;
- this.fixedLine = 1;
- this.fixedBar = false;
- }
- if (this.state == 7)
- {
- if (num == 1)
- {
- this.stopIdArray[0] = num3;
- this.FirstStopCheck(num3);
- this.stopCount = 1;
- this.isBlock = false;
- }
- }
- else if (this.state == 8 && num == 2 && num2 != -1)
- {
- this.stopCount = 2;
- this.stopIdArray[1] = 3 - (num2 + this.stopIdArray[0]);
- this.stopIdArray[2] = num2;
- this.CherryStopCheck(this.stopIdArray[1]);
- this.ReachCheck(num2);
- this.isBlock = false;
- }
- if (num == 3)
- {
- this.stopCount = 3;
- this.CherryStopCheck(this.stopIdArray[2]);
- this.state = 10;
- SlotUImgr.Instance.UpdateUI();
- }
- }
- public IEnumerator AutoBet()
- {
- this.state = 3;
- GameMain.Instance.CharacterMgr.status.casinoCoin -= 300L;
- yield return new WaitForSeconds(0.4f);
- GameMain.Instance.SoundMgr.PlaySe("casino_SE005.ogg", false);
- base.StartCoroutine(this.LightLamp(this.slotLight[0], true, 0.1f));
- base.StartCoroutine(this.LightLamp(this.hitLight[0], true, 0.1f));
- this.credit -= 100L;
- this.CreditUpdate();
- yield return new WaitForSeconds(0.1f);
- GameMain.Instance.SoundMgr.PlaySe("casino_SE005.ogg", false);
- base.StartCoroutine(this.LightLamp(this.slotLight[1], true, 0.1f));
- base.StartCoroutine(this.LightLamp(this.hitLight[1], true, 0.1f));
- base.StartCoroutine(this.LightLamp(this.hitLight[2], true, 0.1f));
- this.credit -= 100L;
- this.CreditUpdate();
- yield return new WaitForSeconds(0.1f);
- GameMain.Instance.SoundMgr.PlaySe("casino_SE005.ogg", false);
- base.StartCoroutine(this.LightLamp(this.slotLight[2], true, 0.1f));
- base.StartCoroutine(this.LightLamp(this.hitLight[3], true, 0.1f));
- base.StartCoroutine(this.LightLamp(this.hitLight[4], true, 0.1f));
- this.credit -= 100L;
- this.CreditUpdate();
- SlotUImgr.Instance.UpdateUI();
- yield return new WaitForSeconds(0.1f);
- this.state = 4;
- yield break;
- }
- public IEnumerator AutoLeverOn()
- {
- this.state = 5;
- float time = 0f;
- float limitTime = 0.25f;
- Quaternion from = Quaternion.Euler(-90f, 90f, 0f);
- Quaternion to = Quaternion.Euler(-50f, 90f, 0f);
- while (time < limitTime)
- {
- if (time < limitTime)
- {
- time += Time.deltaTime;
- if (time < limitTime / 2f)
- {
- this.lever.transform.rotation = Quaternion.Slerp(from, to, time * 8f);
- }
- else
- {
- this.lever.transform.rotation = Quaternion.Slerp(to, from, time * 8f - 1f);
- }
- }
- yield return null;
- }
- yield return new WaitForSeconds(0f);
- GameMain.Instance.SoundMgr.PlaySe("casino_SE006.ogg", false);
- for (int i = 0; i < 3; i++)
- {
- this.reels[i].GetComponent<Reel>().ChangeState(1);
- base.StartCoroutine(this.LightLamp(this.buttons[i].transform.GetChild(0).gameObject, true, this.lightingTime));
- this.buttonFlg[i] = false;
- this.StopButtons[i].interactable = true;
- }
- this.state = 6;
- SlotUImgr.Instance.UpdateUI();
- yield break;
- }
- private void FirstStopCheck(int id)
- {
- int[] array = new int[]
- {
- this.reels[id].GetComponent<Reel>().reelNo + 1,
- this.reels[id].GetComponent<Reel>().reelNo,
- this.reels[id].GetComponent<Reel>().reelNo - 1
- };
- for (int i = 0; i < 3; i++)
- {
- if (array[i] > 21)
- {
- array[i] -= 21;
- }
- if (array[i] < 1)
- {
- array[i] += 21;
- }
- }
- int[] array2 = new int[]
- {
- SlotManager.reelArray[id, 21 - array[0]],
- SlotManager.reelArray[id, 21 - array[1]],
- SlotManager.reelArray[id, 21 - array[2]]
- };
- this.CheckFirstStopReel(array2);
- for (int j = 0; j < 3; j++)
- {
- if (array2[j] == 0)
- {
- Debug.Log("7!");
- if (this.isChanceMode)
- {
- base.StartCoroutine(this.LightLamp(this.sevenLamp[id], true, this.lightingTime));
- }
- }
- else if (array2[j] == 6 && id == 0)
- {
- this.SymbolLight(id, array[j]);
- Debug.Log("Cherry!");
- }
- }
- this.state = 8;
- }
- private void CherryStopCheck(int id)
- {
- int[] array = new int[]
- {
- this.reels[id].GetComponent<Reel>().reelNo + 1,
- this.reels[id].GetComponent<Reel>().reelNo,
- this.reels[id].GetComponent<Reel>().reelNo - 1
- };
- for (int i = 0; i < 3; i++)
- {
- if (array[i] > 21)
- {
- array[i] -= 21;
- }
- if (array[i] < 1)
- {
- array[i] += 21;
- }
- }
- int[] array2 = new int[]
- {
- SlotManager.reelArray[id, 21 - array[0]],
- SlotManager.reelArray[id, 21 - array[1]],
- SlotManager.reelArray[id, 21 - array[2]]
- };
- for (int j = 0; j < 3; j++)
- {
- if (array2[j] == 6 && id == 0)
- {
- this.SymbolLight(id, array[j]);
- Debug.Log("Cherry!");
- }
- }
- }
- private void WinCherryCheck()
- {
- int[] array = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo,
- this.reels[1].GetComponent<Reel>().reelNo
- };
- int[] array2 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo + 1,
- this.reels[1].GetComponent<Reel>().reelNo + 1
- };
- int[] array3 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo - 1,
- this.reels[1].GetComponent<Reel>().reelNo - 1
- };
- for (int i = 0; i < 2; i++)
- {
- if (array2[i] > 21)
- {
- array2[i] -= 21;
- }
- if (array3[i] < 1)
- {
- array3[i] += 21;
- }
- }
- if (SlotManager.reelArray[0, 21 - array2[0]] == 6)
- {
- Debug.Log("1列目上にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 2;
- this.winLine.Add(2);
- this.winLine.Add(4);
- this.SymbolLight(0, array2[0]);
- }
- if (SlotManager.reelArray[0, 21 - array[0]] == 6)
- {
- Debug.Log("1列目真ん中にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 1;
- this.winLine.Add(1);
- this.SymbolLight(0, array[0]);
- }
- if (SlotManager.reelArray[0, 21 - array3[0]] == 6)
- {
- Debug.Log("1列目下にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 2;
- this.winLine.Add(3);
- this.winLine.Add(5);
- this.SymbolLight(0, array3[0]);
- }
- if (SlotManager.reelArray[0, 21 - array2[0]] == 6 && SlotManager.reelArray[1, 21 - array2[1]] == 6)
- {
- Debug.Log("上列にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 3;
- this.winLine.Add(2);
- this.SymbolLight(0, array2[0]);
- this.SymbolLight(1, array2[1]);
- }
- if (SlotManager.reelArray[0, 21 - array[0]] == 6 && SlotManager.reelArray[1, 21 - array[1]] == 6)
- {
- Debug.Log("中央列にチェリーが揃いました。");
- this.state = 11;
- this.winLine.Add(1);
- this.cherryWin = 4;
- this.SymbolLight(0, array[0]);
- this.SymbolLight(1, array[1]);
- }
- if (SlotManager.reelArray[0, 21 - array3[0]] == 6 && SlotManager.reelArray[1, 21 - array3[1]] == 6)
- {
- Debug.Log("下列にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 3;
- this.winLine.Add(3);
- this.SymbolLight(0, array3[0]);
- this.SymbolLight(1, array3[1]);
- }
- if (SlotManager.reelArray[0, 21 - array2[0]] == 6 && SlotManager.reelArray[1, 21 - array[1]] == 6)
- {
- Debug.Log("\列にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 5;
- this.SymbolLight(0, array2[0]);
- this.SymbolLight(1, array[1]);
- }
- if (SlotManager.reelArray[0, 21 - array3[0]] == 6 && SlotManager.reelArray[1, 21 - array[1]] == 6)
- {
- Debug.Log("/列にチェリーが揃いました。");
- this.state = 11;
- this.cherryWin = 5;
- this.SymbolLight(0, array3[0]);
- this.SymbolLight(1, array[1]);
- }
- }
- private void CheckFirstStopReel(int[] symbols)
- {
- int num = 0;
- int[] array = new int[3];
- for (int i = 0; i < 3; i++)
- {
- if (!this.isChanceMode)
- {
- switch (symbols[i])
- {
- case 0:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 1:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 2:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 3:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 4:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 5:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- case 6:
- num += this.normalDividend[symbols[i]];
- array[i] = this.normalDividend[symbols[i]];
- break;
- }
- }
- else
- {
- switch (symbols[i])
- {
- case 0:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 1:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 2:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 3:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 4:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 5:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- case 6:
- num += this.chanceDividend[symbols[i]];
- array[i] = this.chanceDividend[symbols[i]];
- break;
- }
- }
- }
- Debug.Log(string.Concat(new string[]
- {
- "確率:",
- array[0].ToString(),
- ", ",
- array[1].ToString(),
- ", ",
- array[2].ToString()
- }));
- Debug.Log("probability = " + num);
- UnityEngine.Random.Range(0, 100);
- int num2;
- if (this.isChanceMode)
- {
- num2 = UnityEngine.Random.Range(0, this.chanceMaxProb);
- }
- else
- {
- num2 = UnityEngine.Random.Range(0, this.normalMaxProb);
- }
- Debug.Log("rand = " + num2);
- if (num > num2)
- {
- for (int j = 0; j < 3; j++)
- {
- if (array[j] > num2)
- {
- if (!this.fixedBar)
- {
- Debug.Log("<color=red>" + symbols[j] + "が確定しました</color>");
- this.fixedWinSymbol = symbols[j];
- this.fixedLine = j;
- }
- else
- {
- Debug.Log("<color=red>Bar半確定</color>");
- }
- break;
- }
- num2 -= array[j];
- }
- }
- else
- {
- Debug.Log("<color=blue>外れ</color>");
- }
- }
- private void ReachCheck(int id)
- {
- this.state = 9;
- this.reachSymbolList = new List<int>();
- this.idList = new List<int>();
- this.reelNoList = new List<int>();
- int[] array = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo,
- this.reels[1].GetComponent<Reel>().reelNo,
- this.reels[2].GetComponent<Reel>().reelNo
- };
- int[] array2 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo + 1,
- this.reels[1].GetComponent<Reel>().reelNo + 1,
- this.reels[2].GetComponent<Reel>().reelNo + 1
- };
- int[] array3 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo - 1,
- this.reels[1].GetComponent<Reel>().reelNo - 1,
- this.reels[2].GetComponent<Reel>().reelNo - 1
- };
- for (int i = 0; i < 3; i++)
- {
- if (array2[i] > 21)
- {
- array2[i] -= 21;
- }
- if (array3[i] < 1)
- {
- array3[i] += 21;
- }
- if (array[i] < 1)
- {
- array[i] += 21;
- }
- }
- int[] array4 = new int[]
- {
- SlotManager.reelArray[0, 21 - array2[0]],
- SlotManager.reelArray[1, 21 - array2[1]],
- SlotManager.reelArray[2, 21 - array2[2]]
- };
- int[] array5 = new int[]
- {
- SlotManager.reelArray[0, 21 - array[0]],
- SlotManager.reelArray[1, 21 - array[1]],
- SlotManager.reelArray[2, 21 - array[2]]
- };
- int[] array6 = new int[]
- {
- SlotManager.reelArray[0, 21 - array3[0]],
- SlotManager.reelArray[1, 21 - array3[1]],
- SlotManager.reelArray[2, 21 - array3[2]]
- };
- for (int j = 0; j < 3; j++)
- {
- if (id == j)
- {
- array5[j] = -1;
- array4[j] = -1;
- array6[j] = -1;
- }
- }
- if (array5[0] == array5[1] || array5[0] == array5[2] || array5[1] == array5[2])
- {
- Debug.Log("1:リーチです");
- this.reachFlg = true;
- if (array5[0] != -1)
- {
- this.reachSymbolList.Add(array5[0]);
- }
- else
- {
- this.reachSymbolList.Add(array5[1]);
- }
- for (int k = 0; k < 3; k++)
- {
- if (array5[k] != -1)
- {
- this.idList.Add(k);
- this.reelNoList.Add(array[k]);
- }
- }
- this.reachLine.Add(1);
- }
- if (array4[0] == array4[1] || array4[0] == array4[2] || array4[1] == array4[2])
- {
- this.reachFlg = true;
- if (array4[0] != -1)
- {
- this.reachSymbolList.Add(array4[0]);
- }
- else
- {
- this.reachSymbolList.Add(array4[1]);
- }
- for (int l = 0; l < 3; l++)
- {
- if (array4[l] != -1)
- {
- this.idList.Add(l);
- this.reelNoList.Add(array2[l]);
- }
- }
- this.reachLine.Add(2);
- }
- if (array6[0] == array6[1] || array6[0] == array6[2] || array6[1] == array6[2])
- {
- Debug.Log("3:リーチです");
- this.reachFlg = true;
- if (array6[0] != -1)
- {
- this.reachSymbolList.Add(array6[0]);
- }
- else
- {
- this.reachSymbolList.Add(array6[1]);
- }
- for (int m = 0; m < 3; m++)
- {
- if (array6[m] != -1)
- {
- this.idList.Add(m);
- this.reelNoList.Add(array3[m]);
- }
- }
- this.reachLine.Add(3);
- }
- if (array4[0] == array5[1] || array5[1] == array6[2] || array4[0] == array6[2])
- {
- Debug.Log("4:リーチです");
- this.reachFlg = true;
- if (array4[0] != -1)
- {
- this.reachSymbolList.Add(array4[0]);
- }
- else
- {
- this.reachSymbolList.Add(array5[1]);
- }
- if (array4[0] == -1)
- {
- this.idList.Add(1);
- this.reelNoList.Add(array[1]);
- this.idList.Add(2);
- this.reelNoList.Add(array3[2]);
- }
- if (array5[1] == -1)
- {
- this.idList.Add(0);
- this.reelNoList.Add(array2[0]);
- this.idList.Add(2);
- this.reelNoList.Add(array3[2]);
- }
- if (array6[2] == -1)
- {
- this.idList.Add(0);
- this.reelNoList.Add(array2[0]);
- this.idList.Add(1);
- this.reelNoList.Add(array[1]);
- }
- this.reachLine.Add(4);
- }
- if (array6[0] == array5[1] || array5[1] == array4[2] || array6[0] == array4[2])
- {
- Debug.Log("5:リーチです");
- this.reachFlg = true;
- if (array6[0] != -1)
- {
- this.reachSymbolList.Add(array6[0]);
- }
- else
- {
- this.reachSymbolList.Add(array5[1]);
- }
- if (array6[0] == -1)
- {
- this.idList.Add(1);
- this.reelNoList.Add(array[1]);
- this.idList.Add(2);
- this.reelNoList.Add(array2[2]);
- }
- if (array5[1] == -1)
- {
- this.idList.Add(0);
- this.reelNoList.Add(array3[0]);
- this.idList.Add(2);
- this.reelNoList.Add(array2[2]);
- }
- if (array4[2] == -1)
- {
- this.idList.Add(0);
- this.reelNoList.Add(array3[0]);
- this.idList.Add(1);
- this.reelNoList.Add(array[1]);
- }
- this.reachLine.Add(5);
- }
- foreach (int num in this.reachSymbolList)
- {
- }
- int num2 = 0;
- List<int> list = new List<int>();
- foreach (int id2 in this.idList)
- {
- this.SymbolLight(id2, this.reelNoList[num2]);
- num2++;
- }
- foreach (int num3 in this.reachLine)
- {
- }
- if (this.reachFlg)
- {
- GameMain.Instance.SoundMgr.PlaySe("casino_SE008.ogg", false);
- base.StartCoroutine(this.LightLamp(this.ballLamp, true, this.lightingTime));
- base.StartCoroutine(this.LightLamp(this.topLamp, true, this.lightingTime));
- if (this.isChanceMode)
- {
- using (List<int>.Enumerator enumerator4 = this.reachSymbolList.GetEnumerator())
- {
- while (enumerator4.MoveNext())
- {
- if (enumerator4.Current == 0)
- {
- Debug.Log("seven reach!");
- base.StartCoroutine(this.LightLamp(this.sevenLamp[this.stopIdArray[1]], true, this.lightingTime));
- string f_strFileName = null;
- switch (this.nowTexId)
- {
- case 1:
- f_strFileName = "H0_09451.ogg";
- break;
- case 2:
- f_strFileName = "H1_09950.ogg";
- break;
- case 3:
- f_strFileName = "H2_10068.ogg";
- break;
- default:
- Debug.LogError("該当するボイスがありません。");
- break;
- }
- GameMain.Instance.SoundMgr.PlaySe(f_strFileName, false);
- }
- }
- }
- }
- }
- }
- private void SymbolLight(int id, int reelNo)
- {
- float y = this.reelLights[id].GetComponent<Renderer>().sharedMaterial.GetTextureOffset("_MainTex").y;
- Vector4 value;
- if (reelNo > 9)
- {
- value = new Vector4(0f, 0.04761905f * (float)reelNo, 0f, 0.04761905f * (float)(reelNo - 1));
- }
- else
- {
- value = new Vector4(0f, 0.04761905f * (float)(reelNo + 21), 0f, 0.04761905f * (float)(reelNo + 20));
- }
- if (reelNo == 9)
- {
- if (y < 0.1f)
- {
- value = new Vector4(0f, Mathf.Abs(1f - 0.04761905f * (float)(reelNo + 21)), 0f, Mathf.Abs(1f - 0.04761905f * (float)(reelNo + 20)));
- }
- else
- {
- value = new Vector4(0f, 0.04761905f * (float)(reelNo + 21), 0f, 0.04761905f * (float)(reelNo + 20));
- }
- }
- else if (reelNo == 8)
- {
- if ((double)y > 0.9)
- {
- value = new Vector4(0f, 0.04761905f * (float)reelNo + 1f, 0f, 0.04761905f * (float)(reelNo - 1) + 1f);
- }
- else
- {
- value = new Vector4(0f, 0.04761905f * (float)reelNo, 0f, 0.04761905f * (float)(reelNo - 1));
- }
- }
- if (this.idReach[id] == 0)
- {
- this.reelLights[id].GetComponent<Renderer>().material.SetVector("_Mask1", value);
- }
- else if (this.idReach[id] == 1)
- {
- this.reelLights[id].GetComponent<Renderer>().material.SetVector("_Mask2", value);
- }
- else
- {
- this.reelLights[id].GetComponent<Renderer>().material.SetVector("_Mask3", value);
- }
- this.idReach[id]++;
- if (this.idReach[id] > 2)
- {
- this.idReach[id] = 0;
- }
- }
- private void WinCheck()
- {
- this.state = 13;
- int[] array = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo,
- this.reels[1].GetComponent<Reel>().reelNo,
- this.reels[2].GetComponent<Reel>().reelNo
- };
- int[] array2 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo + 1,
- this.reels[1].GetComponent<Reel>().reelNo + 1,
- this.reels[2].GetComponent<Reel>().reelNo + 1
- };
- int[] array3 = new int[]
- {
- this.reels[0].GetComponent<Reel>().reelNo - 1,
- this.reels[1].GetComponent<Reel>().reelNo - 1,
- this.reels[2].GetComponent<Reel>().reelNo - 1
- };
- for (int i = 0; i < 3; i++)
- {
- if (array2[i] > 21)
- {
- array2[i] -= 21;
- }
- if (array3[i] < 1)
- {
- array3[i] += 21;
- }
- }
- for (int j = 0; j < 3; j++)
- {
- Vector4 value = new Vector4(0f, 0f, 0f, 0f);
- this.reelLights[j].GetComponent<Renderer>().material.SetVector("_Mask1", value);
- this.reelLights[j].GetComponent<Renderer>().material.SetVector("_Mask2", value);
- this.reelLights[j].GetComponent<Renderer>().material.SetVector("_Mask3", value);
- }
- if (SlotManager.reelArray[0, 21 - array[0]] == SlotManager.reelArray[1, 21 - array[1]] && SlotManager.reelArray[0, 21 - array[0]] == SlotManager.reelArray[2, 21 - array[2]])
- {
- Debug.Log("1LINE目に" + SlotManager.reelArray[0, 21 - array[0]] + "が揃いました。");
- this.state = 11;
- this.winLine.Add(1);
- this.winSynbol = SlotManager.reelArray[0, 21 - array[0]];
- this.SymbolLight(0, array[0]);
- this.SymbolLight(1, array[1]);
- this.SymbolLight(2, array[2]);
- }
- if (SlotManager.reelArray[0, 21 - array2[0]] == SlotManager.reelArray[1, 21 - array2[1]] && SlotManager.reelArray[0, 21 - array2[0]] == SlotManager.reelArray[2, 21 - array2[2]])
- {
- Debug.Log("2LINE目上段に" + SlotManager.reelArray[0, 21 - array2[0]] + "が揃いました。");
- this.state = 11;
- this.winLine.Add(2);
- this.winSynbol = SlotManager.reelArray[0, 21 - array2[0]];
- this.SymbolLight(0, array2[0]);
- this.SymbolLight(1, array2[1]);
- this.SymbolLight(2, array2[2]);
- }
- if (SlotManager.reelArray[0, 21 - array3[0]] == SlotManager.reelArray[1, 21 - array3[1]] && SlotManager.reelArray[0, 21 - array3[0]] == SlotManager.reelArray[2, 21 - array3[2]])
- {
- Debug.Log("2LINE目下段に" + SlotManager.reelArray[0, 21 - array3[0]] + "が揃いました。");
- this.state = 11;
- this.winLine.Add(3);
- this.winSynbol = SlotManager.reelArray[0, 21 - array3[0]];
- this.SymbolLight(0, array3[0]);
- this.SymbolLight(1, array3[1]);
- this.SymbolLight(2, array3[2]);
- }
- if (SlotManager.reelArray[0, 21 - array2[0]] == SlotManager.reelArray[1, 21 - array[1]] && SlotManager.reelArray[0, 21 - array2[0]] == SlotManager.reelArray[2, 21 - array3[2]])
- {
- Debug.Log("上→下に" + SlotManager.reelArray[0, 21 - array2[0]] + "が揃いました。");
- this.state = 11;
- this.winLine.Add(4);
- this.winSynbol = SlotManager.reelArray[0, 21 - array2[0]];
- this.SymbolLight(0, array2[0]);
- this.SymbolLight(1, array[1]);
- this.SymbolLight(2, array3[2]);
- }
- if (SlotManager.reelArray[0, 21 - array3[0]] == SlotManager.reelArray[1, 21 - array[1]] && SlotManager.reelArray[0, 21 - array3[0]] == SlotManager.reelArray[2, 21 - array2[2]])
- {
- Debug.Log("下→上に" + SlotManager.reelArray[0, 21 - array3[0]] + "が揃いました。");
- this.state = 11;
- this.winLine.Add(5);
- this.winSynbol = SlotManager.reelArray[0, 21 - array3[0]];
- this.SymbolLight(0, array3[0]);
- this.SymbolLight(1, array[1]);
- this.SymbolLight(2, array2[2]);
- }
- this.WinCherryCheck();
- if (this.state == 11 && this.winSynbol == 0)
- {
- this.state = 14;
- }
- }
- private void Win()
- {
- this.state = 12;
- base.StartCoroutine(this.Payout());
- for (int i = 0; i < 3; i++)
- {
- base.StartCoroutine(this.BlinkLamp(this.slotLight[i], 0.5f, 0f));
- }
- base.StartCoroutine(this.BlinkLamp(this.topLamp, 0.1f, 0f));
- base.StartCoroutine(this.BlinkLamp(this.ballLamp, 0.1f, 0f));
- for (int j = 0; j < 5; j++)
- {
- base.StartCoroutine(this.LightLamp(this.hitLight[j], false, this.lightingTime));
- }
- foreach (int num in this.winLine)
- {
- base.StartCoroutine(this.LightLamp(this.hitLight[num - 1], true, this.lightingTime));
- }
- base.StartCoroutine(this.BlinkLamp(this.winMark, 0.1f, 0f));
- }
- private IEnumerator BigBonus()
- {
- this.state = 15;
- GameMain.Instance.SoundMgr.PlaySe("casino_SE009.ogg", false);
- this.isBigBonusBgmPlay = true;
- this.isPayoutRunning = true;
- base.StartCoroutine(this.BlinkBigBonusLamp());
- base.StartCoroutine(this.LightLamp(this.sevenLamp[this.stopIdArray[2]], true, this.lightingTime));
- base.StartCoroutine(this.BlinkLamp(this.heartLamp, 0.1f, 0f));
- for (int i = 0; i < 3; i++)
- {
- base.StartCoroutine(this.BlinkLamp(this.slotLight[i], 0.5f, 0f));
- }
- base.StartCoroutine(this.BlinkLamp(this.topLamp, 0.1f, 0f));
- base.StartCoroutine(this.BlinkLamp(this.ballLamp, 0.1f, 0f));
- base.StartCoroutine(this.BlinkLamp(this.winMark, 0.1f, 0f));
- for (int j = 0; j < 5; j++)
- {
- base.StartCoroutine(this.LightLamp(this.hitLight[j], true, this.lightingTime));
- }
- yield return new WaitForSeconds(6f);
- string str = null;
- switch (this.nowTexId)
- {
- case 1:
- str = "H0_09452.ogg";
- break;
- case 2:
- str = "H1_09951.ogg";
- break;
- case 3:
- str = "H2_10069.ogg";
- break;
- default:
- Debug.LogError("該当するボイスがありません。");
- break;
- }
- GameMain.Instance.SoundMgr.PlaySe(str, false);
- yield return new WaitForSeconds(6.5f);
- this.isBigBonusBgmPlay = false;
- base.StartCoroutine(this.Payout());
- yield return null;
- yield break;
- }
- private IEnumerator BlinkBigBonusLamp()
- {
- float waitTime = 0.5f;
- for (int j = 0; j < 8; j++)
- {
- base.StartCoroutine(this.LightLamp(this.bigbonus[j], true, 0.1f));
- }
- for (int i = 0; i < 8; i++)
- {
- base.StartCoroutine(this.BlinkLamp(this.bigbonus[i], 0.5f, 1.5f));
- yield return new WaitForSeconds(waitTime);
- }
- yield return null;
- yield break;
- }
- private IEnumerator Payout()
- {
- int payCredit = 0;
- int totalpay = 0;
- this.isPayoutRunning = true;
- if (this.cherryWin != 0)
- {
- if (!this.isChanceMode)
- {
- switch (this.cherryWin)
- {
- case 1:
- this.fixedBar = true;
- payCredit = this.payDividend[6];
- break;
- case 2:
- payCredit = this.payDividend[6] * 2;
- break;
- case 3:
- this.chanceCorrect = 19;
- payCredit = this.payDividend[6] * 2;
- break;
- case 4:
- this.fixedBar = true;
- payCredit = this.payDividend[6] * 2;
- break;
- case 5:
- payCredit = this.payDividend[6] * 3;
- break;
- }
- }
- else
- {
- switch (this.cherryWin)
- {
- case 1:
- payCredit = this.payDividend[6];
- break;
- case 2:
- payCredit = this.payDividend[6] * 2;
- break;
- case 3:
- payCredit = this.payDividend[6];
- break;
- case 4:
- payCredit = this.payDividend[6] * 2;
- break;
- case 5:
- payCredit = this.payDividend[6] * 3;
- break;
- }
- }
- this.PayoutUpdate(payCredit);
- yield return new WaitForSeconds(1f);
- GameMain.Instance.CharacterMgr.status.casinoCoin += (long)payCredit;
- totalpay += payCredit;
- while (payCredit > 0)
- {
- GameMain.Instance.SoundMgr.PlaySe("casino_SE010.ogg", true);
- payCredit -= 100;
- this.PayoutUpdate(payCredit);
- this.credit += 100L;
- this.CreditUpdate();
- yield return new WaitForSeconds((float)this.msCount / 1000f);
- }
- SlotUImgr.Instance.UpdateUI();
- GameMain.Instance.SoundMgr.StopSe();
- }
- if (this.winSynbol != -1)
- {
- yield return new WaitForSeconds(0.5f);
- switch (this.winSynbol)
- {
- case 1:
- this.chanceCorrect = 99;
- break;
- }
- payCredit = this.payDividend[this.winSynbol];
- this.PayoutUpdate(payCredit);
- yield return new WaitForSeconds(1f);
- GameMain.Instance.CharacterMgr.status.casinoCoin += (long)payCredit;
- totalpay += payCredit;
- while (payCredit > 0)
- {
- GameMain.Instance.SoundMgr.PlaySe("casino_SE010.ogg", true);
- payCredit -= 100;
- this.PayoutUpdate(payCredit);
- this.credit += 100L;
- this.CreditUpdate();
- yield return new WaitForSeconds((float)this.msCount / 1000f);
- }
- CasinoDataMgr.Instance.AddTotalCoin(totalpay);
- SlotUImgr.Instance.UpdateUI();
- GameMain.Instance.SoundMgr.StopSe();
- yield return new WaitForSeconds(0.5f);
- }
- this.isPayoutRunning = false;
- if (this.winSynbol == 0)
- {
- this.EndChanceMode();
- this.chanceCorrect = -1;
- }
- this.state = 13;
- yield break;
- }
- private void CreditUpdate()
- {
- long[] array = new long[6];
- long num = this.credit;
- for (int i = 0; i < 6; i++)
- {
- array[i] = num % 10L;
- num /= 10L;
- }
- for (int j = 0; j < 6; j++)
- {
- Vector2 value = new Vector2(0f, (float)(-(float)array[j]) / 10f);
- this.creditNumber[j].GetComponent<Renderer>().sharedMaterial.SetTextureOffset("_MainTex", value);
- }
- }
- private void PayoutUpdate(int payout)
- {
- int[] array = new int[6];
- int num = payout;
- for (int i = 0; i < 6; i++)
- {
- array[i] = num % 10;
- num /= 10;
- }
- for (int j = 0; j < 6; j++)
- {
- Vector2 value = new Vector2(0f, (float)(-(float)array[j]) / 10f);
- this.payoutNumber[j].GetComponent<Renderer>().sharedMaterial.SetTextureOffset("_MainTex", value);
- }
- }
- private IEnumerator BlinkLamp(GameObject obj, float waitTime, float waitTime2 = 0f)
- {
- if (waitTime2 == 0f)
- {
- waitTime2 = waitTime;
- }
- while (this.isPayoutRunning)
- {
- base.StartCoroutine(this.LightLamp(obj, true, this.lightingTime));
- yield return new WaitForSeconds(waitTime2);
- base.StartCoroutine(this.LightLamp(obj, false, this.lightingTime));
- yield return new WaitForSeconds(waitTime);
- }
- yield break;
- }
- public IEnumerator LightLamp(GameObject obj, bool flg, float time)
- {
- float startTime = Time.time;
- float alpha = 0.5f / time;
- if (!flg)
- {
- if (!obj.activeSelf)
- {
- yield break;
- }
- }
- obj.SetActive(true);
- while (time > Time.time - startTime)
- {
- float setAlpha = alpha * (Time.time - startTime);
- if (flg)
- {
- Color value = new Color(0.5f, 0.5f, 0.5f, setAlpha);
- obj.GetComponent<Renderer>().material.SetColor("_TintColor", value);
- }
- else
- {
- Color value2 = new Color(0.5f, 0.5f, 0.5f, 0.5f - setAlpha);
- obj.GetComponent<Renderer>().material.SetColor("_TintColor", value2);
- }
- yield return null;
- }
- if (!flg)
- {
- Color value3 = new Color(0.5f, 0.5f, 0.5f, 0f);
- obj.GetComponent<Renderer>().material.SetColor("_TintColor", value3);
- obj.SetActive(false);
- }
- else
- {
- Color value4 = new Color(0.5f, 0.5f, 0.5f, 0.5f);
- obj.GetComponent<Renderer>().material.SetColor("_TintColor", value4);
- }
- yield break;
- }
- [HideInInspector]
- public List<int> reachSymbolList = new List<int>();
- [HideInInspector]
- public List<int> idList = new List<int>();
- [HideInInspector]
- public List<int> reelNoList = new List<int>();
- [HideInInspector]
- public List<int> reachLine = new List<int>();
- [HideInInspector]
- public int[] normalDividend = new int[8];
- [HideInInspector]
- public int[] chanceDividend = new int[8];
- [HideInInspector]
- public int[] payDividend = new int[8];
- [HideInInspector]
- public int normalMaxProb;
- [HideInInspector]
- public int chanceMaxProb;
- [HideInInspector]
- private List<int> winLine;
- [HideInInspector]
- public bool[] buttonFlg = new bool[3];
- [HideInInspector]
- public int[] stopIdArray = new int[3];
- [HideInInspector]
- public int[] idReach = new int[3];
- [HideInInspector]
- public bool reachFlg;
- [HideInInspector]
- private int winSynbol = -1;
- [HideInInspector]
- private bool isPayoutRunning;
- public List<Button> StopButtons = new List<Button>();
- [SerializeField]
- [Header("クレジット")]
- private long m_Mycredit;
- [SerializeField]
- [Header("クレジット移動にかかる時間")]
- public int msCount;
- [HideInInspector]
- public bool isChanceMode;
- [HideInInspector]
- public float lightingTime = 0.1f;
- [HideInInspector]
- private bool isBigBonusBgmPlay;
- [HideInInspector]
- public int stopCount;
- [HideInInspector]
- public int fixedWinSymbol;
- [SerializeField]
- [Header("当選(半)確定絵柄")]
- private string dispSymbol;
- [SerializeField]
- [Header("現在のステート")]
- private string dispState;
- [SerializeField]
- [Header("当選確定ライン")]
- public int fixedLine;
- [HideInInspector]
- public bool isBlock;
- [HideInInspector]
- public int cherryWin;
- [SerializeField]
- [Header("通常モードの回転回数")]
- public int normalCount;
- [SerializeField]
- [Header("チャンスモードの回転回数")]
- public int chanceModeCount;
- [SerializeField]
- [Header("チャンスモードに入る追加確率(0~99%)")]
- [Range(0f, 99f)]
- public int chanceCorrect;
- [SerializeField]
- [Header("バー半確定モードか否か")]
- public bool fixedBar;
- private int nowTexId;
- public static int[,] reelArray = new int[,]
- {
- {
- 3,
- 0,
- 4,
- 5,
- 4,
- 5,
- 1,
- 6,
- 5,
- 4,
- 5,
- 0,
- 2,
- 5,
- 4,
- 5,
- 6,
- 1,
- 5,
- 4,
- 5
- },
- {
- 4,
- 0,
- 5,
- 6,
- 4,
- 3,
- 5,
- 6,
- 4,
- 1,
- 5,
- 6,
- 2,
- 4,
- 0,
- 5,
- 6,
- 4,
- 3,
- 5,
- 6
- },
- {
- 5,
- 0,
- 1,
- 3,
- 4,
- 5,
- 2,
- 3,
- 4,
- 5,
- 2,
- 3,
- 4,
- 5,
- 2,
- 3,
- 4,
- 5,
- 2,
- 3,
- 4
- }
- };
- [HideInInspector]
- public int state;
- public const int STATE_WAIT = 0;
- public const int STATE_START_WAIT = 1;
- public const int STATE_BET = 2;
- public const int STATE_BET_WAIT = 3;
- public const int STATE_LEVER_ON = 4;
- public const int STATE_LEVER_ON_WAIT = 5;
- public const int STATE_PLAY = 6;
- public const int STATE_PLAY_WAIT = 7;
- public const int STATE_FIRST_STOP = 8;
- public const int STATE_REACH = 9;
- public const int STATE_STOP = 10;
- public const int STATE_STOP_WAIT = 11;
- public const int STATE_WIN = 12;
- public const int STATE_CHANCE_CHECK = 13;
- public const int STATE_BIG_BONUS = 14;
- public const int STATE_BIG_BONUS_WAIT = 15;
- private GameObject slotMachine;
- private GameObject lever;
- private GameObject ballLamp;
- private GameObject topLamp;
- private GameObject winMark;
- private GameObject heartLamp;
- private GameObject startButton;
- private GameObject fadeMask;
- private GameObject[] reels = new GameObject[3];
- private GameObject[] reelLights = new GameObject[3];
- private GameObject[] buttons = new GameObject[3];
- private GameObject[] slotLight = new GameObject[3];
- private GameObject[] hitLight = new GameObject[5];
- private GameObject[] payoutNumber = new GameObject[6];
- private GameObject[] creditNumber = new GameObject[6];
- private GameObject[] customMaidLamp = new GameObject[10];
- private GameObject[] sevenLamp = new GameObject[3];
- private GameObject[] bigbonus = new GameObject[8];
- private Texture[] tex = new Texture[4];
- private Sprite[] sprite = new Sprite[2];
- }
|