コード例 #1
0
ファイル: Fire.cs プロジェクト: Memia/GameSystem
    public override void OnTriggerEnter(Collider other)
    {
        WaypointEnemy Enemy = other.GetComponent <WaypointEnemy>();

        // If it is indeed an enemy
        if (Enemy)
        {
            Enemy.TakeDamage(damage);
        }
    }
コード例 #2
0
ファイル: Projectile.cs プロジェクト: Memia/GameSystem
    // Update is called once per frame
    public virtual void OnTriggerEnter(Collider other)
    {
        WaypointEnemy Enemy = other.GetComponent <WaypointEnemy>();

        // If it is indeed an enemy
        if (Enemy)
        {
            //Deal damage to the enemy
            Enemy.TakeDamage(damage);
            //Destroy the bullet
            Destroy(gameObject);
        }
        Destroy(gameObject);
        Instantiate(particles, transform.position, transform.rotation);
    }
コード例 #3
0
    // Update is called once per frame
    void OnTriggerEnter(Collider other)
    {
        //Get the enemy component from it
        WaypointEnemy Enemy = other.GetComponent <WaypointEnemy>();

        // If it is indeed an enemy
        if (Enemy)
        {
            //Deal damage to the enemy
            Enemy.TakeDamage(damage);
            //Destroy the bullet
            Destroy(gameObject);
        }
        Destroy(gameObject);
        Instantiate(particles);
    }
コード例 #4
0
ファイル: Icy.cs プロジェクト: Memia/GameSystem
    public override void OnTriggerEnter(Collider other)
    {
        // Tell the enemy that they're frozen and by a certain value

        enemy = other.GetComponent <WaypointEnemy>();
        // If it is indeed an enemy
        if (enemy)
        {
            enemy.TakeDamage(damage);
            frozeness += 0.1f;
        }
        if (frozeness >= 2f)
        {
            StartCoroutine("Freeze");
        }
    }