Example #1
0
 void Start()
 {
     m_lastUpdateTime = Random.value;
     m_health         = GameMaster.GetPlayer().GetComponent <PlayerHealth>();
     m_endGame        = GameMaster.GetPlayer().GetComponent <PlayerEndGame>();
     m_renderer       = GetComponent <SpriteRenderer>();
 }
Example #2
0
    public bool Active()
    {
        AIDamage damage = GetComponent <AIDamage>();

        if (damage != null && damage.IsDead())
        {
            return(false);
        }

        PlayerHealth playerHealth = GameMaster.GetPlayer()?.GetComponent <PlayerHealth>();

        if (playerHealth != null && playerHealth.IsDead())
        {
            return(false);
        }

        PlayerEndGame playerEndGame = GameMaster.GetPlayer()?.GetComponent <PlayerEndGame>();

        if (playerEndGame != null && playerEndGame.IsGameFinished())
        {
            return(false);
        }

        return(m_triggerArea == null || m_triggerArea.Active());
    }
Example #3
0
 void Start()
 {
     m_rigidBody            = GetComponent <Rigidbody2D>();
     m_controls             = GetComponent <PlayerControls>();
     m_endGame              = GetComponent <PlayerEndGame>();
     m_health               = GetComponent <PlayerHealth>();
     m_currentMovementSpeed = m_baseMovementSpeed;
 }
Example #4
0
    void Start()
    {
        m_audio    = GetComponent <AudioCharacterPlayer>();
        m_controls = GetComponent <PlayerControls>();
        m_movement = GetComponent <PlayerMovement>();
        m_shoot    = GetComponent <ShootingHelper>();
        m_endGame  = GetComponent <PlayerEndGame>();
        m_health   = GetComponent <PlayerHealth>();

        m_currentAttackSpeed     = m_baseAttackSpeed;
        m_currentAttackDamage    = m_baseAttackDamage;
        m_currentProjectileSpeed = m_baseProjectileSpeed;
        m_currentInaccuracy      = m_baseInaccuracy;
    }