Inheritance: MonoBehaviour
    // Use this for initialization
    void Start()
    {
        if (GameObject.Find("Player") != null)
        {
            playerController = GameObject.Find("Player").GetComponent <PlayerController> ();
        }

        if (!LastScene)
        {
            fader = GameObject.Find("Cover").GetComponent <SceneFader> ();
        }

        if (LastScene)
        {
            eFader = FindObjectOfType <EndFader> ();
        }


        if (textFile != null)
        {
            textLines = (textFile.text.Split('\n'));
        }

        if (endAtLine == 0)
        {
            endAtLine = textLines.Length - 1;
        }

        isTalking = true;
        useFader  = true;
    }
Exemple #2
0
    // Use this for initialization
    void Awake()
    {
        fader = FindObjectOfType <SceneFader>();

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Exemple #3
0
    private void OnClickDeleteButton()
    {
        // Get current character data.
        CharacterDataHolder characterData = PlayerManager.instance.selectedCharacterData;

        // Return if no character is selected.
        if (characterData == null)
        {
            return;
        }

        // Disable buttons.
        createButton.enabled     = false;
        deleteButton.enabled     = false;
        enterWorldButton.enabled = false;
        exitButton.enabled       = false;

        // Set text message to deleting character.
        textMessage.text = "Deleting character " + characterData.GetName() + "...";

        // Request info.
        waitingServer = true;
        NetworkManager.instance.ChannelSend(new CharacterDeletionRequest(characterData.GetSlot()));

        // Wait until server deletes the character.
        while (waitingServer)
        {
            // Make sure server has deleted the character.
        }

        // Reload everything.
        Destroy(characterSelected); // Destroy clone object.
        SceneFader.Fade("CharacterSelection", Color.white, 0.5f);
    }
Exemple #4
0
    public void BackButton()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("MenuScene", SceneMoveType.Short);
    }
	/*hecki97
	public Joystick joystickPauseGame;
	public bool inputPauseGamePressed = false;*/

	void Awake()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
		butRect = new Rect((Screen.width - ctrlWidth)/2,0,ctrlWidth, ctrlHeight);

        flags = GameObject.FindGameObjectsWithTag("flag");
	}
Exemple #6
0
    IEnumerator TutorialStart()
    {
        isTutorialEnd    = false;
        touchIntervalEnd = false;
        spriteIndex      = 0;
        SceneFader.GetInstance().FadeOut();
        yield return(new WaitForSeconds(1));

        SceneFader.GetInstance().FadeIn();
        tutorialImage.sprite = null;
        tutorialImage.gameObject.SetActive(true);
        if (languageMgr == null)
        {
            languageMgr = GameObject.FindObjectOfType <LanguageManager>();
        }
        if (languageMgr.currLanguage == Language.Korean)
        {
            tutorialImage.sprite = korSprites[0];
        }
        else
        {
            tutorialImage.sprite = engSprites[0];
        }
        StartCoroutine(TouchInterval());
    }
	// Use this for initialization
	void Awake () {
		butRect = new Rect((Screen.width - ctrlWidth)/2,0,ctrlWidth, ctrlHeight);
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
		playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent<HealthController>();
		timer = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
		item = GameObject.FindGameObjectWithTag("GameController").GetComponent<Item>();
	}
    // Use this for initialization
    void Start()
    {
        scene = FindObjectOfType <SceneFader> ();

        rb          = gameObject.GetComponent <Rigidbody2D> ();
        rb.velocity = new Vector2(-Speed, 0);

        float spawnRan = Random.Range(5f, 7f);

        if (RespawnTimer == 0)
        {
            RespawnTimer = spawnRan;
        }

        if (DeathTimer == 0)
        {
            DeathTimer = 60;
        }

        if (Respawns)
        {
            Invoke("Respawn", RespawnTimer);
        }

        Destroy(gameObject, DeathTimer);
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        // Cursor.visible = false;
        sceneFader = GetComponent<SceneFader>();
        InitLevelData();

        // Initiate all fonts and styles for GUI objects
        guiStyle = new GUIStyle();
        guiStyle.font = guiFont;
        guiStyle.fontSize = 40;
        guiStyle.normal.textColor = Color.yellow;
        guiStyle.alignment = TextAnchor.MiddleCenter;

        TimerText.text = FormatTimeString((timeLimit - elapsedTime));
        ScoreText.text = LEVEL_DATA.SCORE.ToString();

        amountOfTargets = FindObjectsOfType<Spawner>().Length;

        StartCoroutine(CountdownSequence(0.5f));

        sfxSource = GameObject.FindWithTag("SFX_Source").GetComponent<AudioSource>();
        musicSource = GameObject.FindWithTag("Music_Source").GetComponent<AudioSource>();

        // Time.timeScale = 0.5f;
        // audioSource.pitch = Time.timeScale;

        DisablePowerup();

    }
