// Use this for initialization void Start() { numberOfBots = numberOfBots + 1; botNumber = numberOfBots; agentsManager = transform.parent.gameObject; agentBehaviours = gameObject.GetComponent <AgentBehaviourLibrary>(); timeDistribution = gameObject.transform.parent.GetComponent("TimeDistribution") as TimeDistribution; dateBorn = timeDistribution.DaysPassed; nextStaminaUpdate = timeDistribution.TimeInDay; staminaUpdateTime = timeDistribution.TimeInDay / 1.75f; SetRandomAge(); defaultColor = new Color(0, 1, 1, 1); GetComponent <SpriteRenderer>().color = defaultColor; worksIndex = Random.Range(-2, 3) + 1; FindHouse(); agentBehaviours.SetBotNumber(botNumber); }