public void Dismiss(Rodent r) { if (r == null) { return; } // Debug.Log("heard Dismiss Employee :" + r.getName()); if (_Occupied) { if (_currentRodent && _currentRodent == r) { _currentRodent.setTarget(null); _PortraitOutline.GetComponent <bWorkerScript>().setWorker(null); _WorkerObj.GetComponent <SpriteRenderer>().sprite = null; //print("dismiss"); _Occupied = false; _currentRodent = null; ShowRedX(false); UIAssignmentMenu.Instance.ResetButtons(); ShowWeaponClass(false); //unsubscribe - unused now //EventSystem.Instance.rodentDead -= Dismiss; SoundManager.Instance.PlayDismiss(); r.ShowDismissMenu(false); } } }
public void RodentDismissed(Rodent _Rodent) { Employee _Job = _Rodent.GetJob(); if (_Job) { _Job.Dismiss(_Rodent); } //remove from player rodent list (in gamemanager) GameManager.Instance.RemovePlayerRodent(_Rodent); //make rodent available again (no hat) _Rodent.setTeam(0); _Rodent.ShowDismissMenu(false); }
public void DismissRodent() { //Debug.Log("Dismiss rodent button pressed"); //Unassign from its assigned structure Employee _Job = _Rodent.GetJob(); if (_Job) { _Job.Dismiss(_Rodent); } //remove from player rodent list (in gamemanager) GameManager.Instance.RemovePlayerRodent(_Rodent); //make rodent available again (no hat) _Rodent.setTeam(0); _Rodent.ShowDismissMenu(false); showMenu(false, null); }