Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        Blackout blackout = FindObjectOfType <Blackout>();

        if (blackout)
        {
            blackout.FadeTo(Color.black, 0.0f);

            Color c = Color.black;
            c.a = 0.0f;
            blackout.FadeTo(c, 1.0f);
        }
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Blackout blackout = FindObjectOfType <Blackout>();

        if (blackout)
        {
            blackout.FadeTo(Color.black, 0.0f);

            Color c = Color.black;
            c.a = 0.0f;
            blackout.FadeTo(c, 1.0f);
        }

        m_gates    = new List <PackageGateController>();
        m_spawners = new List <PackageSpawnerController>();
        m_packages = new List <PackageController>();

        PackageGateController[] gates = FindObjectsOfType <PackageGateController>();
        foreach (PackageGateController gate in gates)
        {
            m_gates.Add(gate);
            gate.OnValidPackage     += OnValidPackage;
            gate.OnInvalidPackage   += OnInvalidPackage;
            gate.OnObjectiveExpired += OnObjectiveExpired;
        }

        PackageSpawnerController[] spawners = FindObjectsOfType <PackageSpawnerController>();
        foreach (PackageSpawnerController spawner in spawners)
        {
            m_spawners.Add(spawner);
            spawner.OnPackageSpawned += OnPackageSpawned;
        }

        PackageController[] packages = FindObjectsOfType <PackageController>();
        foreach (PackageController package in packages)
        {
            m_packages.Add(package);
        }
    }
Exemplo n.º 3
0
    IEnumerator LeaveLevelSequence()
    {
        Blackout blackout = FindObjectOfType <Blackout>();

        if (blackout)
        {
            blackout.FadeTo(Color.black, fadeOutTime);
        }
        yield return(new WaitForSeconds(fadeOutTime));

        if (exitGame)
        {
            Application.Quit();
        }
        else
        {
            SceneManager.LoadScene(targetSceneName);
        }
    }