コード例 #1
0
ファイル: Employee.cs プロジェクト: Havie/RoyalRodentsNew
 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);
         }
     }
 }
コード例 #2
0
    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);
    }
コード例 #3
0
    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);
    }