//Sets up a default human void Awake() { Debug.Log("Fully Awake"); entityType = new HumanType(); entityNeeds = new HumanNeeds(); psyche = new HumanPsyche(); currentlyBusy = false; avatar = GetComponent <DynamicCharacterAvatar>(); dnaHolder = new Dictionary <string, DnaSetter>(); HUMANROOT = null; nextUpdate = 0.0f; WORLDTIME = GameObject.Find("WorldTime").GetComponent <WorldTime>(); lastUpdate = WORLDTIME.WORLDTIME; updateRequired = true; HUMANROOT = gameObject; navAgent = gameObject.AddComponent <NavMeshAgent>(); }
//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); }