示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        audioSource = GetComponent <AudioSource>();


        shur = FindObjectOfType <shuriken>();
        dest = FindObjectOfType <destroyer>();
    }
示例#2
0
    void Shoot()
    {
        GameObject bulletGO      = (GameObject)Instantiate(bullet_prefab, spawn_point.position, spawn_point.rotation);
        shuriken   bullet_script = bulletGO.GetComponent <shuriken>();

        if (bullet_script != null)
        {
            bullet_script.Chase(target);
        }
    }