Esempio n. 1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (canLaunchShip)
     {
         FadeToBlack.LoadScene(sceneName);
     }
 }
Esempio n. 2
0
    void Awake()
    {
        lev_con = FindObjectOfType <LevelController>();
        fade    = FindObjectOfType <FadeToBlack>();

        switch (lev_con.current_level)
        {
        case 1:
            current_rooms = level_1_rooms;
            break;

        case 2:
            current_rooms = level_2_rooms;
            break;

        case 3:
            current_rooms = level_3_rooms;
            break;

        case 4:
            FindObjectOfType <MusicController>().PlayBossLaugh();
            current_rooms = boss_rooms;
            break;
        }

        SpawnRooms();
    }
    public void OnClick()
    {
        GameObject  transitionobject = Instantiate(Transition);
        FadeToBlack fadecontroller   = transitionobject.GetComponent <FadeToBlack>();

        fadecontroller.Next_Scene = First_Scene;
    }
Esempio n. 4
0
    /// <summary>
    /// Reset the fade delay and grab the fader
    /// </summary>
    /// <param name="ai">The AI executing this action</param>
    public override void Start(AI ai)
    {
        base.Start(ai);

        fader = ai.Body.GetComponentInChildren<FadeToBlack>();
        fadeDelay = 5f;
    }
Esempio n. 5
0
    void Awake()
    {
        audioController = GameObject.Find("AudioController").GetComponent <AudioController>();

        spriteRenderer = GetComponent <SpriteRenderer>();
        rb             = GetComponent <Rigidbody2D>();
        fadeToBlack    = GetComponent <FadeToBlack>();
    }
Esempio n. 6
0
 void Start()
 {
     game_                 = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>();
     player_               = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
     animator_             = GetComponent <Animator>();
     fadeToBlack_          = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>();
     cantFinishReasonText_ = GameObject.FindGameObjectWithTag("CantFinishTextUI").GetComponent <CantFinishReasonText>();
 }
Esempio n. 7
0
    public static FadeToBlack Instance()
    {
        if (instance == null)
        {
            instance = GameObject.FindObjectOfType <FadeToBlack>();
        }

        return(instance);
    }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 9
0
    private void Start()
    {
        _fader = this.GetComponent <FadeToBlack>();
        if (_fader == null)
        {
            Debug.LogError(this.gameObject.name + " is missing its FadeToBlack component for fading the screen to black");
        }

        _audioPlayer = this.GetComponent <AudioSource>();
        if (_audioPlayer == null)
        {
            Debug.LogError(this.gameObject.name + " is missing its AudioSource for playing the main music");
        }
    }
Esempio n. 10
0
 // Start is called before the first frame update
 void Awake()
 {
     if (!player)
     {
         player = FindObjectOfType <Player>();
     }
     if (!camera)
     {
         camera = Camera.main;
     }
     if (!fadeToBlack)
     {
         fadeToBlack = GetComponent <FadeToBlack>();
     }
 }
        private System.Threading.Tasks.Task FadeToBlackAsync()
        {
            CallFadeOut.Visibility = Visibility.Visible;
            var tcs = new System.Threading.Tasks.TaskCompletionSource <object>();
            EventHandler <object> completed = null;

            completed = (o, e) =>
            {
                FadeToBlack.Completed -= completed;
                tcs.SetResult(null);
            };
            FadeToBlack.Completed += completed;
            FadeToBlack.Begin();
            return(tcs.Task);
        }
Esempio n. 12
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(Glob.RightButton))
     {
         GameInitializer.HardModeEnabled = true;
         FadeToBlack.DoFade(1, true, 1);
         //Application.LoadLevel(1);
     }
     else if (Input.GetKeyDown(Glob.LeftButton))
     {
         GameInitializer.HardModeEnabled = false;
         FadeToBlack.DoFade(1, true, 1);
         //Application.LoadLevel(1);
     }
 }
Esempio n. 13
0
    private void StartInterstitial(int level)
    {
        GameObject g = null;

        // Debug.Log(level);
        switch (level)
        {
        case 1:
            // gameObject.GetComponent<AudioSource>().Stop();
            g = Resources.Load("Interstitials/Tutorial", typeof(GameObject)) as GameObject;
            break;

        case 2:
            g = Resources.Load("Interstitials/Denial", typeof(GameObject)) as GameObject;
            break;

        case 3:
            g = Resources.Load("Interstitials/Anger", typeof(GameObject)) as GameObject;
            break;

        case 4:
            g = Resources.Load("Interstitials/Bargaining", typeof(GameObject)) as GameObject;
            break;

        case 5:
            g = Resources.Load("Interstitials/Depression", typeof(GameObject)) as GameObject;
            break;

        case 6:
            // g = Resources.Load("Interstitials/Acceptance", typeof(GameObject)) as GameObject;
            break;

        default:
            Debug.Log("The interstitial loader has failed to load the proper level");
            break;
        }
        if (g != null)
        {
            GameObject interstitial = Instantiate(g) as GameObject;
            popupOpen = true;
        }
        else
        {
            FadeToBlack.Instance().FadeOut();
        }
    }
