Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        Fader.Fade("from black", 2.0f);
        MusicController.Current.SetVolume(0.25f);

        Invoke("FadeToNextLevel", 8.0f);
    }
Ejemplo n.º 2
0
 void Start()
 {
     DisableButton();
     Fader.Fade("to black", 0.0f);
     MusicController.Current.Play(Music, "landing menu");
     Invoke("FadeIn", 4.0f);
 }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        Fader.Fade("from black", 2.0f);
        MusicController.Current.Play(Music, "level 1");

        MainCamera.enabled     = false;
        CutsceneCamera.enabled = true;

        DialogueCount = 0;
        Dialogue.Play("Dialogue/l2d1", this);
    }
 void Awake()
 {
     if (global == null)
     {
         global          = this;
         fadeHandler     = transform.Find("Fade").GetComponent <ScreenFade>();
         mapHandler      = transform.Find("Map").GetComponent <MapHandler>();
         pauseHandler    = transform.Find("Pause").gameObject;
         settingsHandler = transform.Find("Settings").GetComponent <SettingsHandler>();
         copyright       = transform.Find("Text").GetComponent <TextMeshProUGUI>();
         joystick        = transform.Find("GameButtons").Find("Left Joystick").GetComponent <LeftJoystick>();
         bgmHandler      = GetComponent <BgmHandler>();
         #if UNITY_ANDROID
         Debug.Log("Android");
         #else
         joystick.gameObject.SetActive(false);
         transform.Find("GameButtons").Find("Jump").gameObject.SetActive(false);
         #endif
         if (!isIntro)
         {
             digitalGlitch    = GameObject.FindWithTag("MainCamera").GetComponent <DigitalGlitch>();
             analogGlitch     = GameObject.FindWithTag("MainCamera").GetComponent <AnalogGlitch>();
             postProcessing   = GameObject.FindWithTag("Post Processing").GetComponent <PostProcessVolume>();
             postProcessLayer = GameObject.FindWithTag("MainCamera").GetComponent <PostProcessLayer>();
         }
         if (SceneManager.GetActiveScene().name != "title")
         {
             StartCoroutine(fadeHandler.Fade(true, 0.5f));
             if (busy)
             {
                 StartCoroutine(FadeAndUnbusy());
             }
         }
     }
 }
    private IEnumerator KickDoor()
    {
        ScreenFade.Fade();
        actualDoor.Animator.SetTrigger("Open");

        Player.CanMove = false;

        yield return(new WaitForSeconds(1f));

        actualDoor.EnterDoor();
        actualDoor.IsOpen = true;

        var doorTransform = actualDoor.OtherDoor.transform;

        Player.Velocity = Vector3.zero;

        transform.position = doorTransform.position;

        if (Player.CiviliansFollowing.Count > 0)
        {
            foreach (var civilian in Player.CiviliansFollowing)
            {
                civilian.transform.position = transform.position;
            }
        }

        Player.CanMove = true;
    }
Ejemplo n.º 6
0
 public void BecameZero(HitPoints hp)
 {
     StateManager.SetState(State.Dying);
     Fader.Fade("to black", 3.0f);
     MusicController.Current.Fade(1.0f, 0.0f, 1.0f);
     Invoke("GameOverScreen", TimeToDie);
 }
Ejemplo n.º 7
0
/***************************************************************************************************/
// Initialization code
/***************************************************************************************************/
    void Start()
    {
        // display the particle effect behind the logo and character
        Instantiate(particleEffect, new Vector3(transform.position.x, transform.position.y, -0.09f), transform.rotation);
        // PixelPlacement.com --> screen fader script
        ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 1, 2f, 1, false);
    }
Ejemplo n.º 8
0
 public void TakeDamage(float attack)
 {
     PlaySoundEffect(hurtNoise);
     // Flash the screen red for a moment to indicate the player has been hurt
     ScreenFade.Fade(Color.red, .6f, 0, .35f, 0, true);
     Global.remainingHealth = Global.remainingHealth - attack;
     healthBar.UpdateBar(Global.remainingHealth, Global.health);
 }
Ejemplo n.º 9
0
    IEnumerator fade()
    {
        ScreenFade.Fade(Color.white, 0f, 1f, 2f, 0f, true);
        yield return(new WaitForSeconds(2f));

        transform.position = startLocation;
        ScreenFade.Fade(Color.white, 1f, 0f, 2f, 0f, false);
    }
    public IEnumerator CR_RepeatFade()
    {
        for (int i = 0; i < numScreenFades; i++)
        {
            yield return(new WaitUntil(() => !screenFade.isFading));

            screenFade.Fade();
        }
    }
 void DrawCameraFlashButton()
 {
     if (GUILayout.Button("Flash/Lightning"))
     {
         fadeDirection   = false;
         currentFadeType = FadeType.Flash;
         ScreenFade.Fade(Color.white, 1, 0, .5f, 0, true);
         PlaySound(cameraShutterSound, 0);
     }
 }
