/// <summary> /// Initilaise the aiming of the given item. /// </summary> /// <param name="itemBeingAimed"></param> public void AimItem(AimableItem itemBeingAimed, Inventory itemBeingAimedInventory) { this.itemBeingAimed = itemBeingAimed; this.itemBeingAimedInventory = itemBeingAimedInventory; if (mouseRotatedFocusingCamera != null) { mouseRotatedFocusingCamera.lockRotation = true; } }
IEnumerator WaitThenFire(Vector3 aimPoint) { yield return(new WaitForSeconds(waitTime)); itemBeingAimed.Fire(userTransform, aimPoint); Debug.Log("fire"); itemBeingAimed = null; if (mouseRotatedFocusingCamera != null) { mouseRotatedFocusingCamera.lockRotation = false; } }