Inheritance: MonoBehaviour
Exemplo n.º 1
0
    void showNewCutscene()
    {
        currentlyDisplayingText = 0;

        //print (goalText [0]);

        SceneFadeInOut fader = GameObject.Find("screenFader").GetComponent <SceneFadeInOut> ();

        if (cutscenePos >= cutscenes.Length)
        {
            fader.EndScene();
            //print ("dONE W CUTSCENES");
            SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
        }
        else
        {
            SpriteRenderer showCutscene = GameObject.Find("Cutscene").GetComponent <SpriteRenderer> ();
            showCutscene.sprite = cutscenes[cutscenePos++];
            goalText            = allCutsceneText [cutscenePos];

            if (cutscenePos == 2)
            {
                ambientAudioSource.clip = magicAudio;
                ambientAudioSource.Play();
                fader.EndSceneFast();
            }
            else
            {
                fader.EndScene();
            }
        }
    }
 void Start()
 {
     playerStats = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<PlayerStats>();
     sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
     persistentData = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<PersistentData> ();
     centerMessageController = GameObject.FindGameObjectWithTag (Tags.canvas).GetComponentInChildren<CenterMessageController> ();
 }
Exemplo n.º 3
0
 void Awake()
 {
     // Setting up references.
     player = GameObject.FindGameObjectWithTag(Tags.player);
     sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent<SceneFadeInOut>();
     liftDoorsTracking = GetComponent<LiftDoorsTracking>();
 }
