public void SetCurrentAnimal(LSAnimalType type) { _curTrans.gameObject.SetActive(false); switch (type) { case LSAnimalType.GOLD_HZ: case LSAnimalType.HZ: _curTrans = _monkey; break; case LSAnimalType.XM: case LSAnimalType.GOLD_XM: _curTrans = _panda; break; case LSAnimalType.SZ: case LSAnimalType.GOLD_SZ: _curTrans = _lion; break; case LSAnimalType.TZ: case LSAnimalType.GOLD_TZ: _curTrans = _rabbit; break; } _curAnimation = _curTrans.GetComponent <Animation>(); _curTrans.gameObject.SetActive(true); }
private int FindAnimalIndex(LSAnimalType type) { for (int i = 0; i < Animals.Length; i++) { if (Animals[i] == type) { return(i); } } YxDebug.LogError("Such type is not exist " + type.ToString()); return(-1); }
private int GetLastIndex(LSAnimalType type) { var index = Items.FindLastIndex(delegate(LSItemBase obj) { var item = (LSAnimalItem)obj; return(item.IsRightAnimal(type)); }); if (index < 0 || index >= Items.Count) { index = -1; YxDebug.LogError("Animal is not exist"); } return(index); }
/// <summary> /// 获得最新的历史记录的详细信息 /// </summary> /// <returns></returns> public LS_Detail_Result SetDetialResult(int TurnTablePosition, float Time, int multiple, int addGold) { //Debug.LogError("本局结果是"); LSResult res = GetHistoryResult(LSConstant.History_Lenth - 1); LSColorType resultColor = Colors[TurnTablePosition]; LSAnimalType resultAnimal = (LSAnimalType)AnimalStartPos[TurnTablePosition]; LastResult.Banker = res.Banker; LastResult.TurnTablePosition = TurnTablePosition; LastResult.BetIndex = res.BetIndex; LastResult.Reward = res.ResultType; //LastResult.Reward = LSRewardType.LIGHTING; LastResult.Cor = (LSColorType)(res.BetIndex % 3); LastResult.Ani = (LSAnimalType)(res.BetIndex / 3); YxDebug.Log("通过历史数据解析的结果为:动物 " + LastResult.Ani + " 颜色是:" + LastResult.Cor); LastResult.Cor = resultColor; LastResult.Ani = resultAnimal; LastResult.Multiple = multiple; //LastResult.Multiple = 3; _totalGold += addGold; LastResult.WinBets = addGold; YxDebug.Log("结果类型:" + LastResult.Reward); YxDebug.Log("指针:" + LastResult.TurnTablePosition); YxDebug.Log("动物:" + LastResult.Ani); YxDebug.Log("颜色: " + LastResult.Cor); YxDebug.Log("庄和闲: " + LastResult.Banker); YxDebug.Log("增加金币" + addGold); var gameMgr = App.GetGameManager <LswcGamemanager>(); LastResult.ToColor = gameMgr.ColorItemControl.GetCheckColorItem(LastResult.TurnTablePosition) as LSColorItem; if (LastResult.ToColor != null) { LastResult.ToAngle = LastResult.ToColor.transform.localEulerAngles; } LastResult.ToAnimal = gameMgr.AnimalItemCtrl.GetCheckColorItem((LastResult.TurnTablePosition - AnimalRandomSeed + LSConstant.Num_AnimalItemNumber) % 24) as LSAnimalItem; LastResult.lastResultVoice = GetResultVoice(); return(LastResult); }
public bool IsRightAnimal(LSAnimalType type) { return(type == CurType); }