Esempio n. 1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (freestyle_mode)
            {
                // Cleanup for transition from freestyle mode to customization mode.
                SetStarVisibilityForAllLaunchers(false);
                GameObject launcher_go = launchers[curr_launcher_index];
                if (launcher_go.GetComponent(typeof(CustomizationSceneLauncher)))
                {
                    CustomizationSceneLauncher launcher_script = ( CustomizationSceneLauncher )launcher_go.GetComponent(typeof(CustomizationSceneLauncher));
                    launcher_script.PlayParticleSystem();
                }
            }
            else
            {
                // Cleanup for transition from customization mode to freestyle mode.
                StopAllLaunchers();
                SetStarVisibilityForAllLaunchers(true);
            }

            freestyle_mode = !freestyle_mode;
        }

        if (freestyle_mode)
        {
            DetectFreestyleModeInput();
        }
        else
        {
            DetectCustomizationModeInput();
        }
    }
Esempio n. 2
0
    private void UpdateFireworkLaunchers()
    {
        curr_particle_index = launcher_particle_correspondences[curr_launcher_index];

        GameObject launcher_go = launchers[prev_launcher_index];

        if (launcher_go.GetComponent(typeof(CustomizationSceneLauncher)))
        {
            CustomizationSceneLauncher launcher_script = ( CustomizationSceneLauncher )launcher_go.GetComponent(typeof(CustomizationSceneLauncher));
            launcher_script.StopParticleSystem();
        }

        launcher_go = launchers[curr_launcher_index];
        if (launcher_go.GetComponent(typeof(CustomizationSceneLauncher)))
        {
            CustomizationSceneLauncher launcher_script = ( CustomizationSceneLauncher )launcher_go.GetComponent(typeof(CustomizationSceneLauncher));
            launcher_script.PlayParticleSystem();
        }
    }
Esempio n. 3
0
    void Start()
    {
        curr_particle_index = 0;
        prev_launcher_index = 0;
        curr_launcher_index = 0;
        launcher_particle_correspondences = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
        freestyle_mode = false;

        InitializeFireworkLaunchers();

        // Set launcher #5 of 8 to be on at startup.
        curr_launcher_index = 4;
        GameObject launcher_go = launchers[curr_launcher_index];

        if (launcher_go.GetComponent(typeof(CustomizationSceneLauncher)))
        {
            CustomizationSceneLauncher launcher_script = ( CustomizationSceneLauncher )launcher_go.GetComponent(typeof(CustomizationSceneLauncher));
            launcher_script.PlayParticleSystem();
        }
    }