コード例 #1
0
        public Crystal(string id, Vector2 nPos, Vector2 fieldDimensions, gameMain parent)
        {
            //Type: 7% chance of being a void crystal, change later for smarter generation and conflict resolution?
            var crystalTypes = Random.Range(0, 100);

            Type   = crystalTypes < 7 ? 0 : 1;
            NameId = id;

            //Grants model manager
            Model = AssetManager.GetModels[0];            //Resources.Load("Crystals/Prefabs/01_crystal") as GameObject;
            //Do we have a GetTextures part for it?
            Mat = Resources.Load("Crystals/Materials/Crystal01-Grey", typeof(Material)) as Material;

            //Set get it ready for the world
            Model.GetComponent <Renderer>().material = Mat;

            //Want in, but need it to be changed.
            CrystalRotation = new Vector3(Random.Range(0.2f, 0.4f), Random.Range(0.1f, 0.3f), Random.Range(0.05f, 0.2f));

            lock (CrystalLock) {
                Tesseract = Object.Instantiate(Model);
                //tesseract.transform.SetParent(Camera.current.transform);
                Tesseract.transform.SetParent(parent.gameObject.transform);
                Tesseract.layer = parent.gameObject.layer;
                Tesseract.name  = "crystal:" + NameId;

                //rotationAngle = new Vector3(Random.Range(0.5f,2.0f)-1.0f, Random.Range(0.5f,2.0f)-1.0f, Random.Range(0.5f,2.0f)-1.0f);
                RotationAngle = new Vector3(0.0f, 1.0f, 0.0f);

                FixPosition(nPos, fieldDimensions);

                Tesseract.GetComponent <Renderer> ().material.color = VisitColors [Type];
                Tesseract.transform.Rotate(new Vector3(-45.0f, 0.0f, 0.0f));
            }
        }
コード例 #2
0
        public void init(string server_config_url, string server_ip, uint server_id, uint port, uint uid, uint clnt, string token, string mainConfig)
        {
            LGPlatInfo.inst.firstAnalysisPoint(server_id, uid);
            gameST.loadBaseData();
            DebugTrace.Printf(os.sys.windowWidth + "," + os.sys.windowHeight, new string[0]);
            Variant variant = new Variant();

            variant["server_config_url"]         = server_config_url;
            variant["server_id"]                 = server_id;
            variant["mainConfig"]                = mainConfig;
            variant["outgamevar"]                = new Variant();
            variant["outgamevar"]["server_ip"]   = server_ip;
            variant["outgamevar"]["server_port"] = port;
            variant["outgamevar"]["uid"]         = uid;
            variant["outgamevar"]["token"]       = token;
            variant["outgamevar"]["clnt"]        = clnt;
            debug.Log("初始化进来.............0000000000000000");
            bool flag = this.main == null;

            if (flag)
            {
                this.main = new MuMain();
            }
            this.main.init(variant);
            debug.Log("初始化进来.............1111111111111111");
        }
コード例 #3
0
 public GameEngine(gameMain parent, GameObject globals)
 {
     Parent     = parent;
     GlobalData = globals;
     SetVariables();
     CreateField();
     AbleToMove = true;
     //ThreadPool.QueueUserWorkItem(new WaitCallback(ChangeTexture));
 }
コード例 #4
0
        public void init(Variant parma)
        {
            gameST.loadBaseData();
            bool flag = this.main == null;

            if (flag)
            {
                this.main = new MuMain();
            }
            this.main.init(parma);
        }
コード例 #5
0
        public void init(
            string server_config_url,
            string server_ip,
            uint server_id,
            uint port,
            uint uid,
            uint clnt,
            string token,
            string mainConfig
            )
        {
            //这是第一个埋点
            LGPlatInfo.inst.firstAnalysisPoint(server_id, uid);
            //  LGPlatInfo.inst.logSDKCustomAP("init");
            loadBaseData();

            //test();
            //return;

            //this._debugAvatar();
            //return;

            DebugTrace.Printf("" + os.sys.windowWidth + "," + os.sys.windowHeight);
            //(os.graph as GraphInterfaceImpl).onResize(os.sys.windowWidth, os.sys.windowHeight);
            //(os.graph as GraphInterfaceImpl).defCam2d.depth=99;
            Variant conf = new Variant();

            conf["server_config_url"]         = server_config_url;
            conf["server_id"]                 = server_id;
            conf["mainConfig"]                = mainConfig;
            conf["outgamevar"]                = new Variant();
            conf["outgamevar"]["server_ip"]   = server_ip;
            conf["outgamevar"]["server_port"] = port;
            conf["outgamevar"]["uid"]         = uid;
            conf["outgamevar"]["token"]       = token;
            conf["outgamevar"]["clnt"]        = clnt;

            debug.Log("初始化进来.............0000000000000000");

            Stopwatch a1 = new Stopwatch(); a1.Start();//开始计时

            if (main == null)
            {
                main = new MuMain();
            }

            main.init(conf);
            a1.Stop(); debug.Log("cost init time =" + a1.ElapsedMilliseconds);//终止计时


            debug.Log("初始化进来.............1111111111111111");
        }
