void Start() { _villagerStateRef = GetComponent<VillagerState>(); _villagerInventoryRef = GetComponent<VillagerInventory>(); _brainRef = GetComponent<VillagerBrain>(); _storeRef = transform.parent.gameObject.transform.parent.gameObject.GetComponent<VillageGenerator>().StoreHouse; _waterSourceRef = transform.parent.gameObject.transform.parent.gameObject.GetComponent<VillageGenerator>().Well; _navMeshComp = GetComponent<NavMeshAgent>(); _maxHunger = _villagerStateRef.getMaxHungerTime(); _maxThirst = _villagerStateRef.getMaxThirstTime(); _maxSickness = _villagerStateRef.getMaxSicknessTime(); _maxFear = _villagerStateRef.getMaxFearTime(); }
void Start() { renderer = GetComponent<SpriteRenderer>(); _state = GetComponent<VillagerState>(); _actions = GetComponent<VillagerActions>(); _inventory = GetComponent<VillagerInventory>(); _storeRef = transform.parent.gameObject.transform.parent.gameObject.GetComponent<VillageGenerator>().StoreHouse.GetComponent<storeManagement>(); currentState = executionState.Free; if (_state.workplace == null) _state.workplace = transform.parent.gameObject.transform.parent.gameObject.GetComponent<VillageGenerator>().Crop; _workplace = _state.workplace.transform.position; if (_state.wareHouse == null) _state.wareHouse = transform.parent.gameObject.transform.parent.gameObject.GetComponent<VillageGenerator>().Warehouse; _warehouse = _state.wareHouse.transform.position; currentWorkingState = workingState.standby; _dangerTimer = 0; }
/// ///////// public void Start() { inv = new VillagerInventory(); jobs = new PriorityQueue <float, Job> (); AbleToWork = true; }