// Use this for initialization public static PersonColors Instance() { if (!personColors) { personColors = FindObjectOfType(typeof(PersonColors)) as PersonColors; } return(personColors); }
// Use this for initialization void Awake() { hasAbandoned = false; bucket = PersonManager.Instance().getNewBucket(); bucketItemCount = bucket.items.Count; agent = GetComponent <NavMeshAgent> (); thisTransform = GetComponent <Transform> (); thisTransform.SetParent(GameObject.Find("People").transform); shoulders = GetComponentsInChildren <Renderer> (); shoulderColor = PersonColors.Instance().getNewColor(); buyState = BuyState.Start; for (int i = 1; i < 3; i++) { shoulders[i].material.color = shoulderColor; } }