/// <summary> /// loading all effects from excel map /// </summary> /// <param name="filename"> file name with full path </param> public static void Load(string filename) { _sEffects = new Dictionary <string, EffectTypes>(); var itms = AbstractObject.Load <ExcelLoading.effect>(filename); foreach (var rep in itms.repetative) { EffectTypes type; switch (rep.type) { case "speed": type = EffectTypes.speed; break; case "result": type = EffectTypes.result; break; case "storage": type = EffectTypes.storage; break; default: type = EffectTypes.none; break; } _sEffects.Add(rep.name, type); } }
/// <summary> /// Loading all tooltips from xml file /// </summary> public static void Load(string filename) { _sAllTips = new Dictionary <string, LearningTipData>(); var uparsedTips = AbstractObject.Load <ExcelLoading.AllTips>(filename); foreach (var source in uparsedTips.repetative) { var tipData = new LearningTipData(); tipData.m_dependency = source.targetIcon; tipData.m_targetObject = source.targetObject; tipData.m_position = new Vector2(source.defaultX, source.defaultY); tipData.m_name = source.name; tipData.m_text = source.description; tipData.m_next = source.nextTip; tipData.m_isItUI = source.isItUI; string[] positionVecor = source.yellowPositionVector == null ? new string[] { "" } : source.yellowPositionVector.Split(';'); string[] sizeVector = source.yellowSizeVector == null ? new string[] { "" } : source.yellowSizeVector.Split(';'); if (positionVecor.Length > 1 && sizeVector.Length > 1) { tipData.m_yellowBox = new Rect( AbstractObject.FloatParse(positionVecor[0]), AbstractObject.FloatParse(positionVecor[1]), AbstractObject.FloatParse(sizeVector[0]), AbstractObject.FloatParse(sizeVector[1]) ); } _sAllTips.Add(tipData.m_name, tipData); } //making previous link foreach (var tipPair in _sAllTips) { var tip = tipPair.Value; if (tip.m_next != null && tip.m_next.Length > 0) { var nextTip = _sAllTips[tip.m_next]; if (nextTip.m_previous == null || nextTip.m_previous.Length == 0) { _sAllTips[tip.m_next].m_previous = tip.m_name; } else { throw new Exception("tip '" + nextTip + "' has previous tip:" + nextTip.m_previous); } } } }