Inheritance: 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
ファイル: Credits.cs プロジェクト: Aphemra/TheOddsOfDying
    // 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
ファイル: PauseMenu.cs プロジェクト: hecki97/2DPlatformer-2.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>();
	}
コード例 #8
0
    // 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
ファイル: LevelHandler.cs プロジェクト: Liljan/Handgun
    // 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
ファイル: SceneFader.cs プロジェクト: Lovell23/MeHacker
 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);
		}
	}
コード例 #24
0
 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
ファイル: PauseMenu.cs プロジェクト: hecki97/2DPlatformer
    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
ファイル: NextLevel.cs プロジェクト: DrBaxR/PlatformerGame
 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
ファイル: SceneFader.cs プロジェクト: penspanic/SpaceOdyssey
	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
ファイル: startMenu.cs プロジェクト: lcoblamm/Vivid
 // 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>();
    }
コード例 #43
0
 // 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
ファイル: Credits.cs プロジェクト: jimmytheleaf/game-jolt-10
 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>();
	}
コード例 #49
0
 // Use this for initialization
 void Start()
 {
     this.fader = gameObject.GetComponent<SceneFader>();
 }