void UpdateData(int cur) { numLbl.text = "No." + (cur + 1).ToString(); input.value = itemTittles[cur]; sp.spriteName = itemSprites[cur]; maxHas.value = itemNumsMax[cur].ToString(); price.value = itemPrices[cur].ToString(); unlockAt.value = itemUnlockAt[cur].ToString(); if (heavyCategory[cur] != null) { currentHeavy = heavyCategory[cur]; } else { currentHeavy = Constants.Heavy.m; } popup.value = HeavySt[(int)currentHeavy]; Debug.Log("" + HeavySt[(int)currentHeavy]); SetRangeValue((LureRangePivot)rangePivot[cur], rangeSize[cur]); SetRAngePivot((LureRangePivot)rangePivot[cur]); //コンタクト;根掛かり回避;ラトル;スプラッシュ;集魚剤;反射板 0=false 1=true //"0101000" setCK(avility[cur]); //0 =-1 0.5=0 1.0=1.0 colorRangeSL.value = HenkanColToRange(colorRange[cur]); graphVals[0].value = graph_1[cur] / 100.0f; graphVals[1].value = graph_2[cur] / 100.0f; graphVals[2].value = graph_3[cur] / 100.0f; graphVals[3].value = graph_4[cur] / 100.0f; graphVals[4].value = graph_5[cur] / 100.0f; }
float GetAishouLure(int rod, int lure, bool isSoft) { float vals = -100.0f; if (lure == -1) { Debug.LogError("やばいやつ"); return(vals); } int rigNum = isSoft?equipSoft.GetEquippedRigID(lure):0; Constants.Heavy lureHeavy = Constants.Heavy.h; Constants.Heavy rodHeavy = Constants.Heavy.h; //Heavy{ul,l,ml,m,mh,h,xh} Debug.Log("GetAishouLure " + rod + " ルアー " + lure + " " + isSoft); rodHeavy = Constants.RodsDatas.heavyCategory[rod]; lureHeavy = !isSoft? Constants.LureDatas.heavyCategory[lure]:Constants.RigDatas.heavyCategory[rigNum]; Debug.Log("ロッドの重さ= " + rodHeavy.ToString() + "ルアーの重さ= " + lureHeavy.ToString()); //飛距離;感度;適合サイズ;フッキング;強度 int aishouTemp = GetHeavyAishou(rodHeavy, lureHeavy); switch (Mathf.Abs(aishouTemp)) { case 0: vals = -0.0f; break; case 1: vals = -0.25f; break; case 2: vals = -0.1f; break; case 3: vals = -0.15f; break; case 4: vals = -0.25f; break; case 5: vals = -0.3f; break; case 6: vals = -0.4f; break; } return(vals); }
float GetAishouLine(int rod, int line) { float vals = -100.0f; if (rod == -1 || line == -1) { Debug.LogError("やばいやつ"); return(vals); } Debug.Log("ロッど= " + rod + "ライン " + line); Constants.Heavy lineHeavy = Constants.Heavy.h; Constants.Heavy rodHeavy = Constants.Heavy.h; //Heavy{ul,l,ml,m,mh,h,xh} rodHeavy = Constants.RodsDatas.heavyCategory[rod]; lineHeavy = Constants.LineDatas.heavyCategory[line]; //飛距離;感度;適合サイズ;フッキング;強度 int aishouTemp = GetHeavyAishou(rodHeavy, lineHeavy); Debug.Log("ロッドの重さ= " + rodHeavy.ToString() + "ラインの重さ= " + lineHeavy.ToString()); Debug.Log("相性 " + aishouTemp); switch (Mathf.Abs(aishouTemp)) { case 0: vals = -0.0f; break; case 1: vals = -0.25f; break; case 2: vals = -0.1f; break; case 3: vals = -0.15f; break; case 4: vals = -0.25f; break; case 5: vals = -0.3f; break; case 6: vals = -0.4f; break; } Debug.Log("= " + vals); return(vals); }
public void OnchnagedPU() { Debug.Log("" + popup.value); int i = Array.IndexOf(HeavySt, popup.value); if (i >= 0) { currentHeavy = (Constants.Heavy)i; } else { Debug.LogError("Heavy not setted"); currentHeavy = Constants.Heavy.m; } }
int GetHeavyAishou(Constants.Heavy rod, Constants.Heavy two) { return(rod - two); }