// Update is called once per frame
 void Update()
 {
     if (!registered)
     {
         directionSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.CARDINAL_DIRECTION);
         directionSubscription.OnStateChanged += ChangeSpriteDirection;
         registered = true;
     }
 }
 private void OnGameSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     if (scene.name == ConstantStrings.MAINGAME_SCENE_NAME)
     {
         player = GameObject.Find("Player");
         playerStatesManager = player.GetComponent <CharacterStatesManager>();
         CharacterState.CharacterStateSubscription deathSubscription = playerStatesManager.GetCharacterStateSubscription(ConstantStrings.DEATH_STATE);
         deathSubscription.OnStateChanged += OnPlayerDeath;
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (!registered)
        {
            lightAttackStateSubscription = statesManager.GetCharacterStateSubscription(
                CharacterAbilityCastingStates.LightAttackCastingState.ToString());
            heavyAttackStateSubscription = statesManager.GetCharacterStateSubscription(
                CharacterAbilityCastingStates.HeavyAttackCastingState.ToString());
            utilityAbilityStateSubscription = statesManager.GetCharacterStateSubscription(
                CharacterAbilityCastingStates.UtilityCastingState.ToString());
            //moveSetStateSubscription = statesManager.GetCharacterStateSubscription(
            //ConstantStrings.MOVE_SET);

            moveSetStateSubscription.OnStateChanged += MoveSetChanged;

            lightAttackStateSubscription.OnStateChanged    += CastLightAttack;
            heavyAttackStateSubscription.OnStateChanged    += CastHeavyAttack;
            utilityAbilityStateSubscription.OnStateChanged += CastUtilityAbility;
            registered = true;
        }
        UpdateCooldowns();
    }
    // Use this for initialization
    void Start()
    {
        CharacterState.CharacterStateSubscription hammerStateSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.Enemy.HammerBoss.HAMMER_THROW_CAST_STATE);
        hammerStateSubscription.OnStateChanged += CheckHammerState;
        CharacterState.CharacterStateSubscription hammerHitPlayerSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.Enemy.HammerBoss.HAMMER_HIT_PLAYER);
        hammerHitPlayerSubscription.OnStateChanged += CheckHammerHitPlayerState;
        CharacterState.CharacterStateSubscription hammerHitGroundSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.Enemy.HammerBoss.HAMMER_HITS_GROUND);
        hammerHitGroundSubscription.OnStateChanged += CheckHammerHitGround;
        CharacterState.CharacterStateSubscription enemyHitHammerSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.Enemy.HammerBoss.HAMMER_HIT_ENEMY);
        enemyHitHammerSubscription.OnStateChanged += CheckEnemyHitHammerState;

        hammerThrown = statesManager.GetExistingCharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_THROWN);
        bcb          = GetComponentInParent <BossCastingBehavior>();
        spellStats   = GetComponent <SpellStats>();
        hammerMoving = false;
        hammerPickUp = true;
        psm          = GetComponent <ProjectileStraightMovement>();
        //Get hammer throw prefab
        hammerThrow    = bcb.GetAttack(2);
        rgb            = GetComponent <Rigidbody2D>();
        hammerPosition = new Vector2(0, 1.5f);        //Change this value to set how high boss holds hammer while walking
    }
 void Start()
 {
     statesManager.GetCharacterStateSubscription(ConstantStrings.DEATH_STATE).OnStateChanged += DestroyOnDeath;
 }
 // Use this for initialization
 void Start()
 {
     CharacterState.CharacterStateSubscription healthStateSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.CURRENT_HEALTH);
     healthStateSubscription.OnStateChanged += CheckHit;
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     CharacterState.CharacterStateSubscription meleeStateSubscription = statesManager.GetCharacterStateSubscription(ConstantStrings.Enemy.HammerBoss.MELEE_ATTACK_CAST_STATE);
     meleeStateSubscription.OnStateChanged += CheckMeleeState;
 }