Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (gameManager.matchInfo.fase.Equals(GameFase.Attack))
     {
         foreach (Touch touch in Input.touches)
         {
             if (touch.phase == TouchPhase.Began)
             {
                 RaycastHit hitInfo;
                 // Construct a ray from the current touch coordinates
                 Ray ray = Camera.main.ScreenPointToRay(touch.position);
                 if (Physics.Raycast(ray, out hitInfo, 100, countryLayerMask))
                 {
                     Debug.Log(hitInfo);
                     if (selectedCountry == null)
                     {
                         selectedCountry = hitInfo.collider.gameObject.GetComponent <CountryBehaviour>();
                     }
                     else
                     {
                         focusCountry = hitInfo.collider.gameObject.GetComponent <CountryBehaviour>();
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public void LoseCountry(CountryBehaviour country)
 {
     countries.Remove(country);
 }
Exemplo n.º 3
0
 public void AddCountry(CountryBehaviour country)
 {
     countries.Add(country);
 }