示例#1
0
    void Shoot()
    {
        GameObject magicGo   = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
        MagicShot  magicShot = magicGo.GetComponent <MagicShot>();

        if (magicShot != null)
        {
            magicShot.Seek(target);
        }
    }
    void Shoot()
    {
        GameObject magicGo   = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
        MagicShot  magicShot = magicGo.GetComponent <MagicShot>();

        targetEnemy.TakeDamage(damageOverTime * Time.deltaTime);
        targetEnemy.Slow(slowAmount);

        if (magicShot != null)
        {
            magicShot.Seek(target);
        }
    }
示例#3
0
    public void FireStick()
    {
        GameObject shotInstance = (GameObject)Instantiate(MagicShotPrefab);
        MagicShot  shot         = shotInstance.GetComponent <MagicShot>();

        shot.Source = this.gameObject;
        shotInstance.transform.position = new Vector3(this.transform.position.x + MagicShotPositionOffsetFromPlayer.x, this.transform.position.y + MagicShotPositionOffsetFromPlayer.y, this.transform.position.z);

        if (m_FacingRight)
        {
            shot.MoveVector = new Vector3(-MagicShotSpeed, 0, 0);
        }
        else
        {
            shot.MoveVector = new Vector3(MagicShotSpeed, 0, 0);
        }
    }