Beispiel #1
0
    /// <summary>
    /// Will return the build or way hitt by mouse position
    /// </summary>
    /// <returns></returns>
    private Transform ReturnBuildinHit()
    {
        //used to be UPoly.RayCastAll()
        Transform clicked = UPoly.RayCastLayer(Input.mousePosition, 10).transform;//10: personBlock

        //Removed bz was pulling the Previews of the Buildiggs and in that way will select that building
        ////try ways then
        //if (clicked == null)
        //{
        //    clicked = UPoly.RayCastLayer(Input.mousePosition, 12).transform;//12: way
        //}

        return(clicked);
    }
Beispiel #2
0
    private bool SelectSellRegion()
    {
        if (!Input.GetMouseButtonUp(0))
        {
            return(false);
        }

        List <string> names   = new List <string>();
        var           clicked = UPoly.RayCastLayer(Input.mousePosition, 10).transform;

        if (clicked != null && clicked.name.Contains("ForSaleRegion"))
        {
            var sell = clicked.GetComponent <ForSaleRegionGO>();
            sell.ClickOnMe();
            return(true);
        }
        return(false);
    }
Beispiel #3
0
    /// <summary>
    /// Will try to select a person. Person selection has more importantce than
    /// building selection and priority
    /// </summary>
    /// <returns>Will retrun true if a person was selected</returns>
    private bool SelectPerson()
    {
        Transform clicked = UPoly.RayCastLayer(Input.mousePosition, 11).transform;

        if (clicked != null)
        {
            ManagerReport.AddInput("Selected person: " + clicked.name);

            PersonSelect = clicked.GetComponent <Person>();
            _personWindow.Show(PersonSelect);

            UnselectingBuild();

            _buildingWindow.Hide();
            return(true);
        }
        _personWindow.Hide();
        return(false);
    }