private void Update() { Update_CurrentFunc(); Update_PlayerControlActivation(); Update_CameraZoomScrolling(); if (movementActivated && selfHexSelectionInitiated && firstTimeSettingHexPath) { foreach (var item in selfSelectedHexes) { hexPath.Add(item.GetComponent <HexComponentScript>().hex); } selectedUnit.SetSelfSelectedHexPath(hexPath.ToArray()); firstTimeSettingHexPath = false; } if (StateManagerScript.instance.currentTurnState == TurnsState.PlayerTurn) { if (Input.GetKeyDown(KeyCode.Escape)) { CancelUpdateFunc(); } if (!selfHexSelectionInitiated) { Update_HexSelection(); Update_UnitMovement(); Update_PlayerAttackActionTheFirst(); LastMousePosition = Input.mousePosition; if (pathBegun && selectedUnit.MovementRemaining >= 0) { movementDelay += Time.deltaTime; } if (movementDelay > 1f) { pathBegun = false; } } else { Update_SelfHexSelection(); Update_UnitMovement(); Update_PlayerAttackActionTheFirst(); LastMousePosition = Input.mousePosition; if (pathBegun) { movementDelay += Time.deltaTime; } if (movementDelay > 1f) { pathBegun = false; } } #region Main Camera Test //Get the first in the scene that has the "Tag" Main Camera //This only works in orthographic, only give us the //world position on the same plane as the camera's //near clipping play. (i.e It's not helpful for our application. //Vector3 worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); //Debug.Log("World Point: "+ worldPoint); #endregion } else { } }