Ejemplo n.º 1
0
    private void Spawn()
    {
        if (gameObject.tag == "Boss")
        {
            GameObject    tmpGUIController      = GameObject.Find("GUIController");
            GUIController tmpGUIControllerScipt = tmpGUIController.GetComponent <GUIController> ();

            GameObject tmpBossIcon = GameObject.Find("BossIcon");
            if (tmpBossIcon.guiTexture.enabled == false)
            {
                tmpBossIcon.guiTexture.enabled = true;
            }



            HealthScript tmpHealthScriptScipt = gameObject.GetComponent <HealthScript> ();
            tmpHealthScriptScipt.ActiveHeartBar();



            //HealthScript tmpHealthScript = gameObject.GetComponent<HealthScript> () as HealthScript;
            //tmpHealthScript.ActiveHeartBar();
        }
        hasSpawn           = true;
        collider2D.enabled = true;
        moveScript.enabled = true;
        //mỗi vật thể có thể có nhiều wepon, mỗi wepond sẽ có 1 hướng đạn bay + loại đạn
        //trong mỗi loại đạn sẽ có Dame riêng + của ai dùng
        foreach (WeaponScript weapon in weapons)
        {
            weapon.enabled = true;
        }
        //khi Boss được sinh ra,
        foreach (ScrollingScript scrolling in FindObjectsOfType <ScrollingScript>())
        {
            if (scrolling.isLinkedToCamera)
            {
                scrolling.speed = Vector2.zero;
            }
        }
    }