Advertisement
MaoChessy

Untitled

Jul 17th, 2022
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Vars = {
  2.     Id : {
  3.         ZoomPanel : "Zoom",
  4.         TextPanel : "Text1",
  5.         BlackSC : "BlackScreen",
  6.         Btn_to : "NextBtn"
  7.     },
  8.     Names : {
  9.         MarkPanel : "Marks",
  10.     },
  11.     Cubes : {
  12.         n1 : null,
  13.         n2 : null
  14.     },
  15.     Anims : {
  16.         InstanceOff : "",
  17.         InstanceOn : "",
  18.         Hide : "",
  19.         Show : "",
  20.     },
  21.     Test : {
  22.         n : 1
  23.     }
  24. }
  25.  
  26. let creator = null
  27. let markPanel = null;
  28.  
  29. let zoomPanel = null;
  30. let blackPanel = null;
  31. let textPanel = null;
  32. let nextBtn = null;
  33.  
  34. let d = null;
  35.  
  36. Marks = {
  37.     Anim : "Anim",
  38.     MoveItem : "MoveItem",
  39.     TextView : "Text",
  40.     UiMark : "UI_",
  41.     EventBus : "Events"
  42. }
  43.  
  44. function Awake() {
  45.     d = Global.Delayer;
  46.     creator = Mes.GetCreatorDef();
  47.     markPanel = creator.Get(Vars.Names.MarkPanel)
  48.     creator.SetSibling(markPanel, 0)
  49.     Seqencer.Step1()
  50. }
  51.  
  52. var Seqencer = {
  53.     Step1 : function () {
  54.         blackPanel = creator.Create(Vars.Id.BlackSC, "back")
  55.         textPanel = creator.Create(Vars.Id.TextPanel, "FirstText")
  56.         moveText = textPanel.Get(Marks.MoveItem);
  57.         moveText.Duration = 0;
  58.         moveText.MoveToView(Mes.CreateV2(0.5, -0.5))
  59.         blackPanel.Get(Marks.Anim).PlayByStr("Show")
  60.         d.Wait(0.8, function () {
  61.             moveText.Duration = 1;
  62.             moveText.MoveToView(Mes.CreateV2(0.5, 0.65))
  63.             d.Wait(1, function () {
  64.                 nextBtn = creator.Create(Vars.Id.Btn_to, "BtnNext")
  65.                 btn_e = nextBtn.Get("Events")
  66.                 btn_e.Send("SetUseOff")
  67.                
  68.                 text = textPanel.Get(Marks.TextView);
  69.                 text.Duration = 3;
  70.                 text.SetText("Вас привествует система API для создания " +
  71.                     "форм общение с пользователем. Подходит как для диалогов, так и для создания обучения. " +
  72.                     "Нажмите кнопку дальше внизу чтобы продолжить.")
  73.                 d.Wait(text.Duration, function () {
  74.                     btn_e.Send("SetUseOn")
  75.                     btn_e.Sub("Click", function () {
  76.                         Seqencer.Step2()
  77.                     })
  78.                 })
  79.             })
  80.         })
  81.     },    
  82.     Step2 : function () {
  83.         creator.ClearByObject(nextBtn)
  84.         creator.ClearByObject(blackPanel)
  85.         zoomPanel = creator.Create(Vars.Id.ZoomPanel, "Zoom");
  86.         creator.SetSibling(zoomPanel, 1)
  87.         zoom_move = zoomPanel.Get(Marks.MoveItem)
  88.         zoom_move.Duration = 1;
  89.         zoom_move.MoveToGameObject(Vars.Cubes.n2)
  90.        
  91.         text_move = textPanel.Get(Marks.MoveItem)
  92.         text_move.Duration = 0.25
  93.         text_move.MoveToView(Mes.CreateV2(0.75, 0.5))
  94.         d.Wait(0.5, function () {
  95.             text = textPanel.Get(Marks.TextView)
  96.             text.Duration = 1;
  97.             text.SetText("Например сейчас я изменил свою скорость начетания текст на 1 сек заместо трех. Нравится? " +
  98.                 "А ещё я вам указываю на кубик. Сделайте по нему клик чтобы продолжить")
  99.            
  100.             zoomPanel.Get(Marks.EventBus).Sub("Click", Seqencer.Callback1)
  101.         })
  102.     },
  103.     Step3 : function () {
  104.         blackPanel.Get(Marks.Anim).PlayByStr(Vars.Anims.Hide)
  105.         text_move = textPanel.Get(Marks.MoveItem)
  106.         text_move.Duration = 1.5
  107.         text_move.MoveToView(Mes.CreateV2(0.75, -0.8))
  108.         d.Wait(1.6, function () {
  109.             creator.ClearAll();
  110.         })
  111.     },
  112.     Callback1 : function () {
  113.         zoomPanel.Get(Marks.EventBus).Unsub("Click", Seqencer.Callback1)
  114.         text.SetText("Молодец, а теперь на следующий!")
  115.         zoom_move.MoveToGameObject(Vars.Cubes.n1)
  116.         d.Wait(2, function () {
  117.             zoomPanel.Get(Marks.EventBus).Sub("Click", Seqencer.Callback2)
  118.         })
  119.     },
  120.     Callback2 : function () {
  121.         zoomPanel.Get(Marks.EventBus).Unsub("Click", Seqencer.Callback2)
  122.         creator.ClearByObject(zoomPanel)
  123.  
  124.         text.SetText("Молодец, ты закончил обучениеи. Сейчас будет анимация закрытия через 5 секунд, подожди пожалуйтса!")
  125.         d.WaitFrame(1, function () {
  126.             blackPanel = creator.Create(Vars.Id.BlackSC, "black2");
  127.             creator.SetSibling(blackPanel, 1)
  128.             blackPanel.Get(Marks.Anim).PlayByStr(Vars.Anims.InstanceOn)
  129.         })
  130.         d.Wait(5, Seqencer.Step3)
  131.     }
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement