Beispiel #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);
//			}
//		});
    }
Beispiel #2
0
 public override void EnterScene(object obj)
 {
     ModDispatcher.Dispatch("dia2", "123546");
 }