public bool checkConditional(SkillItem item, GlobalDef.SkillActionType type) { if(item == null) return true; if(item.actiontype != (int)type) return true; float curMp = m_unit.getCurProperty((int)GlobalDef.NewHeroProperty.PRO_MANAPOINT); if(curMp < item.consume) return true; float range = item.range_R / 100f; float dis = getDistance (); if(dis > range) { return true; } return false; }
/// <summary> /// 收入 /// </summary> static public void AddMoney(GlobalDef.MoneyType tp, int value) { MonoInstancePool.getInstance<UserData>().addMoney((int)tp, value); }
/// <summary> /// 判断货币是否够用 /// </summary> static public bool HasMoney(GlobalDef.MoneyType tp, int value) { bool has = false; has = value <= MonoInstancePool.getInstance<UserData>().getMoney((int)tp); return has; }
void NotMoney(GlobalDef.MoneyType tp) { Debug.Log("not money type is : " + tp.ToString()); }
// not public ... public void NavigationTo(GlobalDef.UIState uiState){ NavigationTo((int)uiState); }
//< 监测是否是敌方 public bool CheckIsEnemy(GlobalDef.UnitType atker, GlobalDef.UnitType target) { if (atker == GlobalDef.UnitType.UNIT_TYPE_PLAYER) { if (atker == target) return false; return true; } else { if (target > GlobalDef.UnitType.UNIT_TYPE_PLAYER) return false; return true; } }