Ejemplo n.º 1
0
 private void Awake()
 {
     player       = FindObjectOfType <HeroKnight>();
     animator     = GetComponent <Animator>();
     body         = GetComponent <Rigidbody2D>();
     groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
 }
Ejemplo n.º 2
0
    /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    // Use this for initialization
    void Start()
    {
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
        healthBar.SetMaxHealth(health);
        FindObjectOfType <AudioManager>().Play("Background");
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
     m_wallSensorR1 = transform.Find("WallSensor_R1").GetComponent <Sensor_HeroKnight>();
     m_wallSensorR2 = transform.Find("WallSensor_R2").GetComponent <Sensor_HeroKnight>();
     m_wallSensorL1 = transform.Find("WallSensor_L1").GetComponent <Sensor_HeroKnight>();
     m_wallSensorL2 = transform.Find("WallSensor_L2").GetComponent <Sensor_HeroKnight>();
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR1 = transform.Find("WallSensor_R1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR2 = transform.Find("WallSensor_R2").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL1 = transform.Find("WallSensor_L1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL2 = transform.Find("WallSensor_L2").GetComponent <Sensor_HeroKnight>();
        m_animator.SetBool("noBlood", m_noBlood);

        health = maxHealth;
        healthBar.MaxHealth(maxHealth);
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR1 = transform.Find("WallSensor_R1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR2 = transform.Find("WallSensor_R2").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL1 = transform.Find("WallSensor_L1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL2 = transform.Find("WallSensor_L2").GetComponent <Sensor_HeroKnight>();

        //own code
        canInteract     = false;
        startedTalking  = false;
        dialogueManager = GameObject.Find("DialogueManager").GetComponent <DialogueManager>();
    }
Ejemplo n.º 6
0
    public override void InitService()
    {
        base.InitService();
        _transform      = transform;
        _animator       = GetComponent <Animator>();
        _rigidbody2D    = GetComponent <Rigidbody2D>();
        _spriteRenderer = GetComponent <SpriteRenderer>();
        _groundSensor   = _transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
        _wallSensorR1   = _transform.Find("WallSensor_R1").GetComponent <Sensor_HeroKnight>();
        _wallSensorR2   = _transform.Find("WallSensor_R2").GetComponent <Sensor_HeroKnight>();
        _wallSensorL1   = _transform.Find("WallSensor_L1").GetComponent <Sensor_HeroKnight>();
        _wallSensorL2   = _transform.Find("WallSensor_L2").GetComponent <Sensor_HeroKnight>();

        ChangeState(PlayerState.OnGround);
    }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        //Test
        currentHealth = maxHealth;
        healthBar.SetMaxHealth(maxHealth);

        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        movementSrc    = GetComponent <AudioSource>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR1 = transform.Find("WallSensor_R1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorR2 = transform.Find("WallSensor_R2").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL1 = transform.Find("WallSensor_L1").GetComponent <Sensor_HeroKnight>();
        m_wallSensorL2 = transform.Find("WallSensor_L2").GetComponent <Sensor_HeroKnight>();
        AttackPtL      = GameObject.FindGameObjectWithTag("AttackPtL").gameObject;
        AttackPtR      = GameObject.FindGameObjectWithTag("AttackPtR").gameObject;
        FirePointL     = GameObject.FindGameObjectWithTag("FirePtL").gameObject;
        FirePointR     = GameObject.FindGameObjectWithTag("FirePtR").gameObject;
        projectile     = gameObject.GetComponent <Projectile>();
    }