Beispiel #1
0
 //On awake sets the values of the variables to point to the right objects.
 protected virtual void Awake()
 {
     Player = GameObject.FindObjectOfType(typeof(vp_FPPlayerEventHandler)) as vp_FPPlayerEventHandler;
     cross = GameObject.FindObjectOfType(typeof(vp_SimpleCrosshair)) as vp_SimpleCrosshair;
     Gun = GameObject.FindObjectOfType(typeof(vp_FPWeapon)) as vp_FPWeapon;
     camera = GameObject.FindObjectOfType(typeof(vp_FPCamera)) as vp_FPCamera;
     myCam=camera.GetComponent<Camera>();
     BaseFOV=camera.RenderingFieldOfView;//Replaces the value of BaseFOV to whatever the actual Base FOV is.
     BaseShake=camera.ShakeSpeed;//Does the same to the base shake value.
 }
    // Use this for initialization
    void Start()
    {
        /* Regular First Person Controller stuff */
        //playerML = GameObject.FindGameObjectWithTag("Player").GetComponent<MouseLook>();
        //cameraML = Camera.main.GetComponent<MouseLook>();

        /* For Hero character controller */
        //playerML = GameObject.FindGameObjectWithTag("Player").GetComponent<vp_FPInput>();
        //crosshair = GameObject.FindGameObjectWithTag("Player").GetComponent<vp_SimpleCrosshair>();
        playerML  = player.GetComponent <vp_FPInput>();
        crosshair = player.GetComponent <vp_SimpleCrosshair>();
        oldVec    = playerML.GetMouseLookSensitivity();
        PauseGUI.SetActive(false);
        crosshair.SetPaused(false);
        newVec = new Vector2(0.0f, 0.0f);
    }