Exemplo n.º 4
0
 void Awake()
 {
     // Set the texture so that it is the the size of the screen and covers it.
     //GetComponent<GUITexture>().pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 5
0
 public void LoadScene(int level)
 {
     persistentData = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<PersistentData> ();
     persistentData.Save ();
     sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
     sceneFadeInOut.LoadScene (level);
 }
Exemplo n.º 6
0
 void Awake()
 {
     // Set the texture so that it is the the size of the screen and covers it.
     GetComponent <GUITexture>().pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
     instance           = this;
     transform.position = new Vector3(0.5f, 0.5f, 0);
 }
Exemplo n.º 7
0
 void Awake()
 {
     player            = GameObject.FindGameObjectWithTag("Player");
     PlayerAnim        = player.GetComponent <Animator> ();
     sceneFadeInOut    = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut> ();
     liftDoorsTracking = GetComponent <LiftDoorsTracking> ();
 }
Exemplo n.º 8
0
 void Awake()
 {
     // Setting up references.
     player            = GameObject.FindGameObjectWithTag(Tags.player);
     sceneFadeInOut    = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut>();
     liftDoorsTracking = GetComponent <LiftDoorsTracking>();
 }
Exemplo n.º 9
0
    void Start()
    {
        sceneFade = GameObject.FindGameObjectWithTag("Finish").GetComponent <SceneFadeInOut>();
        GetComponent <SkinnedMeshRenderer>().material = dissolveMaterial;
        shaderProperty = Shader.PropertyToID("_cutoff");
        _renderer      = GetComponent <Renderer>();
        ps             = GetComponentInChildren <ParticleSystem>();

        var main = ps.main;

        main.duration = spawnEffectTime;

        ps.Play();

        foreach (Transform child in GetComponentInParent <Animator>().GetBoneTransform(HumanBodyBones.RightHand))
        {
            weapon = child.Find("muzzle");
            if (weapon != null && weapon.parent.gameObject.activeSelf)
            {
                Transform toDestroy = weapon;
                weapon = weapon.parent;
                Destroy(toDestroy.gameObject);
                _weaponRenderer = weapon.GetComponentInChildren <MeshRenderer>();
                Material[] dissolveMaterials = new Material[_weaponRenderer.materials.Length];
                for (int i = 0; i < dissolveMaterials.Length; i++)
                {
                    dissolveMaterials[i] = dissolveMaterial;
                }
                _weaponRenderer.materials = dissolveMaterials;
                break;
            }
        }
    }
 void Awake()
 {
     bossCtrl   = FindObjectOfType <BossController>();
     eyeModel   = GameObject.FindGameObjectWithTag("EyeModel");
     sceneFader = GameObject.FindGameObjectWithTag("Fader").GetComponent <SceneFadeInOut>();
     anim       = GameObject.Find("Boss_Rig").GetComponent <Animator>();
 }
Exemplo n.º 11
0
    //public bool retry = false;

    // Use this for initialization

    void Awake()
    {
        audio          = GetComponent <AudioSource> ();
        sceneFadeInOut = GetComponent <SceneFadeInOut> ();
        audioManager   = GetComponent <AudioManager> ();
        //adManager = GetComponent<AdManager> ();
    }
 // Use this for initialization
 void Start()
 {
     levelCamera          = CameraTracking.cameraTracking.gameObject;
     platformerController = PlatformerController.platformerController;
     //The scene fader is needed to call the end scene function;
     sceneFadeInOut = SceneFadeInOut.sceneFadeInOut;
 }
Exemplo n.º 13
0
 void Awake()
 {
     anim = GetComponent<Animator> ();
     playerMovement = GetComponent<PlayerMovement> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> ();
     sceneFadeInOut = GameObject.FindGameObjectWithTag (Tags.canvas).GetComponent<SceneFadeInOut> ();
     lastPlayerSighting = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<LastPlayerSighting> ();
 }
Exemplo n.º 14
0
 void Awake()
 {
     // Setting up the references.
     anim = GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
     sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent<SceneFadeInOut>();
     lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>();
 }
Exemplo n.º 15
0
 void Awake()
 {
     menu               = GameObject.FindGameObjectWithTag(Tags.menu).GetComponent <MenuHandeler> ();
     anim               = GetComponent <Animator> ();
     sceneFadeInOut     = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut> ();
     lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting> ();
     th = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <ThirdPersonCharacter> ();
 }
Exemplo n.º 16
0
 private void Awake( )
 {
     DontDestroyOnLoad( this );
     mInstance = this;
     mMaterial = new Material( "Shader \"Plane/No zTest\" { SubShader { Pass " +
                 "{ Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } " +
                 "BindChannels { Bind \"Color\",color } } } }" );
 }
    // -- Initialisation
    void Start()
    {
        // -- Set Instance
        mInstance = this;

        // -- Start Fading In
        StartFade(null, true);
    }
Exemplo n.º 18
0
 void Awake()
 {
     anim               = GetComponent <Animator>();
     playerMovement     = GetComponent <PlayerMovement>();
     hash               = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs>();
     sceneFadeInOut     = GameObject.FindWithTag(Tags.Fader).GetComponent <SceneFadeInOut>();
     lastPlayerSighting = GameObject.FindWithTag(Tags.GameController).GetComponent <LastPlayerSighting>();
 }
Exemplo n.º 19
0
    void Awake()
    {
        instance = this;

        color = transform.FindChild("Panel");
        // Set the texture so that it is the the size of the screen and covers it.
        //guiTexture.pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
        mCanvas = GetComponent <Canvas>();
    }
Exemplo n.º 20
0
 protected void Awake()
 {
     instance = this;
     DontDestroyOnLoad (transform.gameObject);
     foreach (GameObject go in persistentGameobjects) {
         DontDestroyOnLoad (go);
     }
     fade = gameObject.GetComponent<SceneFadeInOut> ();
 }
	// Use this for initialization
	void Start ()
	{
		fader = transform.Find ("texture_black").GetComponent<SceneFadeInOut> ();
		
		audio_Controller_Script = AudioControllerObject.GetComponent<AudioController> ();
		audio_Controller_Script.FadeSpeed = FadeSpeed;
		fader = FindObjectOfType<GUITexture> ().GetComponent<SceneFadeInOut> ();
		fader.FadeSpeed = FadeSpeed;
	}
Exemplo n.º 22
0
 void Awake()
 {
     player = GameObject.FindGameObjectWithTag(ScriptTags.player);
     playerAnim = player.GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(ScriptTags.gameController).GetComponent<HashIDs>();
     camMovement = Camera.main.gameObject.GetComponent<CameraMovement>();
     sceneFadeInOut = GameObject.FindGameObjectWithTag(ScriptTags.fader).GetComponent<SceneFadeInOut>();
     liftDoorsTracking = GetComponent<liftDoorsTracking>();
 }
    private bool playerDead;                            // A bool to show if the player is dead or not.


    void Awake()
    {
        // Setting up the references.
        anim               = GetComponent <Animator>();
        playerMovement     = GetComponent <PlayerMovement>();
        hash               = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
        sceneFadeInOut     = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>();
    }
Exemplo n.º 24
0
 private void Start()
 {
     currentSceneAnim = GameObject.FindGameObjectWithTag("Fader").GetComponent <SceneFadeInOut>();
     st = GameObject.FindGameObjectWithTag("Player").GetComponent <Scratch_Trigger>();
     if (GameObject.FindGameObjectWithTag("Player2") != null)
     {
         st2 = GameObject.FindGameObjectWithTag("Player2").GetComponent <Scratch_Trigger>();
     }
 }
Exemplo n.º 25
0
    // Use this for initialization
    void Awake()
    {
        characterMovement = GetComponent <CharacterMovement>();
        //aura = GetComponent<ParticleSystemRenderer>();

        renderers = GetComponentsInChildren <Renderer>();

        sceneFader = GameObject.FindGameObjectWithTag("Fader").GetComponent <SceneFadeInOut>();
    }
Exemplo n.º 26
0
 void Awake()
 {
     player            = GameObject.FindGameObjectWithTag(Tags.player);
     playerAnim        = player.GetComponent <Animator>();
     hash              = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
     camMovement       = Camera.main.gameObject.GetComponent <CameraMovement>();
     sceneFadeInOut    = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut>();
     liftDoorsTracking = GetComponent <LiftDoorsTracking>();
 }
Exemplo n.º 27
0
    // Use this for initialization
    protected void Awake()
    {
        sm_instance = this;

        // background
        m_fadeBackground = GetComponent <PackedSprite>();

        // hide the background first
        m_fadeBackground.transform.localScale = Vector3.one;
    }
Exemplo n.º 28
0
    void Start()
    {
        // Set the texture so that it is the the size of the screen and covers it.
        //guiTexture.sc = new Rect(0f, 0f, Screen.width, Screen.height);
        guiTexture.enabled = true;
        fader = this;

        Debug.Log ("Starting fade");
        StartScene();
    }
Exemplo n.º 29
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     // Set the texture so that it is the the size of the screen and covers it.
     _image = GetComponent<Image>();
     _image.enabled = false;
 }
