Setup() public method

public Setup ( Camera camera ) : void
camera Camera
return void
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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>();
        }
コード例 #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);
 }
コード例 #6
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);
     CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware);
 }
コード例 #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);
 }
コード例 #8
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);

            UpdateCurrentFootstepsPlacementState(EntityPlacementState.Outside);
        }
コード例 #9
0
 // 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);
 }
コード例 #10
0
    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;
        }
    }
コード例 #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>();
        }
コード例 #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));
     }
 }
コード例 #13
0
ファイル: FirstPersonController.cs プロジェクト: risq/sand
 // 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>();
 }
コード例 #14
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);

            FMODUnity.RuntimeManager.AttachInstanceToGameObject(m_FootstepInstance, GetComponent <Transform>(), GetComponent <Rigidbody>());
        }
コード例 #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>();
 }
コード例 #16
0
 // 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> ();
 }
コード例 #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>();
        }
コード例 #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);
 }
コード例 #19
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);
     _gravityMultiplierBeforeSwim = m_GravityMultiplier;
     m_Camera.enabled             = false;
     ThirdPersonCamera.enabled    = true;
 }
コード例 #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> ();
 }
コード例 #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;
 }
コード例 #22
0
 // 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>();
 }
コード例 #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;
 }
コード例 #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);
 }
コード例 #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;
 }
コード例 #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
        }
コード例 #27
0
 /// <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);
 }
コード例 #28
0
 // 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);
 }
コード例 #29
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.visible = false;

            // Try changing this false curser move true curser not move
            m_MouseLook.lockCursor = false;
        }
コード例 #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;
     }
 }