Esempio n. 14
0
    void Awake()
    {
        game_        = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>();
        fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>();
        reminder_    = GameObject.FindGameObjectWithTag("Reminder");
        reminder_.SetActive(false);

        direction_         = Direction.kRight;
        rigidBody_         = GetComponent <Rigidbody2D>();
        typeWriter_        = GetComponent <TypeWriter>();
        lockedOn_          = null;
        alive_             = true;
        isCarrying         = false;
        wobbleTimer_       = 0.0f;
        prevGrounded_      = false;
        baseHingePosition_ = 0.0f;
        audioSources_      = GetComponents <AudioSource>();
    }
Esempio n. 15
0
    void Start()
    {
        typeWriter_ = GetComponent <TypeWriter>();
        typeWriter_.RegisterWord("start", WordListener);
        typeWriter_.RegisterWord("select", WordListener);
        typeWriter_.RegisterWord("menu", WordListener);
        typeWriter_.RegisterWord("tutorial1", WordListener);
        typeWriter_.RegisterWord("tutorial2", WordListener);
        typeWriter_.RegisterWord("tutorial3", WordListener);
        typeWriter_.RegisterWord("tutorial4", WordListener);
        typeWriter_.RegisterWord("tutorial5", WordListener);
        typeWriter_.RegisterWord("tutorial6", WordListener);
        typeWriter_.RegisterWord("level1", WordListener);
        typeWriter_.RegisterWord("level2", WordListener);
        typeWriter_.RegisterWord("level3", WordListener);

        fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>();
    }
Esempio n. 16
0
    // Use this for initialization
    void Start()
    {
        startTime = Time.time;
        PlayerPrefs.SetString(PlayerPrefKeys.LAST_LEVEL, UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
        player = FindObjectOfType <Drive>();
        snaps  = new List <SnapShot>();
        FadeToBlack ftb = FindObjectOfType <FadeToBlack>();

        if (ftb)
        {
            ftb.UnFade();
        }

        if (checkPoints > TagManager.CHECKPOINTS.Length)
        {
            Debug.LogError("You are trying to use more checkpoints than created, please create more checkpoint objects and tags");
        }

        checkpointsCrossed = new bool[checkPoints];
        checkpointObjects  = new GameObject[checkPoints];
        for (int index = 0; index < checkPoints; ++index)
        {
            checkpointsCrossed[index] = false;
            checkpointObjects[index]  = GameObject.FindGameObjectWithTag(TagManager.CHECKPOINTS[index]);
        }

        stars = new GameObject[TagManager.STARS.Length];
        for (int index = 0; index < stars.Length; ++index)
        {
            stars[index] = GameObject.FindGameObjectWithTag(TagManager.STARS[index]);
        }

        GameObject[] mushHaveInViewObjects = new GameObject[mustHaveInViewCheckpoints];
        for (int index = 0; index < mustHaveInViewCheckpoints; ++index)
        {
            mushHaveInViewObjects[index] = checkpointObjects[index];
        }

        cameraControl.mustHaveInView = mushHaveInViewObjects;
    }
Esempio n. 17
0
    private IEnumerator ReadDialog()
    {
        yield return(null);

        FadeToBlack.LoadScene(sceneName);
    }
Esempio n. 18
0
 // Start is called before the first frame update
 void Start()
 {
     gsm        = FindObjectOfType <GameStatusManager>();
     ftb        = FindObjectOfType <FadeToBlack>();
     clockImage = GameObject.Find("ClockImage").GetComponent <Image>();
 }
Esempio n. 19
0
 // Start is called before the first frame update
 void Start()
 {
     player = GameObject.Find("Player").GetComponent <Player>();
     ftb    = GameObject.Find("FadeToBlack").GetComponent <FadeToBlack>();
 }
Esempio n. 20
0
 private void Awake()
 {
     Instance = this;
 }
Esempio n. 21
0
 public static void ResetGame()
 {
     FadeToBlack.DoFade(1, true, 0);
 }
Esempio n. 22
0
 private void Awake()
 {
     ftb = FindObjectOfType <FadeToBlack>();
 }
Esempio n. 23
0
 private void Start()
 {
     singleton     = this;
     image.enabled = false;
 }
Esempio n. 24
0
 void Awake()
 {
     fade = FindObjectOfType <FadeToBlack>();
 }
Esempio n. 25
0
 void Awake()
 {
     Instance = this;
 }
Esempio n. 26
0
 private void Awake()
 {
     Instance    = this;
     canvasGroup = GetComponent <CanvasGroup> ();
 }
Esempio n. 27
0
 private void LoadScene()
 {
     FadeToBlack.LoadScene(sceneName);
 }
Esempio n. 28
0
 private void OnEnable()
 {
     FadeToBlack.LoadScene(sceneName);
 }
Esempio n. 29
0
 public void LoadScene()
 {
     FadeToBlack.LoadScene(sceneName);
 }