Exemplo n.º 30
0
    void Awake()
    {
        if (instance == null)
            instance = this;
        else if (instance != this)
            Destroy(gameObject);
        DontDestroyOnLoad(transform.gameObject);

        // Set the texture so that it is the the size of the screen and covers it.
        GetComponent<GUITexture>().pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
    }
Exemplo n.º 31
0
 /// <summary>
 /// Starts the battle from an intermission
 /// </summary>
 public void StartBattle()
 {
     nextLevel = LevelDB.Instance.GetNextLevel(nextLevel);
     if (nextLevel == "-1")
     {
         nextLevel = LevelDB.Instance.GetMainMenu();
     }
     StateManager.Instance.DebugPush(GameState.LevelManagerAnimation);
     aniDuration = 0f;
     SceneFadeInOut.FadeToBlack();
     //GotoNextLevel();
 }
Exemplo n.º 32
0
	// Use this for initialization
	void Start ()
	{
		fader = transform.Find ("texture_black").GetComponent<SceneFadeInOut> ();

		audio_Controller_Script = AudioControllerObject.GetComponent<AudioController> ();
		audio_Controller_Script.FadeSpeed = FadeSpeed;
		fader = FindObjectOfType<GUITexture> ().GetComponent<SceneFadeInOut> ();
		fader.FadeSpeed = FadeSpeed;

		// reset the score manager.
		ScoreManager.Instance.Reset ();
	}
	// Use this for initialization
	void Start () {
		fade = false;
		durationOfFading = 1;
		fadeTimer = 0;
		transitionToNewScene = this.GetComponent<SceneFadeInOut> ();
		currentObjective = 0;
		objectives [currentObjective].SetActive (true);
		guiText = GameObject.Find ("HUDText").GetComponent<UILabel>();
		changeText( firstMessage );
		runScene(currentObjective);
		endScene = false;
	}
