public void InitializeSettings()
    {
        camera = Camera.main.GetComponent<StandardCamera>();
        obstructionHandler = camera.target.GetComponentInChildren<ObstructionHandler>();

        xOffsetField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_X);
        yOffsetField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_Y);
        zOffsetField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_Z);
        distanceField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_DISTANCE);
        zoomSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_ZOOM_SMOOTH);
        zoomStepField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_ZOOM_STEP);
        maxZoomField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MAX_ZOOM);
        minZoomField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MIN_ZOOM);
        smoothFollowField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_FOLLOW_SMOOTH);
        int useSmooth = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_USE_SMOOTH_FOLLOW);
        if (useSmooth == 0)
            useSmoothFollowField.isOn = false;
        else
            useSmoothFollowField.isOn = true;

        maxXOrbitField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MAX_X_ORBIT);
        minXOrbitField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MIN_X_ORBIT);
        xOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_X_ORBIT_SMOOTH);
        yOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_Y_ORBIT_SMOOTH);
        int allowOrbit = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_ALLOW_ORBIT);
        if (allowOrbit == 1)
            allowOrbitField.isOn = true;
        else
            allowOrbitField.isOn = false;
        int rotateWithTarget = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_ROTATE_WITH_TARGET);
        if (rotateWithTarget == 1)
            rotateWithTargetField.isOn = true;
        else
            rotateWithTargetField.isOn = false;
        orbitInputField.text = PlayerPrefs.GetString(CameraSettings.Instance.STANDARD_ORBIT_INPUT);

        int useCollision = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_USE_COLLISION);
        if (useCollision == 1)
            useCollisionField.isOn = true;
        else
            useCollisionField.isOn = false;
        int fadeObstructions = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_FADE_OBSTRUCTIONS);
        if (fadeObstructions == 1)
            fadeObstructionsField.isOn = true;
        else
            fadeObstructionsField.isOn = false;
        int highlightTarget = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_HIGHLIGHT_TARGET);
        if (highlightTarget == 1)
            highlightTargetField.isOn = true;
        else
            highlightTargetField.isOn = false;
    }
    public void InitializeSettings()
    {
        camera = Camera.main.GetComponent<TopDownCamera>();
        obstructionHandler = camera.target.GetComponentInChildren<ObstructionHandler>();

        distanceField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_DISTANCE);
        int allowZoom = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_ALLOW_ZOOM);
        if (allowZoom == 1)
            allowZoomField.isOn = true;
        else
            allowZoomField.isOn = false;
        zoomSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_ZOOM_SMOOTH);
        zoomStepField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_ZOOM_STEP);
        maxZoomField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_MAX_ZOOM);
        minZoomField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_MIN_ZOOM);
        smoothFollowField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_FOLLOW_SMOOTH);
        int useSmooth = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_USE_SMOOTH_FOLLOW);
        if (useSmooth == 0)
            useSmoothFollowField.isOn = false;
        else
            useSmoothFollowField.isOn = true;

        xRotationField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_X_ROTATION);
        yOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_Y_ORBIT_SMOOTH);
        int allowOrbit = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_ALLOW_ORBIT);
        if (allowOrbit == 1)
            allowOrbitField.isOn = true;
        else
            allowOrbitField.isOn = false;
        orbitInputField.text = PlayerPrefs.GetString(CameraSettings.Instance.TOPDOWN_ORBIT_INPUT);

        int fadeObstructions = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_FADE_OBSTRUCTIONS);
        if (fadeObstructions == 1)
            fadeObstructionsField.isOn = true;
        else
            fadeObstructionsField.isOn = false;
        int highlightTarget = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_HIGHLIGHT_TARGET);
        if (highlightTarget == 1)
            highlightTargetField.isOn = true;
        else
            highlightTargetField.isOn = false;
    }
    public void InitializeSettings()
    {
        camera             = Camera.main.GetComponent <StandardCamera>();
        obstructionHandler = camera.target.GetComponentInChildren <ObstructionHandler>();

        xOffsetField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_X);
        yOffsetField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_Y);
        zOffsetField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_LOCAL_OFFSET_Z);
        distanceField.value     = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_DISTANCE);
        zoomSmoothField.value   = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_ZOOM_SMOOTH);
        zoomStepField.value     = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_ZOOM_STEP);
        maxZoomField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MAX_ZOOM);
        minZoomField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MIN_ZOOM);
        smoothFollowField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_FOLLOW_SMOOTH);
        int useSmooth = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_USE_SMOOTH_FOLLOW);

        if (useSmooth == 0)
        {
            useSmoothFollowField.isOn = false;
        }
        else
        {
            useSmoothFollowField.isOn = true;
        }

        maxXOrbitField.value    = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MAX_X_ORBIT);
        minXOrbitField.value    = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_MIN_X_ORBIT);
        xOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_X_ORBIT_SMOOTH);
        yOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.STANDARD_Y_ORBIT_SMOOTH);
        int allowOrbit = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_ALLOW_ORBIT);

        if (allowOrbit == 1)
        {
            allowOrbitField.isOn = true;
        }
        else
        {
            allowOrbitField.isOn = false;
        }
        int rotateWithTarget = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_ROTATE_WITH_TARGET);

        if (rotateWithTarget == 1)
        {
            rotateWithTargetField.isOn = true;
        }
        else
        {
            rotateWithTargetField.isOn = false;
        }
        orbitInputField.text = PlayerPrefs.GetString(CameraSettings.Instance.STANDARD_ORBIT_INPUT);

        int useCollision = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_USE_COLLISION);

        if (useCollision == 1)
        {
            useCollisionField.isOn = true;
        }
        else
        {
            useCollisionField.isOn = false;
        }
        int fadeObstructions = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_FADE_OBSTRUCTIONS);

        if (fadeObstructions == 1)
        {
            fadeObstructionsField.isOn = true;
        }
        else
        {
            fadeObstructionsField.isOn = false;
        }
        int highlightTarget = PlayerPrefs.GetInt(CameraSettings.Instance.STANDARD_HIGHLIGHT_TARGET);

        if (highlightTarget == 1)
        {
            highlightTargetField.isOn = true;
        }
        else
        {
            highlightTargetField.isOn = false;
        }
    }
Example #4
0
    public void InitializeSettings()
    {
        camera             = Camera.main.GetComponent <TopDownCamera>();
        obstructionHandler = camera.target.GetComponentInChildren <ObstructionHandler>();

        distanceField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_DISTANCE);
        int allowZoom = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_ALLOW_ZOOM);

        if (allowZoom == 1)
        {
            allowZoomField.isOn = true;
        }
        else
        {
            allowZoomField.isOn = false;
        }
        zoomSmoothField.value   = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_ZOOM_SMOOTH);
        zoomStepField.value     = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_ZOOM_STEP);
        maxZoomField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_MAX_ZOOM);
        minZoomField.value      = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_MIN_ZOOM);
        smoothFollowField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_FOLLOW_SMOOTH);
        int useSmooth = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_USE_SMOOTH_FOLLOW);

        if (useSmooth == 0)
        {
            useSmoothFollowField.isOn = false;
        }
        else
        {
            useSmoothFollowField.isOn = true;
        }

        xRotationField.value    = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_X_ROTATION);
        yOrbitSmoothField.value = PlayerPrefs.GetFloat(CameraSettings.Instance.TOPDOWN_Y_ORBIT_SMOOTH);
        int allowOrbit = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_ALLOW_ORBIT);

        if (allowOrbit == 1)
        {
            allowOrbitField.isOn = true;
        }
        else
        {
            allowOrbitField.isOn = false;
        }
        orbitInputField.text = PlayerPrefs.GetString(CameraSettings.Instance.TOPDOWN_ORBIT_INPUT);

        int fadeObstructions = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_FADE_OBSTRUCTIONS);

        if (fadeObstructions == 1)
        {
            fadeObstructionsField.isOn = true;
        }
        else
        {
            fadeObstructionsField.isOn = false;
        }
        int highlightTarget = PlayerPrefs.GetInt(CameraSettings.Instance.TOPDOWN_HIGHLIGHT_TARGET);

        if (highlightTarget == 1)
        {
            highlightTargetField.isOn = true;
        }
        else
        {
            highlightTargetField.isOn = false;
        }
    }