// load prop data private void loadPropJson() { if (String.IsNullOrEmpty(propJsonPath)) { Debug.LogWarning("propJsonPaths is empty"); return; } // have four prop data try { _loader.setPath(propJsonPath); string name = _loader.getJsonName(); string content = _loader.getJsonData(); PropObj[] props = _loader.parsePropJsonData(content); List <PropObj> healthy = new List <PropObj>(); List <PropObj> harmony = new List <PropObj>(); List <PropObj> pressure = new List <PropObj>(); List <PropObj> riches = new List <PropObj>(); foreach (PropObj p in props) { KindOfState state; switch ((KindOfState)p.Type) { case KindOfState.Healthy: healthy.Add(p); break; case KindOfState.Harmony: harmony.Add(p); break; case KindOfState.Pressure: pressure.Add(p); break; case KindOfState.Riches: riches.Add(p); break; } } propDic.Add(KindOfState.Healthy, healthy); propDic.Add(KindOfState.Pressure, pressure); propDic.Add(KindOfState.Riches, riches); propDic.Add(KindOfState.Harmony, harmony); } catch (Exception e) { Debug.LogException(e); } }