コード例 #6
0
        public void init(Variant parma)
        {
            loadBaseData();

            if (main == null)
            {
                main = new MuMain();
            }

            main.init(parma);

            //this._debugAvatar();
        }
コード例 #7
0
 public EndlessModeScript(gameMain parent, GameObject globals) : base(parent, globals)
 {
 }
コード例 #8
0
 public muUIClient(gameMain m) : base(m)
 {
 }
コード例 #9
0
 public muNetCleint(gameMain m) : base(m)
 {
 }
コード例 #10
0
ファイル: muCLientConfig.cs プロジェクト: atom-chen/rongyaojt
 public muCLientConfig(gameMain m) : base(m)
 {
 }
コード例 #11
0
ファイル: OLD - gamePlay.cs プロジェクト: jlw28/Mustache2
        /// <summary>
        /// Initalizes an instance of the game
        /// </summary>
        /// <param name="g"> The form the game will be played on.</param>
        /// <param name="size">The number of tiles that the board will have. n x n </param>
        /// <param name="mode">Specifys the mode of play. World(world 1, 2, 3, ....) or Endless</param>
        public gamePlay(gameMain g, int size, int world, int sub_world)
        {
            score = 0; //beginning score to zero
            timer = 30; // Starting time 30 secs
            lives = 2;
            n = size; //size of tile board - nxn

            ////Lives label generation
            fpanel_Lives = new System.Windows.Forms.FlowLayoutPanel();
            fpanel_Lives.Location = new Point(1, 1);
            fpanel_Lives.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left));
            fpanel_Lives.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight;
            for (int i = 0; i < 3; ++i)
            {
                System.Windows.Forms.PictureBox tmp = new System.Windows.Forms.PictureBox();
                tmp.Image = global::Mustache_ic___V2.Properties.Resources.lives;
                tmp.Size = new Size(50, 50);
                fpanel_Lives.Controls.Add(tmp);
            }

            //timer label generation
            label_timer = new System.Windows.Forms.Label();
            label_timer.Text = timer.ToString();
            label_timer.TextAlign = ContentAlignment.TopCenter;
            label_timer.Font = new System.Drawing.Font("Comic Sans MS", 16F, FontStyle.Bold);
            label_timer.Location = new System.Drawing.Point(g.Width/2 - label_timer.Width, 1);
            label_timer.Anchor = System.Windows.Forms.AnchorStyles.Top;
            //score label generation
            label_score = new System.Windows.Forms.Label();
            label_score.Text = score.ToString();
            label_score.TextAlign = ContentAlignment.TopRight;
            label_score.Font = new System.Drawing.Font("Comic Sans MS", 16F, FontStyle.Bold);
            label_score.Location = new System.Drawing.Point(g.Width-label_score.Width-10, 1);
            label_score.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right));
            //tile panel generation
            panel_tile_holder = new System.Windows.Forms.Panel();
            panel_tile_holder.Size = new System.Drawing.Size(g.Width, g.Height);
            panel_tile_holder.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left));
            //panel_tile_holder.AutoSize = true;
            panel_tile_holder.Location = new System.Drawing.Point(0, 100);

            g.Controls.Add(panel_tile_holder);
            g.Controls.Add(fpanel_Lives);
            g.Controls.Add(label_timer);
            g.Controls.Add(label_score);

            mode = world;
            sub_mode = sub_world;
            //Initalize static members of tileclass
            tileClass.setAnimalType(world);
            tileClass.correctTileCount = 0;
            tileClass.totalTileCount = 0;

            correctTileSelected = 0;
            totalTileSelected = 0;

            init_Tile_Dimension();
            init_board(); //initializes the board
            //hide_speed = 3;//How quickly tiles hide, 0 - 3 secs

            rand = new Random();  //needed for random generation
            count = rand.Next(hide_speed); //get random tile wait time
            hiddenList = new Queue<Tuple<int, int>>(); //initalizes queue to hold the hidden tiles
        }
コード例 #12
0
 public muLGClient(gameMain m) : base(m)
 {
     Screen.sleepTimeout = SleepTimeout.NeverSleep;
 }
コード例 #13
0
 public muLGClient(gameMain m) : base(m)
 {
     Screen.sleepTimeout = -1;
 }
コード例 #14
0
 public muGRClient(gameMain m)
     : base(m)
 {
 }