Exemplo n.º 1
0
    void Update()
    {
        if (lives <= 0)
        {
            buttonManager.ChangeToLost();
        }
        Ray ray = mainCamera.ScreenPointToRay(mousePosition);
        //if(Physics.Raycast(ray, out hit, maxDistance, mask, QueryTriggerInteraction.UseGlobal))
        //{
        //    if(hit.transform.CompareTag("BuildableSurface"))
        //    {
        //        colorizedSurface = hit.transform.GetComponent<BuildableSurface>();
        //        if(!colorizedSurface.isSelected)
        //        {
        //            colorizedSurface.ChangeColor(hoverColor);
        //        }
        //    }

        //    else
        //    {
        //        if(colorizedSurface != null && !colorizedSurface.isSelected)
        //        {
        //            colorizedSurface.ChangeColor(startColor);
        //            colorizedSurface = null;
        //        }
        //    }
        //}
    }
Exemplo n.º 2
0
    void Update()
    {
        if (isDragging) //Si estamos pulsando y arrastrando el ratón.
        {
            DragUpdate();
        }

        if (selectedUnit != null)
        {
            selectedUnit.isSelected = true;
        }
        if (selectedUnits.Count > 0)
        {
            for (int i = 0; i < selectedUnits.Count; i++)
            {
                selectedUnits[i].isSelected = true;
            }
        }

        if (selectableUnits.Count == 0)
        {
            buttonManager.ChangeToLost();
        }
    }