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;
    }
Beispiel #2
0
    // Use this for initialization
    void Awake()
    {
        fader = FindObjectOfType <SceneFader>();

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Beispiel #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);
    }
Beispiel #4
0
    public void BackButton()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("MenuScene", SceneMoveType.Short);
    }
Beispiel #5
0
	/*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");
	}
Beispiel #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());
    }
Beispiel #7
0
	// 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);
    }
Beispiel #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();

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

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

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

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

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

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

        SceneFader.MoveToScene("Game", SceneMoveType.Short);
    }
Beispiel #17
0
 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);
    }
Beispiel #19
0
 void Awake()
 {
     sceneFader = FindObjectOfType <SceneFader>();
     ui         = FindObjectOfType <PauseMenu>().transform.GetChild(0).gameObject;
     settings   = FindObjectOfType <SettingsMenu>(true).gameObject;
     paused     = false;
 }
Beispiel #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();
    }
Beispiel #21
0
 private void _MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #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;
    }
Beispiel #27
0
	void MakeSingleton () {
		if (instance != null) {
			Destroy (gameObject);
		} else {
			instance = this;
			DontDestroyOnLoad (gameObject);
		}
	}
Beispiel #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;
     }
 }
Beispiel #30
0
    // ---------------------------------


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

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

        if (sceneFader == null)
        {
            sceneFader = GameObject.FindWithTag("SceneFader").GetComponent <SceneFader>();
        }
    }
Beispiel #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>();
    }
Beispiel #33
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }

        Instance = this;
    }
Beispiel #34
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         SceneFader fader = GameObject.FindObjectOfType <SceneFader>();
         PlayerPrefs.SetInt("score", GameManager.score);
         fader.FadeScene(nextLevel);
     }
 }
Beispiel #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;
	}
Beispiel #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;
 }
Beispiel #40
0
 void Awake()
 {
     sceneFader = GetComponent<SceneFader>();
 }
Beispiel #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>();
	}
Beispiel #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>();
 }