Example #1
0
 protected override bool InitActions(GameActionStore actionStore)
 {
     actionStore.RegisterAction("ACTION_DEBUG_CORE", TAG, (param) =>
     {
         StartDebugCore((GameObject)param[0]);
         return(GameActionCallResult.CreateActionCallResult(true));
     }, new string[] { "UnityEngine.GameObject" });
     return(base.InitActions(actionStore));
 }
Example #2
0
        private GameActionCallResult OnCallUnLoadLevel(params object[] param)
        {
            if (levelLoadStatus == LevelLoadStatus.Loading || levelLoadStatus == LevelLoadStatus.UnLoading)
            {
                GameErrorManager.LastError = GameError.InProgress;
                return(GameActionCallResult.CreateActionCallResult(false));
            }
            if (levelLoadStatus == LevelLoadStatus.Loaded)
            {
                QuitLoader();


                return(GameActionCallResult.CreateActionCallResult(true));
            }
            else
            {
                GameErrorManager.LastError = GameError.NotLoad;
                return(GameActionCallResult.CreateActionCallResult(false));
            }
        }
Example #3
0
        private GameActionCallResult OnCallLoadLevel(params object[] param)
        {
            if (levelLoadStatus == LevelLoadStatus.Loading || levelLoadStatus == LevelLoadStatus.UnLoading)
            {
                GameErrorManager.LastError = GameError.InProgress;
                return(GameActionCallResult.CreateActionCallResult(false));
            }
            if (levelLoadStatus != LevelLoadStatus.NotLoad)
            {
                GameErrorManager.LastError = GameError.AlredayLoaded;
                return(GameActionCallResult.CreateActionCallResult(false));
            }

            string pathOrName = (string)param[0];
            string levelPath  = "";
            int    number;

            if (int.TryParse(pathOrName, out number))
            {
                if (number < 15)
                {
                    levelPath = GamePathManager.GetResRealPath("core", "levels/Level" + number + ".ballance");
                }
            }
            else
            {
                if (GamePathManager.IsAbsolutePath(pathOrName))
                {
                    levelPath = pathOrName;
                }
                else
                {
                    levelPath = GamePathManager.GetResRealPath("level", pathOrName);
                }
            }

            EnterLoader();
            StartCoroutine(LoadLevel(levelPath));
            return(GameActionCallResult.CreateActionCallResult(true));
        }
Example #4
0
 private GameActionCallResult OnCallStartDebugLevelLoader(params object[] param)
 {
     //...
     return(GameActionCallResult.CreateActionCallResult(true));
 }
Example #5
0
 protected override bool InitActions(GameActionStore actionStore)
 {
     actionStore.RegisterActions(
         new string[] {
         "StartControll", "EndControll", "PlaySmoke", "PlayLighting", "RemoveBallSpeed",
         "AddBallPush", "RemoveBallPush", "RecoverSetPos", "RecoverBallDef", "RecoverBallAtPos", "ActiveBall", "ActiveBallDef",
         "ClearActiveBall", "SmoothMoveBallToPos", "ThrowPieces", "RecoverPieces", "RegisterBall", "UnRegisterBall", "GetRegisteredBall",
     },
         TAG, new GameActionHandlerDelegate[] {
         (param) =>
         {
             StartControll();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             EndControll();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             PlaySmoke();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             PlayLighting((bool)param[0], (bool)param[1]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             RemoveBallSpeed((GameBall)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             AddBallPush((BallPushType)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             RemoveBallPush((BallPushType)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             RecoverSetPos((Vector3)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             RecoverBallDef();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             RecoverBallAtPos((Vector3)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             ActiveBall((string)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             ActiveBallDef();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             ClearActiveBall();
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             SmoothMoveBallToPos((Vector3)param[0]);
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             if (param[0] is string)
             {
                 ThrowPieces(param[0] as string);
             }
             else if (param[0] is GameBall)
             {
                 ThrowPieces(param[0] as GameBall);
             }
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             if (param[0] is string)
             {
                 RecoverPieces(param[0] as string);
             }
             else if (param[0] is GameBall)
             {
                 RecoverPieces(param[0] as GameBall);
             }
             return(GameActionCallResult.SuccessResult);
         },
         (param) =>
         {
             return(GameActionCallResult.CreateActionCallResult(
                        RegisterBall((string)param[0], (GameBall)param[1], (GameObject)param[2])
                        ));
         },
         (param) =>
         {
             return(GameActionCallResult.CreateActionCallResult(UnRegisterBall((string)param[0])));
         },
         (param) =>
         {
             return(GameActionCallResult.CreateActionCallResult(
                        true,
                        new object[] {
                 GetRegisteredBall((string)param[0])
             }
                        ));
         },
     },
         new string[][]
     {
         null,
         null,
         null,
         new string[] { "System.Boolean", "System.Boolean" },
         new string[] { "Ballance2.CoreGame.GamePlay.GameBall" },
         new string[] { "Ballance2.CoreGame.GamePlay.BallPushType" },
         new string[] { "Ballance2.CoreGame.GamePlay.BallPushType" },
         new string[] { "UnityEngine.Vector3" },
         null,
         new string[] { "UnityEngine.Vector3" },
         new string[] { "System.String" },
         null,
         null,
         new string[] { "UnityEngine.Vector3" },
         new string[] { "System.String/Ballance2.CoreGame.GamePlay.BallPushType" },
         new string[] { "System.String/Ballance2.CoreGame.GamePlay.BallPushType" },
         new string[] { "System.String", "Ballance2.CoreGame.GamePlay.BallPushType", "UnityEngine.GameObject/null" },
         new string[] { "System.String" },
         new string[] { "System.String" },
     }
         );
     return(base.InitActions(actionStore));
 }