void Start() { particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>(); audioPlayer = GetComponent <AudioPlayer>(); enemyRenderer = this.GetComponentInChildren <Renderer>(); enemyCollider = this.GetComponent <Collider>(); enemyAnimator = this.GetComponentInChildren <Animator>(); defaultShader = enemyRenderer.material.shader; outlineShader = Shader.Find("Custom/Mobile Diffuse Outline Soften Edge"); enemyHealthBar = GameObject.Find("GameplayUI").GetComponent <EnemyHealthBar>(); pauseGameplay = enemyHealthBar.gameObject.GetComponent <PauseGameplay>(); switch (enemyType) { case EnemyType.Skull: SkullInit(); break; case EnemyType.Fenrir: FenrirInit(); break; default: break; } enemyBehaviour = this.GetComponent <EnemyBehaviour>(); enemyBehaviour.SetLife(life); }
void Start() { enemyType = GetComponent <EnemyStats>().GetEnemyType(); enemyAgent = GetComponent <NavMeshAgent>(); targetTransform = GameObject.FindWithTag("Player").GetComponent <Transform>(); targetBehaviour = targetTransform.gameObject.GetComponent <CharacterBehaviour>(); basicAttackTrigger = GetComponentInChildren <AttackTrigger>(); enemyAnimator = GetComponentInChildren <Animator>(); particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>(); enemyAudioPlayer = GetComponent <AudioPlayer>(); foreach (AnimationClip clip in enemyAnimator.runtimeAnimatorController.animationClips) { switch (enemyType) { case EnemyStats.EnemyType.Skull: if (clip.name == "hit") { basicAttackDuration = clip.length; } if (clip.name == "appear") { appearDelayTime = clip.length / 1.7f; } break; case EnemyStats.EnemyType.Fenrir: if (clip.name == "jumpIn") { jumpInitDelayTime = clip.length; } if (clip.name == "jumpAttack") { jumpAttackInitTime = clip.length; } break; default: break; } } enemyAgent.SetDestination(transform.position); enemySpeed = enemyAgent.speed; enemyAngularSpeed = enemyAgent.angularSpeed; enemyAcceleration = enemyAgent.acceleration; if (enemyType == EnemyStats.EnemyType.Fenrir) { baAnimationLength = 5; } enemyHealthBar = GameObject.Find("GameplayUI").GetComponent <EnemyHealthBar>(); endingPlayer = enemyHealthBar.gameObject.GetComponent <PlayEnding>(); }
void Start() { playerBehaviour = GameObject.FindWithTag("Player").GetComponent <CharacterBehaviour>(); playerInitLife = playerBehaviour.GetLife(); particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>(); initPosition = auraTransform.localPosition; initY = initPosition.y; deltaY = endY - initY; PlayAudio(0, healingAudios[0].volume, this.gameObject, true, true); }
private void Start() { if (GetComponent <ParticleSystem>() != null) { particleSystems.Add(GetComponent <ParticleSystem>()); } if (GetComponentsInChildren <ParticleSystem>().Length > 0) { particleSystems.AddRange(GetComponentsInChildren <ParticleSystem>()); } particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>(); }
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>(); }