Esempio n. 1
0
        /// <summary>
        /// Loads the assets for the tutorial manager
        /// </summary>
        private void LoadAssets()
        {
            IsFinished = false;
            
            louieTextures = new List<Texture2D>();
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_0));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_1));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_2));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_3));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_4));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_5));
            louieTextures.Add(ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_6));

            louieSound = ResourceManager<AudioClip>.Instance.Load(ResourceEnum.AUDIOCLIP_UNCLELOUIE);

			louieDialogueWindow = GUIItemFactory<GUIImage>.Instance.Pool.New();
			louieDialogueWindow.Content.image = 
				ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_WIN_TUTORIAL_DIALOGUE);
			louieDialogueWindow.SetRectangle(0.32f, 0.15f, 0.67f, 0.4f, false, ScaleMode.StretchToFill);			                              			                              
			louieDialogueWindow.Element = GUIElementEnum.TutorialDialogueWindow;
			
			GUIStateManager.Instance.AddChild(louieDialogueWindow);
			
			louieDialogueBox = GUIItemFactory<GUIBox>.Instance.Pool.New();
			louieDialogueBox.SetRectangle(0.05f, 0.05f, 0.58f, 0.3f, false, ScaleMode.ScaleToFit);			                              			                              
      		louieDialogueBox.Element = GUIElementEnum.TutorialDialogueBox;
			louieDialogueBox.Style = LightweightResourceManager<GUIStyle>.Instance.Get(ResourceEnum.GUISTYLE_NO_BACKGROUND);		
      		
			louieDialogueWindow.AddChild(louieDialogueBox);
			
			moreTextButton = GUIItemFactory<GUIButton>.Instance.Pool.New();
			moreTextButton.Content.image = 
				ResourceManager<Texture2D>.Instance.Load(ResourceEnum.TEXTURE_ICON_MORE_TEXT);
			moreTextButton.SetRectangle(0.59f, 0.24f, 0.075f, 0.075f, false, ScaleMode.ScaleToFit);			                              			                              
			moreTextButton.Element = GUIElementEnum.TutorialMoreText;
			moreTextButton.Style = LightweightResourceManager<GUIStyle>.Instance.Get(ResourceEnum.GUISTYLE_NO_BACKGROUND);		
			
			moreTextButton.OnClick = (gi) =>
			{
				SetStage(currentStageIndex + 1);
			};
			
			louieDialogueWindow.AddChild(moreTextButton);

			louieImage = GUIItemFactory<GUIImage>.Instance.Pool.New();
			louieImage.Element = GUIElementEnum.TutorialLouie;
				
			GUIStateManager.Instance.AddChild(louieImage);
        }
Esempio n. 2
0
        /// <summary>
        /// Finishes the tutorial
        /// </summary>
        public void FinishTutorial()
        {
            IsFinished = true;
            
            // @TO DO Make sure we destroy all objects and clean everything up!
			ResourceManager<AudioClip>.Instance.UnLoad(ResourceEnum.AUDIOCLIP_UNCLELOUIE);
			
            ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_ICON_MORE_TEXT);            
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_0);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_1);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_2);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_3);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_4);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_5);
			ResourceManager<Texture2D>.Instance.UnLoad(ResourceEnum.TEXTURE_TUTORIAL_LOUIE_6);
	
			GUIStateManager.Instance.RemoveChild(GUIElementEnum.TutorialLouie);
			GUIStateManager.Instance.RemoveChild(GUIElementEnum.TutorialDialogueWindow);

			louieDialogueWindow.Destroy();
			louieDialogueBox.Destroy();
			louieImage.Destroy();
			moreTextButton.Destroy();
			
			louieDialogueBox = null;
			louieImage = null;
			moreTextButton = null;

			stages.Clear ();
			stages = null;
			currentStage = null;
			sayings = null;
			louieTextures.Clear ();
			louieTextures = null;
		}