Esempio n. 1
0
 void Start()
 {
     Globle.readLevelData();
     Globle.levelIndex = 0;
     startButton.SetBool("hidden", false);
     exitButton.SetBool("hidden", false);
 }
Esempio n. 2
0
    private void Start()
    {
        Debug.Log("开始Demo");
        Debug.Log("开始....加载xml数据...............");
        new URLReqImpl
        {
            dataFormat = "binary",
            url        = "staticdata/staticdata.dat"
        }.load(delegate(IURLReq url_req, object ret)
        {
            Debug.Log("demo 加载数据xml...............");
            byte[] d            = ret as byte[];
            ByteArray byteArray = new ByteArray(d);
            byteArray.uncompress();
            XMLMgr.instance.init(byteArray);
        }, null, delegate(IURLReq url_req, string err)
        {
            Debug.Log("加载staticdata 失败。。。。。。。。。。。。" + url_req.url);
        });
        Globle.Init_DEFAULT();
        Globle.A3_DEMO = true;
        Application.targetFrameRate = 60;
        new CrossApp(true);
        CrossApp.singleton.regPlugin(new gameEventDelegate());
        CrossApp.singleton.regPlugin(new processManager());
        Screen.SetResolution(Screen.width, Screen.height, true);
        SceneCamera.Init();
        SelfRole.Init();
        Variant variant = new Variant();

        variant["id"]         = 1;
        GRMap.changeMapTimeSt = 7;
        GRMap.loading         = false;
        GameRoomMgr.getInstance().onChangeLevel(variant, null);
    }
Esempio n. 3
0
 public DicUnitResponse(NoDataOptions options, Globle globle, WDbContext wDbContext) : base(options)
 {
     DicUnits        = DefaultDatabase.GetCollection <DicUnit>(DicUnit.DicUnitTableName);
     this.globle     = globle;
     dicBckFolder    = globle.GetGlobleFolder <DicBckFolder>();
     this.wDbContext = wDbContext;
 }
Esempio n. 4
0
 public UserResponse(WDbContext dbContext,
                     UserManager <SUser> userManager,
                     SignInManager <SUser> signInManager,
                     RoleManager <SRole> roleManager,
                     STokenProvider tokenProvider,
                     Globle globle)
     : base(dbContext)
 {
     _userManager        = userManager;
     _signInManager      = signInManager;
     _roleManager        = roleManager;
     _tokenProvider      = tokenProvider;
     _globle             = globle;
     _headPortraitFolder = _globle.GetGlobleFolder <HeadPortraitFolder>();
 }
Esempio n. 5
0
    void Start()
    {
        // 获取关卡数据
        this.levelData       = Globle.getLevelData();
        this.levelBackground = (int)Mathf.Clamp(Globle.getLevelBackground(), 0, backgroundList.Length - 1);

        // 设置背景
        this.background = GameObject.Find("Background");
        this.background.GetComponent <SpriteRenderer>().sprite = backgroundList[levelBackground];

        // 创建弹球
        GameObject     newBall           = (GameObject)Instantiate(ball, new Vector3(0, 0.6f, 0), Quaternion.identity);
        BallController newBallController = newBall.GetComponent <BallController>();

        newBall.transform.SetParent(this.transform);
        newBallController.speed = new Vector3(0, -3.6f, 0);
        this.ballNumber         = 1;

        // 创建砖块
        GameObject tempBrick = (GameObject)Instantiate(brick, new Vector3(0, 0, 0), Quaternion.identity);
        Renderer   r         = tempBrick.GetComponent <Renderer>();

        Globle.brickHeight = r.bounds.extents.y * 2.0f;
        Globle.brickWidth  = r.bounds.extents.x * 2.0f;
        Destroy(tempBrick);
        this.brickNumber = 0;
        for (int row = 0; row <= this.levelData.Count - 1; row++)
        {
            for (int col = 0; col <= this.levelData[row].Count - 1; col++)
            {
                int type = this.getBrickType(row, col);
                if (type >= 0)
                {
                    this.createBrick(type, row, col);
                }
            }
        }
    }
Esempio n. 6
0
File: Startup.cs Progetto: ewsq/Unit
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddResponseCompression(options =>
            {
                options.Providers.Add <GzipCompressionProvider>();
                options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
                    new[] { "image/png", "image/jpg", "text/json" });
            });
            services.Configure <GzipCompressionProviderOptions>(options =>
            {
                options.Level = CompressionLevel.Fastest;
            });
            services.AddDbContext <WDbContext>();
            services.AddDefaultIdentity <SUser>(options =>
            {
                options.Password.RequireDigit   = options.Password.RequireLowercase = options.Password.RequireNonAlphanumeric = options.Password.RequireUppercase = false;
                options.Password.RequiredLength = 6;
            }).AddRoles <SRole>()
            .AddEntityFrameworkStores <WDbContext>();
            var globle = new Globle();

            globle.RegisterFolder <HeadPortraitFolder>();
            globle.RegisterFolder <DicBckFolder>();
            services.AddSingleton(globle);
            var noSqlOpt = new NoDataOptions(MongoClientSettings.FromUrl(new MongoUrl(Configuration["dbConnection:nosql:connection"])));

            services.AddSingleton(noSqlOpt);
            services.AddSingleton(new WordsBrench(noSqlOpt));

            services.AddResponses();
            var issuer = Configuration["issuer"];

            services.AddJwt(options =>
            {
                options.UseHttps      = false;
                options.SecretKey     = Key;
                options.Issuer        = issuer;
                options.Audience      = issuer;
                options.ValidIssuer   = issuer;
                options.ValidAudience = issuer;
            });
            var signingKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Key));
            var op         = new TokenProviderOptions()
            {
                Issuer             = issuer,
                Audience           = issuer,
                ValidFor           = TimeSpan.FromHours(6),
                SigningCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256)
            };

            services.AddSingleton(op);
            services.AddSingleton(new STokenProvider(op));
            services.AddAuthorization(options =>
            {
                options.AddPolicy("Admin", builder => builder.RequireClaim("Role"));
            });
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
            services.AddCors(options =>
            {
                options.AddDefaultPolicy(builder =>
                {
                    builder.WithOrigins("http://localhost:4200", "http://localhost:4200/api/v1").AllowAnyHeader().AllowAnyMethod().AllowCredentials();
                });
            });
            //Task.Run(() =>
            //{
            //    var b = new WordsBrench(noSqlOpt);
            //    var du = new DicUnit()
            //    {
            //        Title = "sd",
            //        Words = b.ws.Select(wx => new WordUnit(wx.Item1, wx.Item2)).ToArray()
            //    };
            //    var Client = new MongoClient(noSqlOpt.LinkSettings);
            //    var DefaultDatabase = Client.GetDatabase(NoDataResponseBase.DefaultDbName);
            //    var d = DefaultDatabase.GetCollection<DicUnit>(DicUnit.DicUnitTableName);

            //    d.InsertOne(du);
            //}).Wait();
            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration =>
            {
                configuration.RootPath = "ClientApp/dist";
            });
        }
Esempio n. 7
0
 public override void FireEvent()
 {
     Globle.setTimeScale(this.m_ftimeScale);
 }
Esempio n. 8
0
 public void Start()
 {
     Globle.Get <LuaFunction>("InitMgr").Call();
     Globle.Get <LuaFunction>("Start").Call();
 }