Exemplo n.º 34
0
    // Use this for initialization
    void Start()
    {
        //Establish audioSource...
        audioSource = GetComponent<AudioSource> ();
        //Establish sceneFadeInOut...
        sceneFadeInOut = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<SceneFadeInOut> ();

        //Play audio clip on start...
        if (playOnStart && !doNotPlayOnStartWhenSceneCleared) {
            audioSource.Play ();
            played = true;
        }
    }
Exemplo n.º 35
0
 void Start()
 {
     sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
     if(GameObject.FindGameObjectWithTag(Tags.localScene)){
         localSceneObjectsExist = true;
         localScenePersistentGameObjects = GameObject.FindGameObjectWithTag(Tags.localScene).GetComponent<LocalScenePersistentGameObjects>();
     }
     if(localSceneObjectsExist){
         if(!ignoreScriptedEventForSceneClearing && !localScenePersistentGameObjects.isCleared){
             StartCoroutine(DelayedListAdd ());
         }
     }
 }
Exemplo n.º 36
0
 public void OnEnable()
 {
     if (GameObject.FindGameObjectWithTag(Tags.gameController)){
         sceneFadeInOut = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<SceneFadeInOut> ();
         if(resetDefaults){
             GameObject.FindGameObjectWithTag(Tags.mainCamera).GetComponent<PersistentData>().ResetDefaults();
         }
         sceneFadeInOut.LoadScene(sceneToLoad);
     }
     else{
         Application.LoadLevel (sceneToLoad);
     }
 }
Exemplo n.º 37
0
	// Use this for initialization
	void Start ()
	{
		foreach (GUIText current_text in FindObjectsOfType<GUIText>()) {
			if (current_text.name.Contains ("text_money"))
				current_text.text = "$" + ScoreManager.Instance.Money;
		}

		fader = transform.Find ("texture_black").GetComponent<SceneFadeInOut> ();
		
		audio_Controller_Script = AudioControllerObject.GetComponent<AudioController> ();
		audio_Controller_Script.FadeSpeed = FadeSpeed;
		fader = FindObjectOfType<GUITexture> ().GetComponent<SceneFadeInOut> ();
		fader.FadeSpeed = FadeSpeed;
	}
Exemplo n.º 38
0
        public void OnPressed()
        {
            SoundMgr.G.EffectPlay(EffectSound.btn_ok);

            if (UserDataMgr.G.life <= 0)
            {
                int count = 1;
                if (UserDataMgr.G.IsItemCoins(count))
                {
                    PopupMgr.G.ShowItemPopup("Life Item Popup", "LIFE", "You can play the game with life!", "BUY", "life_icon",
                                             count, GameDataMgr.G.itemCost, () =>
                    {
                        UserDataMgr.G.CoinsUsed(GameDataMgr.G.itemCost * count);
                        UserDataMgr.G.life += count;
                        UserDataMgr.G.SetTimeToNextLife();
                        if (LobbyMgr.G != null && LobbyMgr.G.levelNumber != null)
                        {
                            LobbyMgr.G.levelNumber.UpdateLifeLabel();
                            LobbyMgr.G.levelNumber.UpdateCoin();
                        }
                    });
                }
                else
                {
                    PopupMgr.G.ShowAdsPopup(null, "Not enough coins and life." + "\n" + "Watch ads and get rewarded.", "OK");
                }
                return;
            }

            string       level = string.Format("LEVEL {0}", GameDataMgr.G.endLevel.ToString());
            PopupConfirm temp  = PopupConfirm.Open("Prefabs/Popup/GamePopup", "StartPopup", level, null, "PLAY");

            temp.GetComponent <GamePopup>().OnPopup(GamePopupState.start);
            GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>();

            if (item != null)
            {
                item.BoosterItemSetting();
                item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = 50;
            }

            temp.onConfirm += () =>
            {
                SceneFadeInOut fade = gameObject.GetComponentInParent <SceneFadeInOut>();
                fade.delayTime = 0.15f;
                fade.fadeTime  = 0.3f;
                fade.OnPressed();
            };
        }
Exemplo n.º 39
0
    void Awake()
    {
        //On awake, check to see if the gate is active or inactive and setup gate...
        if(isActive){
            ActivateGate();
        }
        else{
            DeactivateGate ();
        }

        //shakeCam = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<SmoothCamera2D> ();
        player = GameObject.FindGameObjectWithTag (Tags.player);
        sceneFadeInOut = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<SceneFadeInOut> ();
        persistentData = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<PersistentData> ();
    }