Exemple #10
0
    public void ToTitleScene()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("TitleScene", SceneMoveType.Short);
    }
Exemple #11
0
    void Awake()
    {
        Instance = this;

        // StartFadeOut
        StartFading(SceneFadeType.FadeOut, null);
    }
Exemple #12
0
    public void ToMainMode()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(2);

        SceneFader.MoveToScene("Game", SceneMoveType.Long);
    }
Exemple #13
0
    public void ToRanking()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("RankingScene", SceneMoveType.Short);
    }
Exemple #14
0
    public static void Create()
    {
        SceneFader controllerPrefab = Resources.Load <SceneFader>("ScreenFader");

        Debug.Log(controllerPrefab);
        s_Instance = Instantiate(controllerPrefab);
    }
Exemple #15
0
 private void Awake()
 {
     if (instance = null)
     {
         instance = this;
     }
 }
Exemple #16
0
    public void RetryButton()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("Game", SceneMoveType.Short);
    }
 public static void notify(ReceivablePacket packet)
 {
     // Used for kicked message.
     NetworkManager.instance.kicked = true;
     // Go to login screen.
     SceneFader.Fade("LoginScreen", Color.white, 0.5f);
 }
    // Use this for initialization
    void Start()
    {
        scene = FindObjectOfType <SceneFader> ();

//		player = GameObject.Find ("Player").GetComponent<Transform> ();
//		InvokeRepeating ("SBird", BirdSpawnRate, BirdSpawnRate);
    }
 void Awake()
 {
     sceneFader = FindObjectOfType <SceneFader>();
     ui         = FindObjectOfType <PauseMenu>().transform.GetChild(0).gameObject;
     settings   = FindObjectOfType <SettingsMenu>(true).gameObject;
     paused     = false;
 }
Exemple #20
0
    // Use this for initialization
    void Start()
    {
        // Cursor.visible = false;
        sceneFader = GetComponent <SceneFader>();
        InitLevelData();

        // Initiate all fonts and styles for GUI objects
        guiStyle                  = new GUIStyle();
        guiStyle.font             = guiFont;
        guiStyle.fontSize         = 40;
        guiStyle.normal.textColor = Color.yellow;
        guiStyle.alignment        = TextAnchor.MiddleCenter;

        TimerText.text = FormatTimeString((timeLimit - elapsedTime));
        ScoreText.text = LEVEL_DATA.SCORE.ToString();

        amountOfTargets = FindObjectsOfType <Spawner>().Length;

        StartCoroutine(CountdownSequence(0.5f));

        sfxSource   = GameObject.FindWithTag("SFX_Source").GetComponent <AudioSource>();
        musicSource = GameObject.FindWithTag("Music_Source").GetComponent <AudioSource>();

        // Time.timeScale = 0.5f;
        // audioSource.pitch = Time.timeScale;

        DisablePowerup();
    }
Exemple #21
0
 private void _MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemple #22
0
    public IEnumerator Transition(string newSceneName, BirthPointType birthPoint)
    {
        var options = SceneManager.LoadSceneAsync(newSceneName);

        options.allowSceneActivation = false;
        while (!options.isDone)
        {
            if (options.progress >= 0.9f)
            {
                options.allowSceneActivation = true;
            }

            if (!m_IsTransitioning)
            {
                m_IsTransitioning = true;
                yield return(Instance.StartCoroutine(SceneFader.FadeSceneIn(SceneFader.FadeType.Loading)));
            }
            else
            {
                yield return(null);
            }
        }

        Player.Instance.Redirect(birthPoint);

        yield return(StartCoroutine(SceneFader.FadeSceneOut()));

        m_IsTransitioning = false;
    }
	void MakeSingleton(){
		if(instance != null){
			Destroy (gameObject);
		} else {
			instance = this;
			DontDestroyOnLoad (gameObject);
		}
	}
 public void Restart(bool fullReset = true)
 {
     if (fullReset)
     {
         LevelProgressManager.Reset();
     }
     SceneFader.FadeToScene(SceneManager.GetActiveScene().buildIndex, Color.black);
 }
    // ------------------------------------------------------------------------

    void Awake()
    {
        gameCamera       = GameObject.Find("GameCam");
        cameraController = GameObject.Find("Controller").GetComponent <CameraController>();
        gui        = GameObject.Find("Controller").GetComponent <GUINotification>();
        sceneFader = SceneFader.create();
        sceneFader.startScene();
    }
    void Awake()
    {
        playerMovement = FindObjectOfType(typeof(CharacterMovement)) as CharacterMovement;
        fadeScene      = GetComponent <SceneFader>();

        //setting players starting health
        currentHealth = maxHealth;
    }
