Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class CreateAccountSteps : StepsTools
- {
- // Singleton
- public static CreateAccountSteps instance;
- void Awake()
- {
- if (instance == null)
- instance = this;
- else
- Destroy(this.gameObject);
- #region Button Handler
- // Next : Proxima tela.
- UI.buttonNext.Init(null, (ht) => { NextSystem(); });
- // Previous : Tela anterior
- UI.buttonPrevious.Init(null, (ht) => { PreviousSystem(); });
- #endregion
- }
- #region Methods
- /// <summary>
- /// <![CDATA[ Method Update ]]>
- /// </summary>
- public override void MethodUpdate()
- {
- base.MethodUpdate();
- #region Next and Previous
- switch (AppManager.APP_TYPE)
- {
- case AppType.Aluno:
- NextButton(UICreateAccountStudent.Access.CheckedInputStudent(Manager.index));
- break;
- case AppType.Professor:
- NextButton(UICreateAccountTeacher.Access.CheckedInputTeacher(Manager.index));
- break;
- }
- if (Manager.index > 0)
- PreviousButton(true);
- else
- PreviousButton(false);
- #endregion
- }
- /// <summary>
- /// <![CDATA[ Next Steps ]]>
- /// </summary>
- public override void NextSystem ()
- {
- base.NextSystem ();
- switch (AppManager.APP_TYPE)
- {
- case AppType.Aluno:
- UICreateAccountStudent.Access.CallbackConfirm(Manager.index);
- break;
- case AppType.Professor:
- UICreateAccountTeacher.Access.CallbackConfirm(Manager.index);
- break;
- }
- }
- // Atualiza a tela passando para próxima
- public bool NextScreen()
- {
- #region Next
- bool nextScreen = Manager.index < Manager.feedback.Length - 1;
- if (nextScreen)
- {
- // Incrementa o proximo index.
- Manager.index += 1;
- // Coloca a UI atual para a categoria "Ja passou".
- AnimationScreen(Transition.disabled, UI.screens[Manager.index - 1]);
- // Coloca a NOVA UI para a categoria "Nova Tela".
- AnimationScreen(Transition.enabled, UI.screens[Manager.index]);
- // UI / UX Atual.
- UpdateScreen();
- }
- return nextScreen;
- #endregion
- }
- /// <summary>
- /// <![CDATA[ Previous Steps ]]>
- /// </summary>
- public override void PreviousSystem()
- {
- base.PreviousSystem();
- #region Previous
- Debug.Log("Click Previous");
- if (Manager.index > 0)
- {
- // Coloca a UI atual para a categoria "Fica em Espera".
- AnimationScreen(Transition.disabled, UI.screens[Manager.index]);
- // Decrementa o index.
- Manager.index -= 1;
- // Coloca a NOVA UI para a categoria "Nova Tela".
- AnimationScreen(Transition.enabled, UI.screens[Manager.index]);
- // Atualiza interface
- UpdateScreen();
- }
- #endregion
- }
- // Next Button State
- public override void NextButton(bool condition) { base.NextButton(condition); }
- // Previous Button State
- public override void PreviousButton(bool condition){ base.PreviousButton(condition); }
- // Reseta todo o sistema de Steps.
- public override void ResetAll () { base.ResetAll(); }
- // Atualiza a Interface.
- public override void UpdateScreen () { base.UpdateScreen (); }
- // Animação da Tela.
- public override void AnimationScreen (Transition type, Animator UI){ base.AnimationScreen (type, UI); }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement