コード例 #1
0
    /*
     *  Each storyboard function called moment:
     * CreateScene     => after finish load scene before play enter animation(only call after load from prefab or asset bundle, read cache from MgrScene will not called).
     * WillEnterScene => after CreatScene, at the begin of play enter animation.
     * EnterScene     => at the end of play enter animation.
     *
     * WillExitScene  => at the begin of play exit animation.
     * ExitScene      => at the end of play exit animation.
     * DestroyScene   => when destroy the scene(before destroy).
     *
     * OverlayBegan   => when scene overlaid(only XLAF popup).
     * OverlayEnded   => when scene overlaid object disappear(only XLAF popup).
     * AndroidGoBack  => in Android, user press back button.
     * UpdateLanguage => when update language or after CreatScene.
     */
    public override void CreateScene(object obj)
    {
        BindAllButtonsClickEvent();
        Log.Debug("scene1 creat_scene", obj);

//		string fn = ModUtils.documentsDirectory + "/test.jsn";
//		string def = ModUtils.streamingDirectory + "/test.jsn";
//		MgrData.AddSetting ("test", fn, def);
        MgrAudio.PlayMusic("m_start.mp3", 0.5f);
        ModDispatcher.AddListener("dia2", (XLAF_Event e) => {
            Log.Debug("dia2:", e.ToString());
        });

        MgrBackdoor.SetBackdoor(ModUIUtils.GetChild(transform, "lbl_text"), (isHandled, cmd) => {
            Log.Debug(isHandled, cmd);
        });


//		Transform txt = ModUIUtils.GetChild (transform, "lbl_text");
//		ModUIUtils.AddTouchEvent (txt.gameObject, e => {
//			Log.Debug (e);
//			if(e.phase==Phase.Up){
//				ModUIUtils.RemoveTouchEvent(e.target);
//			}
//		});
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        Init();

        MgrScene.SetViewRoot(ModUIUtils.GetChild <Transform> (transform, "SceneViewRoot"));
        MgrPopup.SetPopupRoot(ModUIUtils.GetChild <Transform> (transform, "PopupViewRoot"));

        MgrScene.GotoScene("Scene1", "main", SceneAnimation.none, 0.3f, () => {
            Log.Debug("main Scene1 Done~", ModUtils.documentsDirectory);
        });
    }
コード例 #3
0
ファイル: BackdoorDialog.cs プロジェクト: SES-xuelan/XLAF
 /*
  * Each storyboard function called moment:
  * CreateScene     => after finish load scene before play enter animation(only call after load from prefab or asset bundle, read cache from MgrScene will not called).
  * WillEnterScene => after CreateScene, at the begin of play enter animation.
  * EnterScene     => at the end of play enter animation.
  *
  * WillExitScene  => at the begin of play exit animation.
  * ExitScene      => at the end of play exit animation.
  * DestroyScene   => when destroy the scene(before destroy).
  *
  * OverlayBegan   => when scene overlaid(only XLAF dialog).
  * OverlayEnded   => when scene overlaid object disappear(only XLAF dialog).
  * AndroidGoBack  => in Android, user press back button.
  * UpdateLanguage => when update language or after CreateScene.
  */
 public override void CreateScene(object obj)
 {
     BindAllButtonsClickEvent();
     callback   = (Action <bool, string>)obj;
     inputField = ModUIUtils.GetChild <InputField> (transform, "cmd");
 }