private void Awake() { _animator = GetComponent <FSM>(); _state = GetComponent <EnemyState>(); _input = GetComponent <ICharacterInput <BossInput> >(); _hitFlash = GetComponent <HitFlash>(); _mover = GetComponent <BossMover>(); _groundDetector = GetComponent <ICanDetectGround>(); _stalkTracker = new BezierTracker(); _input.OnReceivedInput += HandleReceivedInput; _groundDetector.OnLandingStateChanged += HandleLandingStateChange; _animator.Subscribe(Animation.AnimationState.FadingIn, HandleFadeInAnimation); _animator.Subscribe(Animation.AnimationState.Completed, HandleCompletedAnimation); _animator.OnReceiveFrameEvent += HandleFrameEvent; foreach (var hitbox in _hitboxes) { hitbox.OnHit += HandleOnHit; } foreach (var weakpoint in _weakpoints) { weakpoint.SetParent(null); } }
// Use this for initialization void Start() { sprite = GetComponent <SpriteRenderer> (); archer = GetComponent <Archer> (); animator = GetComponent <Animator> (); stageFightCounter = 0; fightStarted = false; hasStartedFiring = false; mover = GetComponent <BossMover> (); }
// Use this for initialization void Start() { mover = GetComponent <BossMover> (); dracoBody = GetComponent <Rigidbody2D> (); sprite = GetComponent <SpriteRenderer> (); archer = GetComponent <Archer> (); hurt = GetComponent <AudioSource> (); fightStarted = false; stageFightCounter = 0; stageCounter = 0; mover.enabled = false; }
private void Awake() { stateMachine = new VRBossFSM(this); IdleState = new VRBossIdleState(this, stateMachine); FollowState = new VRBossFollowState(stateMachine, this); AttackState = new VRBossAttackState(stateMachine, this); FireballState = new VRBossFireballState(stateMachine, this); stateMachine.Initialize(IdleState); mover = GetComponent <BossMover>(); followTarget = false; animator = GetComponent <Animator>(); attacker = GetComponent <BossAttacker>(); fireballSpawner = GetComponent <VrBossFireballSpawner>(); }
void Start() { gameOver = false; restart = false; spawnEnemies = true; bossDeath = false; restartText.text = ""; gameOverText.text = ""; score = 0; UpdateScore(); StartCoroutine(SpawnWaves()); // Loads highscore from previous runs highScore = PlayerPrefs.GetInt("High Score"); highScoreText.text = "High Score: \n" + highScore; bossEncounter = 1500; bossScoreText.text = "Next boss: \n" + bossEncounter; GameObject bossWeaponControllerObject = GameObject.FindWithTag("Boss"); if (bossWeaponControllerObject != null) { bossWeaponController = bossWeaponControllerObject.GetComponent <BossWeaponController>(); } if (bossWeaponController == null) { Debug.Log("Cannot find 'BossWeaponController' script"); } GameObject bossMoverObject = GameObject.FindWithTag("Boss"); if (bossMoverObject != null) { bossMover = bossMoverObject.GetComponent <BossMover>(); } if (bossMover == null) { Debug.Log("Cannot find 'BossMover' script"); } }
void Start() { current = this; }