示例#1
0
    void Update()
    {
        SetType();

        // If the current type does not equal to the updated(upgrade) type
        if (current != upgrade)
        {
            // Upgrade health and change current type to the new upgrade type
            health  = (int)upgrade;
            current = upgrade;
        }

        if (health <= 0)
        {
            // Need explosion (temp destroy gameobject)
            Destroy(gameObject, 5f);
            Application.LoadLevel("EndScene");          // Obselete in 5.3
        }
    }
    void Update()
    {
        SetType();

        // If the current type does not equal to the updated(upgrade) type
        if (current != upgrade)
        {
            // Upgrade health and change current type to the new upgrade type
            health = (int)upgrade;
            current = upgrade;
        }

        if (health <= 0)
        {
            // Need explosion (temp destroy gameobject)
            Destroy(gameObject, 5f);
            Application.LoadLevel("EndScene");          // Obselete in 5.3
        }
    }