Exemplo n.º 1
0
    private void ChangeCompassBGWithIFFStatusOfNearestCity()
    {
        int nearestIFF = cm.FindCityIFF(nearestCS);

        if (nearestCS.GetTimeSpentCapturing() > 0.1f)
        {
            compassBG.color = iffCapturing;
            return;
        }
        if (nearestIFF == IFF.feralIFF)
        {
            compassBG.color = iffFeral;
            return;
        }
        if (nearestIFF == myIFFAllegiance)
        {
            compassBG.color = iffAllied;
            return;
        }
        if (nearestIFF != myIFFAllegiance)
        {
            compassBG.color = iffEnemy;
            return;
        }
    }
Exemplo n.º 2
0
    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);
            }
        }
    }