Наследование: MonoBehaviour
Пример #1
0
    // 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;
    }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        fader = FindObjectOfType <SceneFader>();

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

        SceneFader.MoveToScene("MenuScene", SceneMoveType.Short);
    }
Пример #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");
	}
Пример #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());
    }
Пример #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);
    }
Пример #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();

    }
Пример #10
0
    public void ToTitleScene()
    {
        AudioManager.Play(SEType.Button);
        AudioManager.FadeOut(1);

        SceneFader.MoveToScene("TitleScene", SceneMoveType.Short);
    }
Пример #11
0
    void Awake()
    {
        Instance = this;

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

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

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

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

        SceneFader.MoveToScene("Game", SceneMoveType.Short);
    }
Пример #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);
 }
Пример #18
0
    // Use this for initialization
    void Start()
    {
        scene = FindObjectOfType <SceneFader> ();

//		player = GameObject.Find ("Player").GetComponent<Transform> ();
//		InvokeRepeating ("SBird", BirdSpawnRate, BirdSpawnRate);
    }
Пример #19
0
 void Awake()
 {
     sceneFader = FindObjectOfType <SceneFader>();
     ui         = FindObjectOfType <PauseMenu>().transform.GetChild(0).gameObject;
     settings   = FindObjectOfType <SettingsMenu>(true).gameObject;
     paused     = false;
 }
Пример #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();
    }
Пример #21
0
 private void _MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #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;
    }
Пример #23
0
	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);
 }
Пример #25
0
    // ------------------------------------------------------------------------

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

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


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

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

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

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

        StartCoroutine(FadeIn());
    }
Пример #36
0
	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;
	}
Пример #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 ();

	}
Пример #38
0
	// 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>();
	}
Пример #39
0
 // Use this for initialization
 void Start()
 {
     fader = GameObject.FindObjectOfType<SceneFader> ();
     totalTime = 0;
 }
Пример #40
0
 void Awake()
 {
     sceneFader = GetComponent<SceneFader>();
 }
Пример #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> ();
 }
Пример #42
0
    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>();
 }
Пример #44
0
 void Awake()
 {
     timerText.material.color = Color.white;
     sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
 }
Пример #45
0
	void Awake ()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
        //bgMusic = GameObject.FindGameObjectWithTag("musicManager").GetComponent<AudioSource>();
	}
Пример #46
0
 void Start()
 {
     fader = GameObject.FindGameObjectWithTag("SceneFader").GetComponent<SceneFader>();
 }
Пример #47
0
	void Awake()
	{
		sceneFader = GameObject.FindGameObjectWithTag("GameController").GetComponent<SceneFader>();
	}
Пример #48
0
	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>();
 }