Exemple #27
0
	void MakeSingleton () {
		if (instance != null) {
			Destroy (gameObject);
		} else {
			instance = this;
			DontDestroyOnLoad (gameObject);
		}
	}
Exemple #28
0
 void Start()
 {
     sceneFaderScript = sceneFader.GetComponent <SceneFader>();
     if (sceneFader == null)
     {
         sceneFader = GameObject.Find("FadeCanvas");
     }
 }
 private void Awake()
 {
     if (!Instance || Instance != this)
     {
         Destroy(Instance);
         Instance = this;
     }
 }
Exemple #30
0
    // ---------------------------------


    void Start()
    {
        InitializeGamecenter();
        SetGameVersion();
        SetVolume();

        sceneFader = GameObject.FindWithTag("Cover").GetComponent <SceneFader>();
    }
Exemple #31
0
    // Use this for initialization
    void Awake()
    {
        CheckGameControllerExists();

        if (sceneFader == null)
        {
            sceneFader = GameObject.FindWithTag("SceneFader").GetComponent <SceneFader>();
        }
    }
Exemple #32
0
    void Awake()
    {
        sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
        butRect = new Rect((Screen.width - ctrlWidth)/2,0,ctrlWidth, ctrlHeight);

        bgMusic = GameObject.FindGameObjectWithTag("GameController").GetComponent<AudioSource>();

        blurEffect = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<BlurEffect>();
    }
Exemple #33
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }

        Instance = this;
    }
Exemple #34
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         SceneFader fader = GameObject.FindObjectOfType <SceneFader>();
         PlayerPrefs.SetInt("score", GameManager.score);
         fader.FadeScene(nextLevel);
     }
 }
Exemple #35
0
    private void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        StartCoroutine(FadeIn());
    }
	void Awake()
	{
		bgMusic = GameObject.FindGameObjectWithTag("GameController").GetComponent<AudioSource>();
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
		butRect = new Rect((Screen.width - ctrlWidth)/2,0,ctrlWidth, ctrlHeight);

		//hecki97
		if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.MetroPlayerX86 || Application.platform == RuntimePlatform.MetroPlayerX64)
			isMobile = true;
	}
Exemple #37
0
	void Awake(){
        sceneFader = this;

		fadeObject = Instantiate (black);
		fadeObject.SetParent (uiCanvas);
		fadeObject.localPosition = new Vector3 (0, 0, 0);
		fadeObject.localScale = new Vector3 (1, 1, 1);
        fadeObjectImage = fadeObject.GetComponent<Image>();
		FadeIn ();

	}
	// Use this for initialization
	void Start () {
        timeleft = updateInterval;  
        
        sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
        healthController = GameObject.FindGameObjectWithTag("Player").GetComponent<HealthController>();

        ui_timerText = GameObject.Find("UI_Canvas/UI_TimerText").GetComponent<TimerUI>();
        ui_levelInfo = GameObject.Find("UI_Canvas/UI_LevelInfoText").GetComponent<LevelInfoUI>();
        
        ui_healthPoints = GameObject.Find("UI_Canvas/UI_HealthPoints").GetComponent<HealthPointsUI>();
        ui_debug = GameObject.Find("UI_Canvas/UI_Debug").GetComponent<DebugUI>();
	}
 // Use this for initialization
 void Start()
 {
     fader = GameObject.FindObjectOfType<SceneFader> ();
     totalTime = 0;
 }
 void Awake()
 {
     sceneFader = GetComponent<SceneFader>();
 }
Exemple #41
0
 // Use this for initialization
 void Start()
 {
     menu = GameObject.Find ("Canvas");
     menu.SetActive (true);
     infoPanel = GameObject.Find ("InfoPanel");
     infoPanel.SetActive (false);
     fader = GameObject.FindObjectOfType<SceneFader> ();
 }
    void Awake()
    {
        //hecki97
        gameOverFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameOverFader>();

        sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
        bgMusic = GameObject.FindGameObjectWithTag("GameController").GetComponent<AudioSource>();
    }
 // Use this for initialization
 void Start()
 {
     GameObject tmp = GameObject.FindWithTag("SceneFader");
     this.sceneFader = tmp.GetComponent<SceneFader>();
 }
 void Awake()
 {
     timerText.material.color = Color.white;
     sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
 }
	void Awake ()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
        //bgMusic = GameObject.FindGameObjectWithTag("musicManager").GetComponent<AudioSource>();
	}
Exemple #46
0
 void Start()
 {
     fader = GameObject.FindGameObjectWithTag("SceneFader").GetComponent<SceneFader>();
 }
	void Awake()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
	}
	void Start()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();	
		playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
	}
 // Use this for initialization
 void Start()
 {
     this.fader = gameObject.GetComponent<SceneFader>();
 }