Example #1
0
 public void PlayElevatorScene(string floorName)
 {
     Debug.Log(floorName);
     nextLevel = floorName;
     state.SwitchTo();
     screen.material   = elevatorMaterial;
     movie.onFinished += EndElevatorScene;
     movie.Play();
 }
Example #2
0
    public static void PlayById(int id, Action callback = null, bool willDestroy = true)
    {
        var table = Table.GetStory(id);

        if (null != table)
        {
            if (0 == table.AnimType)
            {
                PlayMovie.Play(table.Path, callback, 1 == table.IsPassAnimation);
            }
            else
            {
                Instance.PlayCGFile(table.Path, callback, 1 == table.IsPassAnimation, willDestroy);
            }
            curPlayPath = table.Path;
            PlatformHelper.UMEvent("PlayCG", "play", table.Path);
        }
    }
Example #3
0
    private void Update()
    {
#if !UNITY_EDITOR
        try
        {
#endif

#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.Alpha0))
        {
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.MissionTip, new MissionTipArguments(2)));
        }
        else if (Input.GetKeyDown(KeyCode.Minus))
        {
            if (UIManager.Instance.UiVisible(UIConfig.NewStrongUI))
            {
                EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.NewStrongUI));
            }
            else
            {
                EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.NewStrongUI,
                                                                         new StrongArguments()));
            }
        }
        else if (Input.GetKeyDown(KeyCode.O))
        {
            EventDispatcher.Instance.DispatchEvent(new UIEvent_FixIphoneX(-1));
        }
        else if (Input.GetKeyDown(KeyCode.P))
        {
            EventDispatcher.Instance.DispatchEvent(new UIEvent_FixIphoneX(1));
        }
        else if (Input.GetKeyDown(KeyCode.Comma))
        {
        }
        else if (Input.GetKeyDown(KeyCode.F1))
        {
            //GuideManager.Instance.StopGuiding();
            //GuideManager.Instance.StartGuide(1);
        }
        else if (Input.GetKeyDown(KeyCode.F2))
        {
            PlayCG.Instance.PlayCGFile(VideoFile);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            int[] Test = { 10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011 };
            EventDispatcher.Instance.DispatchEvent(new Event_AchievementTip(Test[UnityEngine.Random.RandomRange(0, Test.Length)]));
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            MissionManager.Instance.StartDialog(90);

//			MissionManager.Instance.ChangedSceneByMission(200, 17);
//          var arg = new StoreArguments() { Type = 14 };
//          Show_UI_Event e = new Show_UI_Event(UIConfig.CustomShopFrame, arg);
//          EventDispatcher.Instance.DispatchEvent(e);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha9))
        {
            GameUtils.GotoUiTab(19, 1);
//             var arg = new StoreArguments() { Type  = 104};
//             Show_UI_Event e = new Show_UI_Event(UIConfig.StoreEquip, arg);
//             EventDispatcher.Instance.DispatchEvent(e);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha8))
        {
            //EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.AcientBattleFieldFrame));
            //GameUtils.GotoUiTab(19, 0);
            var e = new Show_UI_Event(UIConfig.DungeonResult, new DungeonResultArguments
            {
                FubenId   = 6,
                Second    = 100,
                DrawId    = 0,
                DrawIndex = 1,
                EraId     = 1
            });
            EventDispatcher.Instance.DispatchEvent(e);
//             var arg = new CharacterArguments() {Tab = -1};
//             Show_UI_Event e = new Show_UI_Event(UIConfig.CharacterUI,arg);
//             EventDispatcher.Instance.DispatchEvent(e);
//             var arg = new EquipUIArguments() { Tab = 1 };
//             var e = new Show_UI_Event(UIConfig.EquipUI, arg);
//             EventDispatcher.Instance.DispatchEvent(e);
//             var e = new Show_UI_Event(UIConfig.BattleResult, new BattleResultArguments
//             {
//                 DungeonId = 2000,
//                 BattleResult = 1,
//                 First = 0
//             });
//             EventDispatcher.Instance.DispatchEvent(e);
//             SkillEquipMainUiAnime e = new SkillEquipMainUiAnime(4,1);
//             EventDispatcher.Instance.DispatchEvent(e);

//             var objId = ObjManager.Instance.MyPlayer.GetObjId();
//             PlayerDataManager.Instance.ApplyCharacterSimpleInfo(objId, (PlayerInfoMsg info) =>
//             {
//                 Show_UI_Event e = new Show_UI_Event(UIConfig.PlayerInfoUI, info);
//                 EventDispatcher.Instance.DispatchEvent(e);
//             });
            //EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard("asdfasdf"));
            //EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.EquipInfoUI, 210407));
        }
        else if (Input.GetKeyDown(KeyCode.Alpha7))
        {
            UIManager.Instance.DestoryCloseUi();
//             TestChat = new ChatMessageDataModel()
//             {
//                 Type = (int)eChatChannel.World,
//                 Content = "",
//                 SoundData = new byte[]{},
//                 Name = "asdf",
//                 CharId = 0ul,
//             };
//             EventDispatcher.Instance.DispatchEvent(new Event_PushMessage(TestChat));
//             EventDispatcher.Instance.DispatchEvent(e);
//            GameUtils.ShowHintTip("adfasdfefe");
//             P1vP1Change_One one = new P1vP1Change_One();
//             one.Type = 0;
//             one.NewRank = 101;
//             one.OldRank = 102;
//             one.Name = "adfdsf";
//             ArenaFightRecoardChange e = new ArenaFightRecoardChange(one);
//             EventDispatcher.Instance.DispatchEvent(e);
//            UIManager.Instance.ShowBlockLayer();
//             var d = new WingArguments();
//             d.Tab = 1;
//             Show_UI_Event e = new Show_UI_Event(UIConfig.WingUI,d);
//             EventDispatcher.Instance.DispatchEvent(e);
//             Show_UI_Event e = new Show_UI_Event(UIConfig.BattleUI);
//             EventDispatcher.Instance.DispatchEvent(e);
            var e1 = new ChatMainHelpMeesage("asdfasdfasdf");
            EventDispatcher.Instance.DispatchEvent(e1);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha6))
        {
//             BuffResult result = new BuffResult();
//             result.Type = BuffType.HT_REBOUND;
//             result.Damage = 100;
//             result.TargetObjId = ObjManager.Instance.MyPlayer.GetObjId();
//             var e = new ShowDamageBoardEvent(ObjManager.Instance.MyPlayer.Position, result);
//             EventDispatcher.Instance.DispatchEvent(e);
//             TestChat.Content = "adsfadsfasfdeasdfeadsfeadfe";
//             EventDispatcher.Instance.DispatchEvent(new ChatVoiceContent(TestChat));
            //UIManager.Instance.ShowBlockLayer(1);
//             var d = new WingArguments();
//             d.Tab = 0;
//             Show_UI_Event e = new Show_UI_Event(UIConfig.WingUI,d);
//             EventDispatcher.Instance.DispatchEvent(e);
            // EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.BattleUnionUI));

            //UIManager.Instance.RemoveBlockLayer();
            GameUtils.GotoUiTab(92, -1, Item);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            UIManager.Instance.ShowBlockLayer();
//            UIManager.Instance.ShowMessage(MessageBoxType.Ok, "adffd","adsfasdf");
/*            UIManager.Instance.RemoveBlockLayer();*/
//             var d = new ComposeArguments();
//             d.Tab = 102;
//             Show_UI_Event e = new Show_UI_Event(UIConfig.ComposeUI, d);
//             EventDispatcher.Instance.DispatchEvent(e);
            //EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.AstrologyUI));
        }
        else if (Input.GetKeyDown(KeyCode.Alpha4))
        {
//             Show_UI_Event e = new Show_UI_Event(UIConfig.ReliveUI, Game.Instance.ServerTime.AddSeconds(60));
//                         EventDispatcher.Instance.DispatchEvent(e);
//                         var list = new List<int> { 100, 0, 1 };
//                         EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.DungeonResult, list));
//            NetManager.Instance.StartCoroutine(TestNetCoroutine());
//             var d = new CharacterArguments();
//             d.Tab = 0;
//             Show_UI_Event e = new Show_UI_Event(UIConfig.CharacterUI, d);
//             EventDispatcher.Instance.DispatchEvent(e);
// //             SkillEquipMainUiAnime e = new SkillEquipMainUiAnime(4, 0);
//              EventDispatcher.Instance.DispatchEvent(e);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            if (!string.IsNullOrEmpty(MoviePath))
            {
                PlayMovie.Play(MoviePath);
            }
        }
        else if (Input.GetKeyDown(KeyCode.F3))
        {
            Game.Instance.ExitToSelectRole();
        }
        else if (Input.GetKeyDown(KeyCode.F4))
        {
            if (null != DebugHelper.helperInstance)
            {
                var console = DebugHelper.helperInstance.GetComponent <DevConsole.Console>();
                console.PrintInput("!!SpeedSet,300");
            }
        }
        else if (Input.GetKeyDown(KeyCode.F5))
        {
            Game.Instance.ExitToLogin();
        }
        else if (Input.GetKeyDown(KeyCode.F6))
        {
            var args = new UIInitArguments();
            args.Args = new List <int>();
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.EraAchievementUI, args));
//             EventDispatcher.Instance.DispatchEvent(new System_Notice_Event("1196306"));
        }
        else if (Input.GetKeyDown(KeyCode.F7))
        {
            var args = new UIInitArguments();
            args.Args = new List <int>();
            args.Args.Add(1);
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.EraGetNoticeUI, args));

            //ObjManager.Instance.MyPlayer.PopTalk("fdasfdsafdsa");
        }
        else if (Input.GetKeyDown(KeyCode.F8))
        {
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.OperationActivityFrame));
        }
        else if (Input.GetKeyDown(KeyCode.F9))
        {
            //GameUtils.GotoUiTab(80, 0);
            var player = ObjManager.Instance.MyPlayer;
            PlayerDataManager.Instance.mInitBaseAttr.ModelId = 700;
            if (player == null)
            {
                return;
            }
            player.ModelId = 700;
        }
        else if (Input.GetKeyDown(KeyCode.F10))
        {
            var player = ObjManager.Instance.MyPlayer;
            PlayerDataManager.Instance.mInitBaseAttr.ModelId = -1;
            if (player == null)
            {
                return;
            }
            player.ModelId = -1;
            //EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.P1VP1Frame));
        }
        else if (Input.GetKeyDown(KeyCode.Home))
        {
            if (btest == false)
            {
                var e = new Show_UI_Event(UIConfig.CharacterUI);
                EventDispatcher.Instance.DispatchEvent(e);
            }
            else
            {
                var e = new Close_UI_Event(UIConfig.CharacterUI);
                EventDispatcher.Instance.DispatchEvent(e);
            }
            btest = !btest;
        }
        else if (Input.GetKeyDown(KeyCode.End))
        {
            PlayerDataManager.Instance.HoldLode(242010);
        }
        else if (Input.GetKeyDown(KeyCode.PageDown))
        {
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.FieldMineUI));
        }
        else if (Input.GetKeyDown(KeyCode.Backspace))
        {
            //    var arg = new SmithyFrameArguments();
            //    arg.Tab = 1;
            //    arg.BuildingData = CityManager.Instance.BuildingDataList[0];
            //    var e = new Show_UI_Event(UIConfig.SmithyUI, arg);
            //    EventDispatcher.Instance.DispatchEvent(e);
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.ChickenFightUI));
        }
        else if (Input.GetKeyDown(KeyCode.Keypad0))
        {
            PlayerDataManager.Instance.InputControlHPEffect = true;
        }
        else if (Input.GetKeyDown(KeyCode.Keypad1))
        {
            PlayerDataManager.Instance.InputControlHPEffect = false;
        }
        else if (Input.GetKeyDown(KeyCode.Keypad2))
        {
            EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.FieldFinalUI));
        }
