Exemplo n.º 1
0
    void OnMouseDown()
    {
        if (!hasAuthority)
        {
            return;
        }

        if (!WorldHandler.isShiftDown())
        {
            WorldHandler.deselectAntHill();
            WorldHandler.deselectUnits();
        }

        GameObject indicator = gameObject.transform.FindChild("Indicator").gameObject;

        indicator.SetActive(!indicator.activeSelf);
        isUnitSelected = indicator.activeSelf;

        if (isUnitSelected)
        {
            WorldHandler.PlayUnitBattleSound();
            WorldHandler.unitsSelected.Add(gameObject);
        }
        else
        {
            WorldHandler.unitsSelected.Remove(gameObject);
        }
    }
Exemplo n.º 2
0
    void OnMouseDown()
    {
        if (EventSystem.current.IsPointerOverGameObject())
        {
            return;
        }

        if (!GetComponent <NetworkIdentity>().hasAuthority)
        {
            return;
        }

        if (!WorldHandler.isShiftDown())
        {
            WorldHandler.deselectUnits();
        }


        GameObject indicator = gameObject.transform.FindChild("Indicator").gameObject;

        indicator.SetActive(!indicator.activeSelf);
        isAntHillSelected = indicator.activeSelf;
    }