Setup() public method

public Setup ( Camera camera ) : void
camera Camera
return void
Esempio n. 1
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
Esempio n. 2
0
 // Use this for initialization
 private void Start()
 {
     characterController    = GetComponent <CharacterController>();
     currentCamera          = Camera.main;
     originalCameraPosition = currentCamera.transform.localPosition;
     fovKick.Setup(currentCamera);
     headBob.Setup(currentCamera, stepInterval);
     stepCycle   = 0f;
     nextStep    = stepCycle / 2f;
     jumping     = false;
     audioSource = GetComponent <AudioSource>();
     mouseLook.Init(transform, currentCamera.transform);
 }
Esempio n. 3
0
 // Use this for initialization
 private void Start()
 {
     //Time.timeScale = 1; LAST RESORT IF SHADER RESET IN PAUSECONTROL DOESNT WORK ALDSLFWEOIFJWEOIFJWOFIJWEFOKEF SAVE ME
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
Esempio n. 4
0
        //private BackgroundMusic music;

        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);
            //music = GameObject.FindGameObjectWithTag("MusicPlayer").GetComponent<BackgroundMusic>();
        }
Esempio n. 5
0
 // Use this for initialization
 private void Start()
 {
     //Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.ForceSoftware);
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware);
 }
Esempio n. 7
0
 // Use this for initialization
 private void Start()
 {
     gamePad = InputManager.ActiveDevice;
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle = 0f;
     m_NextStep  = m_StepCycle / 2f;
     m_Jumping   = false;
     m_MouseLook.Init(transform, m_Camera.transform);
     m_ControllerLook.Init(transform, m_Camera.transform);
 }
        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle = 0f;
            m_NextStep  = m_StepCycle / 2f;
            m_Jumping   = false;
            m_MouseLook.Init(transform, m_Camera.transform);

            UpdateCurrentFootstepsPlacementState(EntityPlacementState.Outside);
        }
 // Use this for initialization
 public override void OnStartLocalPlayer()
 {
     base.OnStartLocalPlayer();
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera                 = GetComponentInChildren <Camera>();
     m_Camera.enabled         = true;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
    void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_ControllerExt       = GetComponent <PlayerControllerExtension> ();
        m_Camera = GetComponentInChildren <Camera> ();
        m_Camera = m_Camera == null ? Camera.main : m_Camera;
        m_FovKick.Setup(m_Camera);
        m_Jumping = false;
        m_MouseLook.Init(transform, m_Camera.transform);

        if (GameController.Instance)
        {
            GameController.Instance.player = gameObject;
        }
    }
Esempio n. 11
0
        //private Animator pistol;

        // Use this for initialization
        private void Start()
        {
            Application.targetFrameRate = 300;
            m_CharacterController       = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);
            //pistol = gameObject.GetComponent<Animator>();
        }
Esempio n. 12
0
 static int Setup(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FOVKick            obj  = (FOVKick)ToLua.CheckObject <FOVKick>(L, 1);
         UnityEngine.Camera arg0 = (UnityEngine.Camera)ToLua.CheckObject(L, 2, typeof(UnityEngine.Camera));
         obj.Setup(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 13
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     m_footprints  = GameObject.Find("Footprints").GetComponent <Footprints>();
     m_dustEmitter = m_dustEmitterObject.GetComponent <ParticleSystem>();
 }
        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);

            FMODUnity.RuntimeManager.AttachInstanceToGameObject(m_FootstepInstance, GetComponent <Transform>(), GetComponent <Rigidbody>());
        }
Esempio n. 15
0
 // Use this for initialization
 private void Start()
 {
     initialGravityModifier = m_GravityMultiplier;
     m_CharacterController  = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     playerAnim = GetComponentInParent <Animator>();
 }
 // Use this for initialization
 protected virtual void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     //m_Camera = Camera.main;
     m_Camera = this.transform.GetChild(0).GetComponent <Camera> ();
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     rb = GetComponent <Rigidbody> ();
 }