#endif

#if UNITY_STANDALONE
        Vector2 v = new Vector2();
        if (Input.GetKey(KeyCode.W))
        {
            v.y = 1;
        }
        if (Input.GetKey(KeyCode.A))
        {
            v.x = -1;
        }
        if (Input.GetKey(KeyCode.S))
        {
            v.y = -1;
        }
        if (Input.GetKey(KeyCode.D))
        {
            v.x = 1;
        }
        if (v.x != 0 || v.y != 0)
        {
            MoveDirection(v);
        }
        if (Input.GetKeyUp(KeyCode.J))
        {
            OnClickEvent(0, -1);
        }
        else
        {
            int idx = -1;
            if (Input.GetKeyUp(KeyCode.U))
            {
                idx = 0;
            }
            else if (Input.GetKeyUp(KeyCode.I))
            {
                idx = 1;
            }
            else if (Input.GetKeyUp(KeyCode.O))
            {
                idx = 2;
            }
            else if (Input.GetKeyUp(KeyCode.P))
            {
                idx = 3;
            }
            var skill = PlayerDataManager.Instance.PlayerDataModel.SkillData.EquipSkills;
            if (null != skill && idx >= 0 && idx < skill.Count)
            {
                OnClickEvent(1, skill[idx].SkillId);
            }
        }
#endif
        Executer.Update();


#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }