public HumanEmotions(HumanSave load) { Sadness_Joy = load.Sadness_Joy; SadnessMod = load.SadnessMod; JoyMod = load.JoyMod; SJLower = load.SJLower; SJLowerLimit = load.SJLowerLimit; SJUpper = load.SJUpper; SJUpperLimit = load.SJUpperLimit; Anticipation_Surprise = load.Anticipation_Surprise; AnticipationMod = load.AnticipationMod; SurpriseMod = load.SurpriseMod; ASLower = load.ASLower; ASLowerLimit = load.ASLowerLimit; ASUpper = load.ASUpper; ASUpperLimit = load.ASUpperLimit; Disgust_Trust = load.Disgust_Trust; DisgustMod = load.DisgustMod; TrustMod = load.TrustMod; DTLower = load.DTLower; DTLowerLimit = load.DTLowerLimit; DTUpper = load.DTUpper; DTUpperLimit = load.DTUpperLimit; Fear_Anger = load.Fear_Anger; FearMod = load.Fear_Anger; AngerMod = load.AngerMod; FALower = load.FALower; FALowerLimit = load.FALowerLimit; FAUpper = load.FAUpper; FAUpperLimit = load.FAUpperLimit; }
public void saveHumanData(ref HumanSave save) { save.survivalTasks = survivalTasks; save.hydration = hydration; save.food = food; save.sleep = sleep; }
public void saveHumanData(ref HumanSave save) { save.Sadness_Joy = Sadness_Joy; save.SadnessMod = SadnessMod; save.JoyMod = JoyMod; save.SJLower = SJLower; save.SJLowerLimit = SJLowerLimit; save.SJUpper = SJUpper; save.SJUpperLimit = SJUpperLimit; save.Anticipation_Surprise = Anticipation_Surprise; save.AnticipationMod = AnticipationMod; save.SurpriseMod = SurpriseMod; save.ASLower = ASLower; save.ASLowerLimit = ASLowerLimit; save.ASUpper = ASUpper; save.ASUpperLimit = ASUpperLimit; save.Disgust_Trust = Disgust_Trust; save.DisgustMod = DisgustMod; save.TrustMod = TrustMod; save.DTLower = DTLower; save.DTLowerLimit = DTLowerLimit; save.DTUpper = DTUpper; save.DTUpperLimit = DTUpperLimit; save.Fear_Anger = Fear_Anger; save.FearMod = FearMod; save.AngerMod = AngerMod; save.FALower = FALower; save.FALowerLimit = FALowerLimit; save.FAUpper = FAUpper; save.FAUpperLimit = FAUpperLimit; }
public HumanNeeds(HumanSave load) { survivalTasks = load.survivalTasks; hydration = load.hydration; dehydrationRate = 33.33f; food = load.food; sleep = load.sleep; }
//Saves all Human NPC's private void saveNPCData() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/npcData.dat"); //Gets all Humans with Human class component in scene npcList = FindObjectsOfType(typeof(Human)) as Human[]; //Data container for all humans npcSaveStruct toSave = new npcSaveStruct(); //Saves each human and adds to toSave container foreach (Human npc in npcList) { HumanSave save = npc.saveHumanData(); toSave.allNPCInGame.Add(save); toSave.numberOfNPCS++; } bf.Serialize(file, toSave); file.Close(); }
//Save the human into a file and return the file. //This is typically cally from a save manager script public HumanSave saveHumanData() { runUpdate(); entityType.Name = gameObject.name; HumanSave copy = new HumanSave(); copy.xloc = gameObject.transform.position.x; copy.yloc = gameObject.transform.position.y; copy.zloc = gameObject.transform.position.z; copy.xrot = gameObject.transform.localEulerAngles.x; copy.yrot = gameObject.transform.localEulerAngles.y; copy.zrot = gameObject.transform.localEulerAngles.z; //copy.locationData = gameObject.transform.position; //copy.rotationData = gameObject.transform.eulerAngles; copy.lastUpdate = lastUpdate; copy.recipe = avatar.GetCurrentRecipe(); copy = entityType.saveHumanData(copy); entityNeeds.saveHumanData(ref copy); psyche.saveHumanData(ref copy); return(copy); }
//Loads a human public void loadHuman(HumanSave load) { gameObject.name = load.Name; Debug.Log(load.Name); gameObject.layer = load.layer; gameObject.tag = load.tag; Debug.Log("Fully loaded"); //Load Human and inherited Entity class type = load.type; entityController = new EntityTaskController(load); lastUpdate = load.lastUpdate; entityType = new HumanType(load); entityNeeds = new HumanNeeds(load); psyche = new HumanPsyche(load); recipe = load.recipe; avatar.LoadFromRecipeString(recipe); //recipe = load.recipe; navAgent.Warp(new Vector3(load.xloc, load.yloc, load.zloc)); //gameObject.transform.position = new Vector3(load.xloc, load.yloc, load.zloc); gameObject.transform.localEulerAngles = new Vector3(load.xrot, load.yrot, load.zrot); }
public HumanPsyche(HumanSave load) { emotions = new HumanEmotions(load); setStage = load.setStage; }
public void saveHumanData(ref HumanSave save) { emotions.saveHumanData(ref save); save.setStage = setStage; }
//Init function for task controller using data, (loading old task controller) public EntityTaskController(HumanSave load) { taskBacklog = load.taskBacklog; reactiveContainer = load.reactiveContainer; currentTask = load.currentTask; }
public HumanType(HumanSave load) { Name = load.Name; gender = load.gender; }
public Gender gender; //Entities gender, also used in the initialisation of the UMA asset //public HumanBehaviourList mainBehaviour public HumanSave saveHumanData(HumanSave save) { save.Name = Name; save.gender = gender; return(save); }