示例#1
0
    public void Destruction()
    {
        float       scaleBy  = 1.0f;
        PlayerDrive pdScript = GetComponent <PlayerDrive>();

        if (pdScript)
        {
            scaleBy = pdScript.shipScale;
        }
        EnemyDrive edScript = GetComponent <EnemyDrive>();

        if (edScript)
        {
            scaleBy = edScript.shipScale;
        }

        GameObject effectGO = GameObject.Instantiate(deathEffectGO, transform.position, Quaternion.identity);

        effectGO.transform.localScale *= scaleBy;
        if (GetComponentInChildren <Camera>() != null)
        {
            Camera.main.transform.SetParent(null);
        }
        Destroy(gameObject);
    }
示例#2
0
 void ResetStaticsAndLoadScene(int sceneIndex)
 {
     EnemyDrive.ResetStatics();
     HoverCraftBase.ResetStatic();
     SceneManager.LoadScene(sceneIndex);
 }