Example #1
0
    private void LateUpdate()
    {
        if (initialized)
        {
            if (eventSystem && !eventSystem.IsPointerOverGameObject())
            {
                if (Input.GetAxis("Mouse ScrollWheel") < 0f)
                {
                    zLevel = Mathf.Min(10 + 2.5F * (1 +
                                                    CoreUpgraderScript.GetCoreTier(PlayerCore.Instance.blueprint.coreShellSpriteID)), zLevel + 0.5F);
                    Focus(transform.position);
                }
                else if (Input.GetAxis("Mouse ScrollWheel") > 0f)
                {
                    zLevel = Mathf.Max(5, zLevel - 0.5F);
                    Focus(transform.position);
                }
            }

            if (panning)
            {
                Pan();
            }
            else if (core.IsMoving()) // lock camera
            {
                Focus(core.transform.position);
            }
            ProximityInteractScript.Focus();
        }
    }
Example #2
0
    private void LateUpdate()
    {
        if (initialized)
        {
            if (eventSystem && !eventSystem.IsPointerOverGameObject())
            {
                if (Input.GetAxis("Mouse ScrollWheel") < 0f)
                {
                    zLevel = Mathf.Min(GetMaxZoomLevel(), zLevel + 0.5F);
                    Focus(transform.position);
                }
                else if (Input.GetAxis("Mouse ScrollWheel") > 0f)
                {
                    zLevel = Mathf.Max(5, zLevel - 0.5F);
                    Focus(transform.position);
                }
            }

            if (panning)
            {
                Pan();
            }
            else if (core.IsMoving()) // lock camera
            {
                Focus(core.transform.position);
            }
            ProximityInteractScript.Focus();
            MouseMovementVisualScript.Focus();
            ReticleScript.instance.Focus();
        }
    }