private Vector3 GetScreenCenterPoint() { Vector3 distanceToGround = FarmUtility.GetDistanceToGround(); FarmRoot instance = FarmRoot.Instance; Camera camera = instance.Camera; return(camera.transform.localPosition + distanceToGround); }
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)); }
private Vector3 MovingLocalPosition() { Vector3 vector = base.transform.localPosition; if (this.enabledDisplayedInFront) { vector += FarmUtility.GetDistanceToGround() * 0.5f; } return(vector); }
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; }