float crewMemberHealthPercent = 100.0f; //% means never having to update the max health on the bar #endregion Fields #region Methods public void AssignCrewMember(CrewMemberDataObject newCrewMember) { cmdo = newCrewMember; //Assign the portrait Sprite portraitSprite = Resources.Load<Sprite>("CrewPortraits64x64/" + cmdo.Portrait); AssignPortrait(portraitSprite); //Set the health bar to start crewMemberHealthPercent = ((cmdo.HealthCurrent*1.0f) / (cmdo.HealthTotal*1.0f)) * 100.0f; AssignCurrentHealthPercent(crewMemberHealthPercent); //Clean up Resources.UnloadAsset(portraitSprite); }
public void AssignCrewMember(CrewMemberDataObject newCrewMember) { cmdo = newCrewMember; //Assign the portrait Sprite portraitSprite = Resources.Load <Sprite>("CrewPortraits64x64/" + cmdo.Portrait); AssignPortrait(portraitSprite); //Set the health bar to start crewMemberHealthPercent = ((cmdo.HealthCurrent * 1.0f) / (cmdo.HealthTotal * 1.0f)) * 100.0f; AssignCurrentHealthPercent(crewMemberHealthPercent); //Clean up Resources.UnloadAsset(portraitSprite); }
public CrewMemberDataObject GetCrewInSlot(int SlotID) { CrewMemberDataObject cmdo = new CrewMemberDataObject(); switch (SlotID) { case 0: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(pilotCrewID)).First(); break; case 1: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(tacticalCrewID)).First(); break; case 2: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(engineeringCrewID)).First(); break; case 3: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(securityCrewID)).First(); break; case 4: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(medicalCrewID)).First(); break; case 5: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(liasonCrewID)).First(); break; default: break; } return(cmdo); }
float crewMemberHealthPercent = 100.0f; //% means never having to update the max health on the bar #endregion #region Unity Methods // Use this for initialization void Start() { CrewMemberDataObject cm = PlayerController.playerController.GetCrewInSlot(slotID); AssignCrewMember(cm); }
public CrewMemberDataObject GetCrewInSlot(int SlotID) { CrewMemberDataObject cmdo = new CrewMemberDataObject(); switch (SlotID) { case 0: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(pilotCrewID)).First(); break; case 1: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(tacticalCrewID)).First(); break; case 2: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(engineeringCrewID)).First(); break; case 3: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(securityCrewID)).First(); break; case 4: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(medicalCrewID)).First(); break; case 5: cmdo = DataController.DataAccess.crewMasterList.Where(c => c.ID.Equals(liasonCrewID)).First(); break; default: break; } return cmdo; }
public void Remove(CrewMemberDataObject dataObject) { database.Remove(dataObject); }
public void Add(CrewMemberDataObject dataObject) { database.Add(dataObject); }
public void Remove(CrewMemberDataObject dataObject) { database.Remove(dataObject); }
public void Add(CrewMemberDataObject dataObject) { database.Add(dataObject); }