private void Start() { playerTransform = GetComponent <Transform>(); playerAgent = GetComponent <NavMeshAgent>(); hammerBehaviour = GetComponentInChildren <HammerBehaviour>(); basicAttackTrigger = GetComponentInChildren <AttackTrigger>(); cameraBehaviour = GameObject.FindWithTag("CameraController").GetComponent <CameraBehaviour>(); thorAnimator = GetComponentInChildren <Animator>(); timeManager = GameObject.FindWithTag("manager").GetComponent <TimeManager>(); audioPlayer = GetComponent <AudioPlayer>(); musicAmbientController = GameObject.FindWithTag("MusicAmbientController").GetComponent <MusicAmbientController>(); foreach (AnimationClip animation in thorAnimator.runtimeAnimatorController.animationClips) { //animationsList.Add(new AnimationClipName(animation.name, animation)); if (animation.name == "throwHammer") { throwDuration = animation.length / 1.4f; } if (animation.name == "hit_01") { attackDuration = animation.length; } if (animation.name == "slowArea") { slowAreaInitDelay = animation.length / 1.3f; } if (animation.name == "lightboltRain") { lightRainCastInitDuration = animation.length; } } agentSpeed = playerAgent.speed; maxLife = life; playerHealthBar = GameObject.Find("GameplayUI").GetComponent <PlayerHealthBar>(); StartCoroutine(SetInitLife()); endingPlayer = playerHealthBar.gameObject.GetComponent <PlayEnding>(); passiveInitDuration = passiveDuration; particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>(); }
private void Start() { cameraBehaviour = GameObject.FindWithTag("CameraController").GetComponent <CameraBehaviour>(); timeManager = GameObject.FindWithTag("manager").GetComponent <TimeManager>(); sceneChanger = GameObject.FindWithTag("GameplayUI").GetComponent <ChangeScene>(); musicAmbientController = GameObject.FindWithTag("MusicAmbientController").GetComponent <MusicAmbientController>(); //Seteadas des del editor /*endingCanvas = GameObject.Find("Ending"); * endMessage = GameObject.Find("EndMessage").GetComponent<Text>(); * * endingAnimators[0] = GameObject.Find("Credits").GetComponent<Animator>(); * endingAnimators[1] = GameObject.Find("ExitToMainMenu").GetComponent<Animator>(); * endingAnimators[2] = GameObject.Find("EndMessage").GetComponent<Animator>(); * endingAnimators[3] = GameObject.Find("BottomBG").GetComponent<Animator>(); * endingAnimators[4] = GameObject.Find("TopBG").GetComponent<Animator>();*/ }
private void Start() { sceneChanger = GameObject.Find("GameplayUI").GetComponent <ChangeScene>(); musicController = GameObject.FindWithTag("MusicAmbientController").GetComponent <MusicAmbientController>(); }