Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.63 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. public class CreateAccountSteps : StepsTools
  5. {
  6.     // Singleton
  7.     public static CreateAccountSteps instance;
  8.  
  9.     void Awake()
  10.     {
  11.         if (instance == null)
  12.             instance = this;
  13.         else
  14.             Destroy(this.gameObject);
  15.  
  16.         #region Button Handler
  17.  
  18.         // Next : Proxima tela.
  19.         UI.buttonNext.Init(null, (ht) => { NextSystem(); });
  20.         // Previous : Tela anterior
  21.         UI.buttonPrevious.Init(null, (ht) => { PreviousSystem(); });
  22.  
  23.         #endregion
  24.     }
  25.  
  26.     #region Methods
  27.  
  28.     /// <summary>
  29.     /// <![CDATA[ Method Update ]]>
  30.     /// </summary>
  31.     public override void MethodUpdate()
  32.     {
  33.         base.MethodUpdate();
  34.         #region Next and Previous
  35.  
  36.         switch (AppManager.APP_TYPE)
  37.         {
  38.             case AppType.Aluno:
  39.                 NextButton(UICreateAccountStudent.Access.CheckedInputStudent(Manager.index));
  40.                 break;
  41.             case AppType.Professor:
  42.                 NextButton(UICreateAccountTeacher.Access.CheckedInputTeacher(Manager.index));
  43.                 break;
  44.         }
  45.  
  46.         if (Manager.index > 0)
  47.             PreviousButton(true);
  48.         else
  49.             PreviousButton(false);
  50.  
  51.         #endregion
  52.     }
  53.     /// <summary>
  54.     /// <![CDATA[ Next Steps ]]>
  55.     /// </summary>
  56.     public override void NextSystem ()
  57.     {
  58.         base.NextSystem ();
  59.  
  60.         switch (AppManager.APP_TYPE)
  61.         {
  62.         case AppType.Aluno:
  63.             UICreateAccountStudent.Access.CallbackConfirm(Manager.index);
  64.             break;
  65.         case AppType.Professor:
  66.             UICreateAccountTeacher.Access.CallbackConfirm(Manager.index);
  67.             break;
  68.         }
  69.     }
  70.     // Atualiza a tela passando para próxima
  71.     public bool NextScreen()
  72.     {
  73.         #region Next
  74.         bool nextScreen = Manager.index < Manager.feedback.Length - 1;
  75.  
  76.         if (nextScreen)
  77.         {
  78.             // Incrementa o proximo index.
  79.             Manager.index += 1;
  80.             // Coloca a UI atual para a categoria "Ja passou".
  81.             AnimationScreen(Transition.disabled, UI.screens[Manager.index - 1]);
  82.             // Coloca a NOVA UI para a categoria "Nova Tela".
  83.             AnimationScreen(Transition.enabled, UI.screens[Manager.index]);
  84.             // UI / UX Atual.
  85.             UpdateScreen();
  86.         }
  87.  
  88.         return nextScreen;
  89.         #endregion
  90.     }
  91.     /// <summary>
  92.     /// <![CDATA[ Previous Steps ]]>
  93.     /// </summary>
  94.     public override void PreviousSystem()
  95.     {
  96.         base.PreviousSystem();
  97.         #region Previous
  98.         Debug.Log("Click Previous");
  99.         if (Manager.index > 0)
  100.         {
  101.             // Coloca a UI atual para a categoria "Fica em Espera".
  102.             AnimationScreen(Transition.disabled, UI.screens[Manager.index]);
  103.             // Decrementa o index.        
  104.             Manager.index -= 1;
  105.             // Coloca a NOVA UI para a categoria "Nova Tela".
  106.             AnimationScreen(Transition.enabled, UI.screens[Manager.index]);
  107.             // Atualiza interface
  108.             UpdateScreen();
  109.         }
  110.         #endregion
  111.     }
  112.  
  113.      // Next Button State
  114.     public override void NextButton(bool condition) { base.NextButton(condition); }
  115.  
  116.     // Previous Button State
  117.     public override void PreviousButton(bool condition){ base.PreviousButton(condition); }
  118.  
  119.     // Reseta todo o sistema de Steps.
  120.     public override void ResetAll () { base.ResetAll(); }
  121.  
  122.     // Atualiza a Interface.
  123.     public override void UpdateScreen () { base.UpdateScreen (); }
  124.  
  125.     // Animação da Tela.
  126.     public override void AnimationScreen (Transition type, Animator UI){ base.AnimationScreen (type, UI); }
  127.  
  128.     #endregion
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement