예제 #1
0
    void Start()
    {
        standard = GetComponent <StandardCamera>();
        topDown  = GetComponent <TopDownCamera>();
        rts      = GetComponent <RTSCamera>();

        SwitchToStandard();
    }
예제 #2
0
    void Start()
    {
        standard = GetComponent<StandardCamera>();
        topDown = GetComponent<TopDownCamera>();
        rts = GetComponent<RTSCamera>();

        //SwitchToStandard();
    }
예제 #3
0
 public void Init()
 {
     Profiler.maxNumberOfSamplesPerFrame = -1;
     standard = Camera.main.GetComponent<StandardCamera>();
     topDown = Camera.main.GetComponent<TopDownCamera>();
     rts = Camera.main.GetComponent<RTSCamera>();
     fps = Camera.main.GetComponent<FPSCamera>();
     
     SwitchToCamera(PlayerPrefs.GetInt(CameraSettings.Instance.CAMERA_TYPE));
 }
예제 #4
0
    public void Init()
    {
        Profiler.maxNumberOfSamplesPerFrame = -1;
        standard = Camera.main.GetComponent <StandardCamera>();
        topDown  = Camera.main.GetComponent <TopDownCamera>();
        rts      = Camera.main.GetComponent <RTSCamera>();
        fps      = Camera.main.GetComponent <FPSCamera>();

        SwitchToCamera(PlayerPrefs.GetInt(CameraSettings.Instance.CAMERA_TYPE));
    }
예제 #5
0
    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;
    }
예제 #6
0
    void Start()
    {
        targetRotation = transform.rotation;
        if (GetComponent<Rigidbody>())
            rBody = GetComponent<Rigidbody>();
        else
            Debug.LogError("The character needs a rigidbody.");

        forwardInput = turnInput = jumpInput = 0;
        standardCam = Camera.main.GetComponent<StandardCamera>();
        fpsCam = Camera.main.GetComponent<FPSCamera>();
        fpsCam.enabled = false;
    }
    void Awake()
    {
        cameraScript = cam.GetComponent<StandardCamera>();
            controllerScript = GetComponent<CharacterMovement>();

            if (photonView.isMine)
            {
                //MINE: local player, simply enable the local scripts
                if (cam.GetComponent<RTSCamera>())
                {

                }
                else
                {
                    cameraScript.enabled = true;
                    controllerScript.enabled = true;
                    cameraScript.Initialize(transform);
                }
            }
            else
            {
                if (cam.GetComponent<RTSCamera>())
                {
                    Destroy(gameObject);
                }
                else
                {
                    Destroy(cameraScript.gameObject);
                    cameraScript.enabled = false;
                }
                controllerScript.enabled = true;
                controllerScript.GetComponent<PlayerPowers>().enabled = false;
                controllerScript.isControllable = false;
            }

            gameObject.name = gameObject.name + photonView.viewID;
    }
    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;
        }
    }