public override void OnInspectorGUI() { SmoothCam camController = (SmoothCam)target; base.OnInspectorGUI(); if (GUILayout.Button("Center On Target")) { camController.RecenterOnTarget(); } }
void Start() { _gameManager = GameManager.instance; if (_gameManager != null) { foreach (UpgradeStruct us in _gameManager._allUpgrades) { if (us.upgradeValues[0].upgradeType == UpgradeType.ParrotUpgrade) { if (us.Purchased) { _parrotActive = true; } break; } } } anim = GetComponentInChildren <Animator>(); baseAnimSpeed = anim.speed; mainCamera = FindObjectOfType <SmoothCam>(); // Effects Vector3 offset = transform.up * 2 + transform.forward * 0.35f; GameObject drunkObj = (GameObject)Instantiate(drunkEffect, transform.position + offset, transform.rotation); drunkObj.transform.parent = transform; drunkParticles = drunkObj.GetComponent <ParticleSystem>(); GameObject soberObj = (GameObject)Instantiate(soberEffect, transform.position + offset, transform.rotation); soberObj.transform.parent = transform; soberParticles = soberObj.GetComponent <ParticleSystem>(); ragdoll = GetComponentInChildren <PirateCharacterAnimator>(); sceneManager = SceneManager_Andrew.instance; startingRotation = transform.rotation; startingPosition = transform.position; controller = GetComponent <CharacterController>(); lg = GameObject.FindGameObjectWithTag("LevelGen").GetComponent <ProcGen>(); //debugText = GameObject.Find("DEBUG").GetComponent<Text>(); // Quick and dirty debugging jumpSound = (AudioClip)Resources.Load("Sounds/player_jump"); splashSound = (AudioClip)Resources.Load("Sounds/player_splash"); smackSound = (AudioClip)Resources.Load("Sounds/player_smack"); deckSound = (AudioClip)Resources.Load("Sounds/deck_jump"); landSound = (AudioClip)Resources.Load("Sounds/player_land"); skidSound = (AudioClip)Resources.Load("Sounds/player_skid"); ResetCharacter(); }
// Use this for initialization void Awake() { s = PauseCam.GetComponent<SmoothCam>(); //up = UP.GetComponent<UP>(); //down = DOWN.GetComponent<DOWN>(); //left = LEFT.GetComponent<LEFT>(); //right = RIGHT.GetComponent<RIGHT>(); XSen = PlayerPrefs.GetFloat("XSen", 8); YSen = PlayerPrefs.GetFloat("YSen", 8); ZSen = PlayerPrefs.GetFloat("ZSen", 15) * 10; ZoomIn = PlayerPrefs.GetInt("ZoomIN", (int)KeyCode.Q); ZoomOut = PlayerPrefs.GetInt("ZoomOUT", (int)KeyCode.E); CamSpeed = ((XSen * YSen)/2)*CameraSpeed; DebugConsole.Log("CamSpeed: " + CamSpeed); inst = this; }
//Functions void Awake() { Active = false; if(!GameObject.Find("LoadingScreen")) { Vector3 lspos = new Vector3(0,0, 1000); var l = Instantiate(Load, lspos , Quaternion.identity); l.name = "LoadingScreen"; } LoadS = GameObject.Find("LoadingScreen"); if(LoadS !=null) Debug.Log("LoadingScreen Found"); LS = LoadS.GetComponent<LoadingScreen>(); if(LS !=null) DebugConsole.Log("LoadingScreen Component Got"); if(!Main) { s = PauseCam.GetComponent<SmoothCam>(); } }
void Start() { _gameManager = GameManager.instance; if(_gameManager != null) { foreach (UpgradeStruct us in _gameManager._allUpgrades) { if (us.upgradeValues[0].upgradeType == UpgradeType.ParrotUpgrade) { if (us.Purchased) { _parrotActive = true; } break; } } } anim = GetComponentInChildren<Animator>(); baseAnimSpeed = anim.speed; mainCamera = FindObjectOfType<SmoothCam>(); // Effects Vector3 offset = transform.up * 2 + transform.forward * 0.35f; GameObject drunkObj = (GameObject)Instantiate(drunkEffect, transform.position + offset, transform.rotation); drunkObj.transform.parent = transform; drunkParticles = drunkObj.GetComponent<ParticleSystem>(); GameObject soberObj = (GameObject)Instantiate(soberEffect, transform.position + offset, transform.rotation); soberObj.transform.parent = transform; soberParticles = soberObj.GetComponent<ParticleSystem>(); ragdoll = GetComponentInChildren<PirateCharacterAnimator>(); sceneManager = SceneManager_Andrew.instance; startingRotation = transform.rotation; startingPosition = transform.position; controller = GetComponent<CharacterController>(); lg = GameObject.FindGameObjectWithTag("LevelGen").GetComponent<ProcGen>(); //debugText = GameObject.Find("DEBUG").GetComponent<Text>(); // Quick and dirty debugging jumpSound = (AudioClip)Resources.Load("Sounds/player_jump"); splashSound = (AudioClip)Resources.Load("Sounds/player_splash"); smackSound = (AudioClip)Resources.Load("Sounds/player_smack"); deckSound = (AudioClip)Resources.Load("Sounds/deck_jump"); landSound = (AudioClip)Resources.Load("Sounds/player_land"); skidSound = (AudioClip)Resources.Load("Sounds/player_skid"); ResetCharacter(); }
//Functions void Awake() { s = Cam.GetComponent<SmoothCam>(); }
private void Start() { PW = PictureWindow.Instance; Cam = SmoothCam.GetComponentInChildren <Camera>(); }
//Functions void Awake() { Active = false; Cam = GameObject.Find("MCam"); s = Cam.GetComponent<SmoothCam>(); }
//Functions void Awake() { s = Cam.GetComponent<SmoothCam>(); Active = false; }