Ejemplo n.º 1
0
    private Vector3 GetScreenCenterPoint()
    {
        Vector3  distanceToGround = FarmUtility.GetDistanceToGround();
        FarmRoot instance         = FarmRoot.Instance;
        Camera   camera           = instance.Camera;

        return(camera.transform.localPosition + distanceToGround);
    }
Ejemplo n.º 2
0
    private int GetGridIndexOfScreenCenter()
    {
        FarmRoot  instance = FarmRoot.Instance;
        FarmField field    = instance.Field;
        Vector3   position = this.farmCamera.transform.localPosition + FarmUtility.GetDistanceToGround();

        FarmGrid.GridPosition gridPosition = field.Grid.GetGridPosition(position);
        return(field.Grid.GetGridIndex(gridPosition));
    }
Ejemplo n.º 3
0
    private Vector3 MovingLocalPosition()
    {
        Vector3 vector = base.transform.localPosition;

        if (this.enabledDisplayedInFront)
        {
            vector += FarmUtility.GetDistanceToGround() * 0.5f;
        }
        return(vector);
    }
Ejemplo n.º 4
0
    public void DisplayedInFront(bool enable)
    {
        Vector3 b = FarmUtility.GetDistanceToGround() * 0.5f;

        if (enable)
        {
            base.transform.localPosition -= b;
        }
        else
        {
            base.transform.localPosition += b;
        }
        this.enabledDisplayedInFront = enable;
    }