Ejemplo n.º 12
0
 public void ButtonPressed(string button)
 {
     if (button == "positive")
     {
         StateManager.SetState(State.LoadingLevel);
         MusicController.Current.SetVolume(0.25f);
         Fader.Fade("to black", 2.0f);
         Invoke("NextLevel", 3.0f);
     }
 }
Ejemplo n.º 13
0
 public void ButtonPressed(string button)
 {
     if (button == "positive")
     {
         StateManager.SetState(State.LoadingLevel);
         Fader.Fade("to black", 4.0f);
         MusicController.Current.Fade(0.25f, 0.0f, 4.0f);
         Invoke("EndOfGameScene", 5.5f);
     }
 }
 void DrawInjuryButton()
 {
     if (GUILayout.Button("Injury"))
     {
         fadeDirection   = false;
         currentFadeType = FadeType.Injury;
         ScreenFade.Fade(Color.red, .6f, 0, .35f, 0, true);
         cachedAudioSource.pitch = Random.Range(.99f, 1.1f);
         PlaySound(injurySound, .1f);
     }
 }
Ejemplo n.º 15
0
    // Use this for initialization
    public void LoadScene()
    {
        // If the current scene is the Main Menu, the game autosaves.
        if (SceneManager.GetActiveScene().name == "Main Menu")
        {
            //MenuControl.Instance.SaveGame();

            screenFade.gameObject.SetActive(true);
        }
        screenFade.Fade(fadeIn);
        Invoke("Load", screenFade.fadeTime);
    }
Ejemplo n.º 16
0
/***************************************************************************************************/
// Update is called once per frame
/***************************************************************************************************/
    void Update()
    {
        // test if the current if it is current time + 3 seconds
        currentTime = Time.fixedTime;

        // three seconds have elapsed so start the fade routine
        if (currentTime >= delayTime)
        {
            ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 0, 0.4f, 0, false);
            delayTime = 10000f;
        }
    }
    /**
     * Fades the screen in or out depending on input boolean.
     *
     * @param fadeIn - whether to fade the game in or out
     * @param delay - the delay time of the fade in seconds
     */
    public void Fade(bool fadeIn, float delay)
    {
        currentFadeType = FadeType.Fade;

        //fade up or down based on state of fadeDirection:
        if (fadeIn)
        {
            ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 0, delay, 0, false);
        }
        else
        {
            ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 1, delay, 0, false);
        }
    }
    //-----------------------------------------------------------------------------
    // OnGUI
    //-----------------------------------------------------------------------------

//	void OnGUI(){
//		//draw buttons:
//		DrawFadeButton();
//		DrawCameraFlashButton();
//		DrawInjuryButton();
//	}

    //-----------------------------------------------------------------------------
    // Private Methods
    //-----------------------------------------------------------------------------

    void DrawFadeButton()
    {
        //decide text to display on the button based on state of fadeDirection:
        string fadeText = fadeDirection ? "down" : "up";

        if (GUILayout.Button("Fade " + fadeText))
        {
            //set type of fadeDirection:
            currentFadeType = FadeType.Fade;

            //toggle state of fadeDirection:
            fadeDirection = !fadeDirection;

            //fade up or down based on state of fadeDirection:
            if (fadeDirection)
            {
                ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 1, 1, 0, false);
            }
            else
            {
                ScreenFade.Fade(Color.black, ScreenFade.CurrentAlpha, 0, 1, 0, false);
            }
        }
    }
Ejemplo n.º 19
0
 /// <summary>Fades the screen to the given colour in the given amount of time.</summary>
 public Promise fade(UnityEngine.Color col, float time)
 {
     return(ScreenFade.Fade(this, col, time));
 }
Ejemplo n.º 20
0
 public void Start()
 {
     Fader.Fade("from black", 1.0f);
     MusicController.Current.Play(Music, "game over");
 }
Ejemplo n.º 21
0
 // Use this for initialization
 public void LoadScene()
 {
     screenFade.gameObject.SetActive(true);
     screenFade.Fade(fadeIn);
     Invoke("Load", screenFade.fadeTime);
 }
 public void Fade(string scene)
 {
     StartCoroutine(fadeHandler.Fade(false, 0.5f));
     StartCoroutine(FadeAndLoad(scene));
 }
Ejemplo n.º 23
0
 void Start()
 {
     MusicController.Current.Play(Music, "main menu");
     Fader.Fade("from black", 2.0f);
 }
Ejemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     Fader.Fade("from black", 2.0f);
     MusicController.Current.Play(Music, "level 1");
     Dialogue.Play("Dialogue/l1d1", this);
 }
Ejemplo n.º 25
0
 void Start()
 {
     Fader.Fade("from black", 3.0f);
     Invoke("PlayMusic", 3.0f);
 }