/// <summary> /// Возвращает значение, показывающее были ли изменения в данном элементе управления /// </summary> public bool GetChangeStatus(Component component) { try { if (!GlobalObjects.CasEnvironment.Calculator.IsEqual(Cost, component.Cost) || !GlobalObjects.CasEnvironment.Calculator.IsEqual(CostOverhaul, component.CostOverhaul) || !GlobalObjects.CasEnvironment.Calculator.IsEqual(CostServiceable, component.CostServiceable) || !GlobalObjects.CasEnvironment.Calculator.IsEqual(ManHours, component.ManHours) || KitRequered != component.KitRequired || Remarks != component.Remarks || HiddenRemarks != component.HiddenRemarks || !LifeLimit.IsEqual(component.LifeLimit) || !LifeLimitNotify.IsEqual(component.LifeLimitNotify) || !lifelengthViewerWarranty.Lifelength.IsEqual(component.Warranty) || !lifelengthViewerWarrantyNotify.Lifelength.IsEqual(component.WarrantyNotify) || (component is BaseComponent ? component.LLPMark && ((BaseComponent)component).LLPCategories && CurrentLLPLifeLimit.ToString() != component.LLPData.ToString() : component.LLPMark && component.LLPCategories && CurrentLLPLifeLimit.ToString() != component.LLPData.ToString()) || fileControl.GetChangeStatus()) { return(true); } } catch (Exception ex) { Program.Provider.Logger.Log("Error while saving data", ex); return(true); } return(false); }
void OnCreatRobot(ItemObject obj, GameObject gameobj) { if (obj == null) { return; } mLifeCmpt = obj.GetCmpt <LifeLimit>(); mEnergyCmpt = obj.GetCmpt <Energy>(); mShowLifeTip = true; mShowEnergyTip = true; mRobot.mItemObj = obj; mRobot.mGameobj = gameobj; mRobot.Show(); mNeedReposition = true; ResetPostion(); }
public bool Equals(BaseComponent y) { if (y == null || ItemId != y.ItemId || ATAChapter != y.ATAChapter || PartNumber != y.PartNumber || Description != y.Description || SerialNumber != y.SerialNumber || MaintenanceControlProcess != y.MaintenanceControlProcess || Remarks != y.Remarks || Model != y.Model || Manufacturer != y.Manufacturer || LLPMark != y.LLPMark || LLPCategories != y.LLPCategories || LandingGear != y.LandingGear || AvionicsInventory != y.AvionicsInventory || ALTPartNumber != y.ALTPartNumber || MTOGW != y.MTOGW || HushKit != y.HushKit || Cost != y.Cost || CostOverhaul != y.CostOverhaul || CostServiceable != y.CostServiceable || Quantity != y.Quantity || ManHours != y.ManHours || !Warranty.IsEqual(y.Warranty) || !WarrantyNotify.IsEqual(y.WarrantyNotify) || Serviceable != y.Serviceable || GoodsClass != y.GoodsClass || ShelfLife != y.ShelfLife || MPDItem != y.MPDItem || //Suppliers != y.Suppliers || !LifeLimit.IsEqual(y.LifeLimit) || !LifeLimitNotify.IsEqual(y.LifeLimitNotify) || BaseComponentType != y.BaseComponentType) { return(false); } return(true); }
void RefreshInfo() { if (mItemObj == null) { return; } mHeadTex.mainTexture = mItemObj.iconTex; mLifeCmpt = mItemObj.GetCmpt <LifeLimit>(); mEnergyCmpt = mItemObj.GetCmpt <Energy>(); mHealth.sliderValue = mLifeCmpt.floatValue.percent; mEnergy.sliderValue = mEnergyCmpt.floatValue.percent; if (mEnergyCmpt.floatValue.percent < 0.30f) { mAnimation.enabled = true; } else { mAnimation.enabled = false; mForeground.alpha = 1f; } }
// Use this for initialization public virtual bool CostSkill(ISkillTarget target = null, int sex = 2, bool buttonDown = false, bool buttonPressed = false) { LifeLimit si = mItemObj.GetCmpt <LifeLimit>(); if (null == si) { return(false); } if (si.lifePoint.current < PETools.PEMath.Epsilon) { return(false); } if (mSkillMaleId.Count == 0 || mSkillFemaleId.Count == 0) { return(false); } //if(mItemObj.GetProperty(ItemProperty.Durability) < PETools.PEMath.Epsilon) // return false; mCastSkillId = 0; switch (sex) { case 1: mCastSkillId = mSkillFemaleId[0]; mSkillIndex = 0; for (int i = 0; i < mSkillFemaleId.Count - 1; i++) { if (mSkillRunner.IsEffRunning(mSkillFemaleId[i])) { mCastSkillId = mSkillFemaleId[i + 1]; mSkillIndex = i + 1; } } break; case 2: mCastSkillId = mSkillMaleId[0]; mSkillIndex = 0; for (int i = 0; i < mSkillMaleId.Count - 1; i++) { if (mSkillRunner.IsEffRunning(mSkillMaleId[i])) { mCastSkillId = mSkillMaleId[i + 1]; mSkillIndex = i + 1; } } break; } EffSkillInstance skillInstance = CostSkill(mSkillRunner, mCastSkillId, target); if (null != mSkillRunner && null != target && null != skillInstance && mSkillRunner != target) { Vector3 dir = target.GetPosition() - mSkillRunner.transform.position; mSkillRunner.transform.LookAt(mSkillRunner.transform.position + dir, Vector3.up); } return(null != skillInstance); }