| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using cfg;
- public class GuaProbablityPool : MonoBehaviour
- {
- [System.Serializable]
- //记录每个士兵每个种类当前所剩的卦象池
- public struct SoldierGuaPool
- {
- public SoldierType soldier;
- public int icon;
- public List<int> pool;
- }
-
- //public List<SingleGuaProbability> guaProbabilities;
- private SoldierType[] curSoldiers;
- [Header("卦象概率池")]
- [DisplayOnly]
- public List<SoldierGuaPool> guaPool;
- private List<SoldierGuaPool> origPool;
- private void Start()
- {
- //guaProbabilities = GameManager.instance.allCfgData.CfgGuaProbability.DataList;
- curSoldiers = GameManager.curSoldiers;
- //SetGuaPoolList();
- origPool = new List<SoldierGuaPool>(guaPool);
- }
- /*
- public void SetGuaPoolList()
- {
- int i = 0;
- foreach (SingleGuaProbability sgpro in guaProbabilities)
- {
- SoldierGuaPool sgp = new SoldierGuaPool();
- if (sgpro.SoldierType.Contains("Soul"))
- {
- sgp.icon = 1;
- }
- else
- {
- sgp.icon = 0;
- }
- foreach(SoldierType st in curSoldiers)
- {
- if (sgpro.SoldierType.Contains(st.ToString()))
- {
- sgp.soldier = st;
- break;
- }
- }
- List<int> tempPool = new List<int>();
- for (int j = 0; j < sgpro.Gua1; j++)
- {
- tempPool.Add(0);
- }
- for (int j = 0; j < sgpro.Gua2; j++)
- {
- tempPool.Add(1);
- }
- for (int j = 0; j < sgpro.Gua3; j++)
- {
- tempPool.Add(2);
- }
- for (int j = 0; j < sgpro.Gua4; j++)
- {
- tempPool.Add(3);
- }
- for (int j = 0; j < sgpro.Gua5; j++)
- {
- tempPool.Add(4);
- }
- for (int j = 0; j < sgpro.Gua6; j++)
- {
- tempPool.Add(5);
- }
- for (int j = 0; j < sgpro.Gua7; j++)
- {
- tempPool.Add(6);
- }
- for (int j = 0; j < sgpro.Gua8; j++)
- {
- tempPool.Add(7);
- }
- sgp.pool = new List<int>(tempPool);
- guaPool[i] = sgp;
- i += 1;
- }
- }
- */
- public void ResetGuaPool(int id)
- {
- guaPool[id] = origPool[id];
- }
- }
|