Esempio n. 17
0
        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle = 0f;
            m_NextStep  = m_StepCycle / 2f;
            m_Jumping   = false;
            m_MouseLook.Init(transform, m_Camera.transform);

            playerManager   = GetComponent <PlayerManager>();
            shotGunAnimator = GetComponentInChildren <Animator>();
        }
Esempio n. 18
0
 private void Start()
 {
     GameEventsScript.gameIsOver.AddListener(isGameOver);
     GameEventsScript.pauseGame.AddListener(isPaused);
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     _gravityMultiplierBeforeSwim = m_GravityMultiplier;
     m_Camera.enabled             = false;
     ThirdPersonCamera.enabled    = true;
 }
Esempio n. 20
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_CharacterControllerOriginalHeight = m_CharacterController.height;
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     LockCursor = true;
     IM         = GameObject.Find("Interface").transform.GetComponent <InterfaceManager> ();
 }
Esempio n. 21
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     gameController       = GameObject.Find("Game Controller");
     gameControllerScript = gameController.GetComponent <GameController>();
     isPlayerAlive        = true;
 }
 // Use this for initialization
 private void Start()
 {
     _characterController = GetComponent <CharacterController>();
     _camera = Camera.main;
     _originalCameraPosition = _camera.transform.localPosition;
     _mouseLook.Init(transform, _camera.transform);
     _fovKick.Setup(_camera);
     _headBob.Setup(_camera, _stepInterval);
     _stepCycle   = 0f;
     _nextStep    = _stepCycle / 2f;
     _stamina     = GetComponent <Stamina>();
     _jumping     = false;
     _audioSource = GetComponent <AudioSource>();
     _underWater  = FindObjectOfType <UnderWater>();
     _mana        = FindObjectOfType <Mana>();
 }
Esempio n. 23
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     rb       = gameObject.GetComponent <Rigidbody>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     script        = chest.GetComponent <ChestScript>();
     speedUpgraded = false;
 }
Esempio n. 24
0
 // Use this for initialization
 private void Start()
 {
     mainMenu                 = FindObjectOfType <MainMenu>();
     pauseCG                  = pause.GetComponent <CanvasGroup>();
     deviceStatusCG           = deviceStatus.GetComponent <CanvasGroup>();
     m_CharacterController    = GetComponent <CharacterController>();
     m_Camera                 = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
Esempio n. 25
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     //set player transform
     gameObject.transform.position = GameManager.instance.lastPosition;
     gameObject.transform.rotation = GameManager.instance.lastRotation;
 }
Esempio n. 26
0
        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);

            Cursor.lockState = CursorLockMode.Locked; //blocco il cursore al centro
            Cursor.visible   = false;                 //lo rendo invisibile
        }
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     m_CharacterController = GetComponent <CharacterController>();
     RoomMenu   = FindObjectOfType <bl_RoomMenu>();
     GunManager = GetComponentInChildren <bl_GunManager>();
     m_Camera   = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     defaultCameraRPosition   = CameraRoot.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, HeatRoot, RoomMenu, GunManager);
 }
 // Use this for initialization
 private void Start()
 {
     swordBox = this.gameObject.transform.GetChild(1).gameObject;
     swordBox.SetActive(false);
     attackCooldown        = 0.0f;
     canAttack             = true;
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);
            Cursor.visible = false;

            // Try changing this false curser move true curser not move
            m_MouseLook.lockCursor = false;
        }
Esempio n. 30
0
 // Use this for initialization
 private void Start()
 {
     LocalPlayer = isLocalPlayer;
     if (LocalPlayer)
     {
         m_CharacterController = GetComponent <CharacterController>();
         //m_Camera = Camera.main;
         m_OriginalCameraPosition = m_Camera.transform.localPosition;
         m_FovKick.Setup(m_Camera);
         m_StepCycle   = 0f;
         m_NextStep    = m_StepCycle / 2f;
         m_Jumping     = false;
         m_AudioSource = GetComponent <AudioSource>();
         m_MouseLook.Init(transform, m_Camera.transform);
         gameObject.layer = 8;
     }
 }