Exemplo n.º 40
0
    void Start()
    {
        sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
        if(GameObject.FindGameObjectWithTag(Tags.localScene)){
            localScenePersistentGameObjects = GameObject.FindGameObjectWithTag(Tags.localScene).GetComponent<LocalScenePersistentGameObjects>();
            localSceneObjectsExist = true;
        }

        if(localSceneObjectsExist){
            if(!ignoreEnemyForSceneClearing && gameObject.tag == Tags.enemy && !localScenePersistentGameObjects.isCleared){
                //If this gameObject is tagged "enemy", then add it to the enemy list
                StartCoroutine(DelayedListAdd());
            }
        }
    }
Exemplo n.º 41
0
    void Awake()
    {
        //makes it a singleton
        if (sceneFadeInOut == null)
        {
            //DontDestroyOnLoad(gameObject);
            sceneFadeInOut = this;
        }
        else if (sceneFadeInOut != this)
        {
            Destroy(gameObject);
        }

        // Set the texture so that it is the the size of the screen and covers it.
        GetComponent <GUITexture>().pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
    }
Exemplo n.º 42
0
	// Use this for initialization
	void Start () {

		sceneFadeInOut = screenFader.GetComponent<SceneFadeInOut>();
		gameSceneControll = gameScene.GetComponent<GameSceneControll>();
		gameOverSceneControll = gameOverScene.GetComponent<GameOverSceneControll>();

		googleAnalytics.LogEvent(new EventHitBuilder()
		                         .SetEventCategory("Game")
		                         .SetEventAction("Open Game"));

		StartCoroutine( LoginPlayServices() );

		CreatSmallBanner();

		StartMainMenuScene();

	}
Exemplo n.º 43
0
 // Update is called once per frame
 void Update()
 {
     if (_enabled)
     {
         if (StateManager.Instance.State == GameState.noState && _nextDialogue < dialogues.Count)
         {
             // count upwards
             _nextDialogue++;
             // start dialogue
             if (_nextDialogue < dialogues.Count)
             {
                 string title = dialogues[_nextDialogue];
                 if (title == "NextSlide")
                 {
                     PowerPointSlide.instance.Advance();
                 }
                 else if (title == "FadeToBlack")
                 {
                     SceneFadeInOut.FadeToBlack();
                 }
                 else if (title == "FadeToClear")
                 {
                     SceneFadeInOut.FadeToClear();
                 }
                 else
                 {
                     Dialogue.StartDialogue(dialogues[_nextDialogue], null);
                 }
             }
         }
         else if (_nextDialogue == dialogues.Count)
         {
             if (skipSetup)
             {
                 LevelManager.Instance.StartBattle();
                 _enabled = false;
             }
             else
             {
                 gameObject.AddComponent <IntermissionMenu>();
                 _enabled = false;
             }
         }
     }
 }
Exemplo n.º 44
0
    public void OnEnable()
    {
        //If scene clear hasn't already been called and if the player is still alive...
        if(!alreadyEnabledOnce && GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<PlayerStats>().playerIsAlive){
            alreadyEnabledOnce = true;

            //If post-action event exists, execute it...
            if(!targetEnabled && targetGO != null){
                (targetGO.GetComponent(scriptNameToEnable) as MonoBehaviour).enabled = true;
                targetEnabled = true;
            }

            //Do this step last!
            sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
            sceneFadeInOut.SceneClear();

        }
    }
Exemplo n.º 45
0
    // Use this for initialization
    private void Start()
    {
        var tileMapGameObject = GameObject.Find("TileMap");

        m_tileMap = tileMapGameObject.GetComponent <TileMapBehaviour>();
        if (m_tileMap == null)
        {
            Debug.LogError("TileMapBehaviour not found");
        }
        m_levelBehaviour = tileMapGameObject.GetComponent <LevelBehaviour>();
        if (m_levelBehaviour == null)
        {
            Debug.LogError("LevelBehaviour not found");
        }
        m_sceneFadeInOut = GameObject.Find("SceneFader").GetComponent <SceneFadeInOut>();
        if (m_sceneFadeInOut == null)
        {
            Debug.LogError("SceneFadeInOut not found");
        }
    }
Exemplo n.º 46
0
    void Start()
    {
        General.Logger.LogDetail("GameController", "Start", "Entering Start. guiManager.currentLives = " + guiManager.currentLives);
        GLOBALS.gameController = this;
        if (null == sceneFadeInOut)
        {
            sceneFadeInOut = GetComponentInChildren <SceneFadeInOut>();
            if (null == sceneFadeInOut)
            {
                General.Logger.LogError("GameController", "Start", "Could not find SceneFadeInOut script.");
            }     // if
        }         // if

        for (int loop = 0; loop < levels.Length; loop++)
        {
            if (null != levels[loop].openingImage)
            {
                levels[loop].openingImage.enabled = false;
            }             // if
            if (null != levels[loop].music)
            {
                levels[loop].music.Stop();
            }     // if
        }         // for

        System.DateTime lastPlayedPlus1Day = GLOBALS.lastDayPlayed.AddDays(1);

        if (lastPlayedPlus1Day == System.DateTime.Today)
        {
            GLOBALS.consecutiveDaysPlayingCount++;
        }         // if
        if (0 < guiManager.currentLives)
        {
            RunLevel();
        }         // if

        guiManager.Init();
        guiManager.UpdateScore();
        guiManager.UpdateLives(GetSpawnedPlayer());
        General.Logger.LogDetail("GameController", "Start", "Exiting Start.");
    }     // Start
Exemplo n.º 47
0
    void OnGUI()
    {
        if (StateManager.Instance.State == GameState.LevelManagerAnimation)
        {
            if (aniDuration < 0)
            {
                if (fadeToBlack)
                {
                    SceneFadeInOut.FadeToBlack();
                    fadeToBlack = false;
                }
                else
                {
                    StateManager.Instance.DebugPop();
                    GotoNextLevel();
                }
            }

            GUI.Box(new Rect(Screen.width / 2 - 50, Screen.height / 2 - 12, 100, 25), msg);
        }
    }
Exemplo n.º 48
0
        public void OnPressed()
        {
            string       level = string.Format("Level {0}", GameDataMgr.G.endLevel.ToString());
            PopupConfirm temp  = PopupConfirm.Open("Prefabs/Popup/GamePopup", "StartPopup", level, null, "Play");

            temp.GetComponent <GamePopup>().OnPopup(GamePopupState.start);
            GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>();

            if (item != null)
            {
                item.BoosterItemSetting();
                item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = 50;
            }

            temp.onConfirm += () =>
            {
                SceneFadeInOut fade = gameObject.GetComponentInParent <SceneFadeInOut>();
                fade.delayTime = 0.15f;
                fade.fadeTime  = 0.3f;
                fade.OnPressed();
            };
        }
Exemplo n.º 49
0
    void showNewCutscene()
    {
        currentlyDisplayingText = 0;

        //print (goalText [0]);

        SceneFadeInOut fader = GameObject.Find("screenFader").GetComponent <SceneFadeInOut> ();

        if (cutscenePos >= cutscenes.Length)
        {
            fader.EndScene();
            //print ("dONE W CUTSCENES");
            SceneManager.LoadScene("SecondLevel", LoadSceneMode.Single);
        }
        else
        {
            SpriteRenderer showCutscene = GameObject.Find("Cutscene").GetComponent <SpriteRenderer> ();
            showCutscene.sprite = cutscenes[cutscenePos++];
            goalText            = allCutsceneText [cutscenePos];

            fader.EndScene();
        }
    }
Exemplo n.º 50
0
	public FadeAction(bool fadeToBlack) {
		this.fadeToBlack = fadeToBlack;
		isFinished = false;
		this.fade = GameObject.Find ("ScreenFader").GetComponent<SceneFadeInOut> ();
	}
