Beispiel #1
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (FocusManager.GetCurrentFocusedPlayer() != null)
     {
         Quaternion rot = Quaternion.AngleAxis(90, Vector3.right);
         attackUI = (GameObject)Instantiate(UIAttack, uiPos, rot);
         GameObject.Find("Attack").GetComponent <Button>().onClick.AddListener(() => FocusManager.GetCurrentFocusedPlayer().GetComponent <PlayerController>().OnAttackClicked());
         GameObject.Find("Settle").GetComponent <Button>().onClick.AddListener(() => FocusManager.GetCurrentFocusedPlayer().GetComponent <PlayerController>().OnSettleClicked());
         FocusManager.SetFocusedBuilding(gameObject);
     }
 }
    public void OnSettleClicked()
    {
        Shop shop = FocusManager.GetCurrentFocusedBuilding().GetComponent <Shop>();

        if (shop.settledPlayer == null)
        {
            CmdOnSettleClicked(FocusManager.GetCurrentFocusedBuilding().GetComponent <NetworkIdentity>().netId,
                               FocusManager.GetCurrentFocusedPlayer().GetComponent <NetworkIdentity>().netId);
        }
        FocusManager.SetFocusedPlayer(null);
        FocusManager.SetFocusedBuilding(null);
        shop.HideUI();
    }