private void OnTriggerStay2D(Collider2D collision) { if (cs.IsRunningOnServer) { if (!cityToCapture) { return; } cityToCapture.BuildCaptureTime(Time.deltaTime); PushUpdateToUIDriver(cityToCapture); if (cityToCapture.GetTimeSpentCapturing() >= cityToCapture.GetTimeRequiredToCapture()) { int newAllegiance = iff.GetIFFAllegiance(); cityToCapture.GetComponent <IFF>().SetIFFAllegiance(newAllegiance); // change allegiance of square itself cityToCapture.SetAllegianceForBuildingsInCity(newAllegiance); // change allegiance for all city objects cityToCapture.ResetCaptureStatus(); cityToCapture = null; avcuid.UpdateTimes(0, 0); } } }
public int FindCityIFF(CitySquare cs) { int iff = cs.GetComponent <IFF>().GetIFFAllegiance(); return(iff); }