Exemplo n.º 51
0
    private void Start()
    {
		 


		noMove = true;
		simula = false;
	    syncRunEvent = new AnimationEvent();
		anim = transform.Search ("character_rig").GetComponent<Animator> ();
		 
	 

		effects = transform.Search ("Effects Keen").gameObject;
		 


        var tileMapGameObject = GameObject.Find("TileMap");
        m_tileMap = tileMapGameObject.GetComponent<TileMapBehaviour>();
        if (m_tileMap == null)
            Debug.LogError("TileMapBehaviour not found");
        m_levelBehaviour = tileMapGameObject.GetComponent<LevelBehaviour>();
        if (m_levelBehaviour == null)
            Debug.LogError("LevelBehaviour not found");
        m_sceneFadeInOut = GameObject.Find("SceneFader").GetComponent<SceneFadeInOut>();
        if (m_sceneFadeInOut == null)
            Debug.LogError("SceneFadeInOut not found");

		enemieBehaviourGameObject = GameObject.Find("Enemies");
		if (enemieBehaviourGameObject == null)
			Debug.LogError ("EnemieBehaviour not found");

		itemBehaviourGameObject = GameObject.Find("Itens");
		if (itemBehaviourGameObject == null)
			Debug.LogError ("itens obj not found");

		blocks = GameObject.Find("Blocks");
		
		if (blocks == null)
		{
			Debug.LogError("blocks not found");
			return;
		}
	
		mapPrefab= GameObject.Find("Map");
		
		if (mapPrefab == null)
		{
			Debug.LogError("Map not found");
			return;
		}

		swipeToMove = 10;
		updadeEnemie = false;
		move_slash = false;
		enterDoor = 0;
		haveKey = false;
	
		lifeHitParticle.GetComponent<ParticleSystem> ().enableEmission = false;

		velReal = vel;

    }
Exemplo n.º 52
0
    void Start()
    {
        // Preload next scene
        _op = SceneManager.LoadSceneAsync(sceneToLoad.name);

        // Don't load scene untill time has expired
        _op.allowSceneActivation = false;

        if (screenshoots.Length > 2) {
            // Begin background animation
            StartCoroutine(BackgroundEffect());
        }

        // Get fade component
        _sfio = GameObject.FindObjectOfType<SceneFadeInOut>();
    }
Exemplo n.º 53
0
 private void Awake()
 {
     sceneAnim = animObj.GetComponent <SceneFadeInOut>();
 }
Exemplo n.º 54
0
 void Start()
 {
     MasterServer.ipAddress = "188.226.229.203";
     gameState = State.GetInstance();
     sceneFadeIn = GameObject.FindGameObjectWithTag("Fader").GetComponent<SceneFadeInOut>();
 }
    void Update()
    {
        if (player == null) {
            player = GameObject.FindGameObjectWithTag (Tags.player);
            sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<SceneFadeInOut>();
            persistentData = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<PersistentData> ();

        }
    }
Exemplo n.º 56
0
 void Awake()
 {
     fadeIn = true;
     fadeScr = gameObject.GetComponent<SceneFadeInOut>();
 }
Exemplo n.º 57
0
 // Use this for initialization
 void Awake()
 {
     rawImage = GetComponent <RawImage>();
     Instance = this;
 }
Exemplo n.º 58
0
    public void Awake()
    {
        waitFrame = false;

        _menuPanel = new Stack<MenuInstance>();
        //open a menu if indicated
        if (startWithMenu != Menu.NONE) {
            OpenMenu(startWithMenu);
        }
        DoConfirmQuitNo();

        //get the fading
        _fading = GetComponent<SceneFadeInOut>();
        //get input controller
        _gameControllerInput = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent<GameControllerInput>();

        backgroundImageMainMenu = backgroundMainMenu.GetComponent<RawImage>();

        //Get the scene
        GameControllerData data = GameObject.FindGameObjectWithTag(Tags.GameData).GetComponent<GameControllerData>();
        newContinueGame = data.GetLastUnlockedScene();
    }
Exemplo n.º 59
0
 void Awake()
 {
     S = this;
     FadeImg.rectTransform.localScale = new Vector2(Screen.width, Screen.height);
 }
Exemplo n.º 60
0
 void Start()
 {
     //anim = gameObject.GetComponent<Animator>;
     //catcontrol = gameObject.GetComponent<catcontroller>;
     sceneFadeInOut = GameObject.FindGameObjectWithTag("gamecontroller").GetComponent <SceneFadeInOut> ();
 }