private void Start() { // get the components on the object we need ( should not be null due to require component so no need to check ) agent = GetComponentInChildren <NavMeshAgent>(); character = GetComponent <ThirdPersonCharacter>(); residentController = gameObject.GetComponent <Resident> (); monthManager = GameObject.Find("Clock").GetComponent <MonthManager> (); criminalController = gameObject.GetComponent <Criminal> (); rm = GameObject.Find("ResidentManager").GetComponent <ResidentManager> (); //Randomizes the walk speed for residents! if (isServer) { if (criminalController == null) { GetResidentPoints(monthManager.isDay); //Sets resident movement locations agent.speed = 0.5f; //Sets resident speed } else { GoCommitCrime(); //Get Crime Waypoints agent.speed = 0.8f; //Make criminal walk faster } agent.updateRotation = false; agent.updatePosition = true; } }
// Use this for initialization void Start() { MonthManager mm = GameObject.FindObjectOfType <MonthManager> (); int weather = mm.weatherType; TurnOn(weather); }
// Use this for initialization void Start() { building = GetComponent <Building> (); mod = GetComponent <BuildingModifier> (); if (isServer) { monthManager = GameObject.Find("Clock").GetComponent <MonthManager> (); } }
// Use this for initialization void Start() { cityHall = GetComponent <CityHall> (); if (string.IsNullOrEmpty(regionName)) { regionName = NameGen(); } if (mm == null) { mm = FindObjectOfType <MonthManager> (); } }
public void OnRoleResetOtherInfo()//在玩家进行刷新 或者是 断线重新连接后 进行的处理 { //客户端重新设置下全部的外围数据 AchievementManager.ResetInfo(); ActionManager.ResetInfo(); //CheckManager.ResetInfo(); EntityManager.ResetInfo(); RoleGameData.ResetInfo(); ItemManager.ResetInfo(); MailManager.ResetInfo(); RankManager.ResetInfo(); RelationManager.ResetInfo(); TaskManager.ResetInfo(); RoleAnnouncement.ResetInfo(); MonthManager.ResetInfo(); RoleChar.ResetInfo(); }
// Use this for initialization void Start() { p = FindObjectOfType <Player> ().localPlayer; p.controlsAllowed(false); mm = FindObjectOfType <MonthManager> (); offered = 0; content = transform.Find("Viewport/Content"); confirm = gameObject.transform.Find("Button").GetComponent <Button> (); confirm.onClick.AddListener(delegate { submit(); }); message = gameObject.transform.Find("Panel/Text").GetComponent <Text> (); toSell = new List <Building> (); if (p.budget + offered < 0) { message.text = "Select properties to pay off your debts.\nAmount needed: $" + p.budget + "\nAmount offered: $" + offered + "\n"; } else { message.text = "Price met."; } second = mm.getSecond(); timer = 0; transform.SetParent(GameObject.Find("Canvas").transform, false); prefab = (GameObject)Resources.Load("BankruptcyToggle"); List <Building> tmp = p.getBuildings(); hoods = tmp.Where(b => (b is Neighborhood)).ToList(); lots = tmp.Where(b => ((b is Lot) && !b.inNeighborhood())).ToList(); ypos = 0; foreach (Building b in hoods) { spawnToggle(b); } foreach (Building b in lots) { spawnToggle(b); } if ((p.propertyValue() + p.budget) < 0) { seizeAll(); } }
// Use this for initialization void Start() { if (managerTraits.Count == 0) { initializeManagerTraits(); } if (residentTraits.Count == 0) { initializeTraits(); } if (factoryTraits.Count == 0) { initializeFactoryTraits(); } if (politicalTraits.Count == 0) { InitializePoliticalTraits(); } if (rm == null) { rm = FindObjectOfType <ResidentManager> (); } if (mm == null) { mm = FindObjectOfType <MonthManager> (); } jobBuilding = getBuilding(job); residenceBuilding = getBuilding(residence); monthsHomeless = 0; monthsJobless = 0; skill = -1; if (isServer) { generatePolitician(); spendingMoney = SPENDING_MONEY; runningFor.candidates.addId(this.netId); advanceMonth(); } }
// Use this for initialization void Start() { p = GetComponent <Player> (); mm = FindObjectOfType <MonthManager> (); }
void Start() { c = GetComponent <Collider> (); modManager = GetComponent <BuildingModifier> (); tenant = GetComponent <Tenant> (); color = c.gameObject.GetComponent <MeshRenderer> ().materials.ElementAt(0).color; type = TYPENUM; m = null; governedRegion = GetComponent <Region> (); if (mm == null) { mm = FindObjectOfType <MonthManager> (); } if (isServer) { budget = 0; skillLevel = 0; baseRent = 0; baseCondition = 100; baseSafety = 100; rent = 0; condition = baseCondition; safety = baseSafety; cost = 100000; baseCost = cost; upkeep = rent / UPKEEP_PORTION; officeName = "None"; buildingName = nameGen(); id = objectNum; fire = false; ruin = false; //Temporarily set true to test available of jobs without player ownership of building occupied = true; onAuction = false; paying = false; objectNum++; neededWorkers = 8; GameObject tmp = getLocalInstance(lot); if (tmp != null) { localLot = tmp.GetComponent <Lot> (); } else if (localLot != null) { lot = localLot.netId; // the lot was set in the inspector, assign the netid localLot.addObject(this.netId); } GameObject tmpRegion = getLocalInstance(region); if (tmpRegion != null) { localRegion = tmpRegion.GetComponent <Region> (); } else if (localRegion != null) { region = localRegion.netId; localRegion.AddItem(this.netId); } updateRent(); } typeName = buildingTypes [type]; }
public MonthInfoController(RestClient rsc, MonthManager month) { _monthManage = month; _restClient = rsc; }
void Awake() { m_instance = this; }