Пример #1
0
    public void Diselect()
    {
        //Previous Tile
        if (currentController != null)
        {
            Material oldmat = currentController.GetComponent <Renderer>().material;
            oldmat.color = Color.white;
        }

        if (isUnitSelected)
        {
            isUnitSelected = false;


            currentSelectedUnit.OnDiselected();
            isFocused = false;
            return;
        }
        if (isBuildingSelected)
        {
            isBuildingSelected = false;
            currentSelectedBuilding.DisFocus();
        }
        if (currentSelectedResource != null)
        {
            currentSelectedResource.OnDisFocus();
            currentSelectedResource = null;
        }
    }