Exemplo n.º 1
0
    /***************************************************/
    /***  METHODS               ************************/
    /***************************************************/

    /********  UNITY MESSAGES   ************************/

    private void Awake()
    {
        if (m_instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            m_instance = this;
        }
    }
Exemplo n.º 2
0
    void Shoot(ONEGeneral.Direction p_direction, GameObject p_projectileSpawn)
    {
        if (p_projectileSpawn == null)
        {
            return;
        }

        GameObject created = Instantiate(p_projectileSpawn, transform.parent);

        created.transform.localPosition = m_destination;
        ProjectileSpawn script = created.GetComponent <ProjectileSpawn>();

        Debug.Assert(script != null);
        script.Direction = p_direction;
        script.PlayMyTurn();

        ONESoundDesign.EnemyShoot();
    }
Exemplo n.º 3
0
    public void Hit(int p_damage)
    {
        m_currentLifePoint -= p_damage;

        ONESoundDesign.EnemyHurt();

        if (m_currentLifePoint <= 0)
        {
            if (m_loot)
            {
                GameObject created = Instantiate(m_loot, transform.parent);
                created.transform.localPosition = m_destination;
            }

            Debug.Log(name + " diededed ! x(");
            Destroy(gameObject);
        }
    }
Exemplo n.º 4
0
        public void Shoot(Transform p_parent, Vector3 p_position, ONEGeneral.Direction p_direction)
        {
            if (m_projectileSpawn == null || m_currentCooldown != 0)
            {
                Debug.Log("Can't shoot"); return;
            }

            GameObject created = Instantiate(m_projectileSpawn, p_parent);

            created.transform.localPosition = p_position;
            ProjectileSpawn script = created.GetComponent <ProjectileSpawn>();

            script.IsFromPlayer = true;
            script.Direction    = p_direction;
            Debug.Assert(script != null);

            m_currentCooldown = m_cooldown + 1;

            ONESoundDesign.PlayerShoot();
        }
Exemplo n.º 5
0
 // Hit me master
 public void Hit(int p_damage)
 {
     m_currentLifePoint -= p_damage;
     ONESoundDesign.PlayerHurt();
 }