public void Assign(Rodent r) { // Debug.Log("ASsign in Employee" + r.name + test); if (!_Locked && !_Occupied) { //Debug.Log("Pass"); // Debug.Log("Assign in Employee" +r.getName()); //This script is on the portrait outline because its the visible clickable thing _PortraitOutline.GetComponent <bWorkerScript>().setWorker(r); _WorkerObj.GetComponent <SpriteRenderer>().sprite = r.GetPortrait(); //Stupid Bugg... makes no sense , something seems to break if u assign and the gameobject is turned off // Debug.Log("Portraitnameis " + r.GetPortrait()); //print(_WorkerObj.GetComponent<SpriteRenderer>()); // print(_WorkerObj.GetComponent<SpriteRenderer>().sprite); // sp = _WorkerObj.GetComponent<SpriteRenderer>(); _Occupied = true; _currentRodent = r; r.SetJob(this); ShowWeaponClass(true); SetWeaponClassImg(r.isRanged()); //subscribe to the event system - unused now //EventSystem.Instance.rodentDead += Dismiss; SoundManager.Instance.PlayAssign(); } }