Exemple #1
0
        static void Main(string[] args)
        {
            bool          isReady = false;
            MasterControl play    = new MasterControl();

            Console.WriteLine("--------------------------------------------EX TEMPORE------------------------------------------");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("-------------------------------------presiona enter para jugar-----------------------------------");
            do
            {
                while (!Console.KeyAvailable)
                {
                    isReady = true;
                }
            } while (Console.ReadKey(true).Key != ConsoleKey.Enter);
            if (isReady == true)
            {
                play.play();
            }
        }
 // initialize BML by reseting time, loading BML script
 void Start()
 {
     currentEvent = gameObject.GetComponent <MasterControl>();
     startTime    = Time.time;
     xml.LoadXml(file.text);
     root = xml.FirstChild;
 }
Exemple #3
0
        /// <summary>创建主从关系
        ///
        /// </summary>
        public void CreateMasterDetailView()
        {
            var oDataSet = GetData();

            _masterDetail = new MasterControl(oDataSet, ControlType.Middle);
            panelView.Controls.Add(_masterDetail);
        }
    // Update is called once per frame
    public void summonToField(GameObject ObjectToCopy)
    {
        // if (counter == 0)
        // {


        Renderer[] rendererComponents = GetComponentsInChildren <Renderer>(true);
        Collider[] colliderComponents = GetComponentsInChildren <Collider>(true);


        // Enable rendering:

        foreach (Renderer component in rendererComponents)
        {
            // A print statement here prints out multiple times as long as card is in view

            //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field");

            component.enabled = true;
        }


        // Enable colliders:
        foreach (Collider component in colliderComponents)
        {
            component.enabled = true;
        }

        this.SpawnObject = ObjectToCopy;
        SpawnPoint       = GameObject.Find("Spawn"); // add a function that allocates spawn location
        int        spawn_state = 1;
        GameObject tempGameObject;


        tempGameObject = Instantiate(this.SpawnObject, this.SpawnPoint.transform.position, this.SpawnPoint.transform.rotation) as GameObject;
        tempGameObject.transform.parent = this.transform;


        // ---------------------------- Temporary Code (Must Replace in Future Development -----------------------------

        // Only for Blue Eyes (future work is to have an external script to call from that will store values)
        tempGameObject.transform.localScale = new Vector3(0.01F, 0.01F, 0.01F);

        GameObject Kuribo_temp = GameObject.Find("DE_temp");  // Uses temp Kuribo as GameObject, must remove as soon as possible
        //batManage = GetComponent("battleManage") as battleManage;

        MonsterTraits spawn_trait = tempGameObject.GetComponent("MonsterTraits") as MonsterTraits;

        spawn_trait.cslot = spawn_state;

        //GameObject master_ob = GameObject.Find("MasterObject");
        MasterControl master_ctrl = GameObject.Find("MasterObject").GetComponent("MasterControl") as MasterControl;

        Debug.Log("master_ctrl is: " + master_ctrl);
        master_ctrl.engageBattlePhase(tempGameObject, Kuribo_temp);

        //batManage.battlePhase(tempGameObject, Kuribo_temp);
        // ----------------------------------------------------------------------------------------------
    }
        private void OnTrackingFound()
        {
            master      = GameObject.Find("MasterObject");
            master_cont = master.GetComponent("MasterControl") as MasterControl;
            //Debug.Log("master: " + master);
            //Debug.Log("master_cont: " + master_cont);
            //Debug.Log("cont: " + master_cont.mode);
            Renderer[] rendererComponents = GetComponentsInChildren <Renderer>(true);
            Collider[] colliderComponents = GetComponentsInChildren <Collider>(true);


            foreach (Renderer component in rendererComponents)
            {
                // A print statement here prints out multiple times as long as card is in view

                //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field");

                component.enabled = true;
            }

            // Enable colliders:
            foreach (Collider component in colliderComponents)
            {
                component.enabled = true;
            }



            summon = field.GetComponent("SpawnScript") as SpawnScript;

            if (master_cont.mode == 0)
            {
                // If statementt to summon the model only once
                if (counter == 0)
                {
                    summon.summonToField(main_model);
                    counter++;
                }
                foreach (Renderer component in rendererComponents)
                {
                    // A print statement here prints out multiple times as long as card is in view

                    //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field");

                    component.enabled = false;
                }

                // Enable colliders:
                foreach (Collider component in colliderComponents)
                {
                    component.enabled = false;
                }
            }
            Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
        }
Exemple #6
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Exemple #7
0
    void Awake()
    {
        master = this;
        title = this.transform.FindChild("TitleCanvas").gameObject;
        game = this.transform.FindChild("MusicCanvas").gameObject;
        GotoTitle();
        tickRate = (1/(bpm/60))/16;
        //Debug.Log (tickRate);

        cat = this.transform.FindChild("TitleCanvas").FindChild("Background").FindChild("Cat").transform;
    }
        private void OnTrackingFound()
        {
            master = GameObject.Find("MasterObject");
            master_cont = master.GetComponent("MasterControl") as MasterControl;
            //Debug.Log("master: " + master);
            //Debug.Log("master_cont: " + master_cont);
            //Debug.Log("cont: " + master_cont.mode);
            Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(true);
            Collider[] colliderComponents = GetComponentsInChildren<Collider>(true);

            foreach (Renderer component in rendererComponents)
                {
                    // A print statement here prints out multiple times as long as card is in view

                    //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field");

                    component.enabled = true;
                }

                // Enable colliders:
                foreach (Collider component in colliderComponents)
                {
                    component.enabled = true;
                }

            summon = field.GetComponent("SpawnScript") as SpawnScript;

            if (master_cont.mode == 0)
            {
                // If statementt to summon the model only once
                if (counter == 0)
                {
                    summon.summonToField(main_model);
                    counter++;
                }
                foreach (Renderer component in rendererComponents)
                {
                    // A print statement here prints out multiple times as long as card is in view

                    //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field");

                    component.enabled = false;
                }

                // Enable colliders:
                foreach (Collider component in colliderComponents)
                {
                    component.enabled = false;
                }

            }
            Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
        }
 void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #10
0
 /// <summary>创建主从关系
 ///
 /// </summary>
 public void CreateMasterDetailView()
 {
     if (m_dataSet.Tables.Count == 3)
     {
         _masterDetail = new MasterControl(m_dataSet, ControlType.OutSide);
     }
     else if (m_dataSet.Tables.Count == 2)
     {
         _masterDetail = new MasterControl(m_dataSet, ControlType.Middle);
     }
     panelView.Controls.Add(_masterDetail);
 }
Exemple #11
0
    public static void SaveGestureQuantity(MasterControl mastercontrol)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        //string path = Application.persistentDataPath + "/testcontrol.banana";
        string     path   = "C:/Users/Andrei/Documents/Unity Games/Hand Gesture Recognition/GestureAlbums/_gestureQuantity.banana";
        FileStream stream = new FileStream(path, FileMode.Create);

        GestureQuantityData data = new GestureQuantityData(mastercontrol);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Exemple #12
0
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
 private void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
     completedLevels[0] = true; //level 1
 }
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
 void Awake()
 {
     if (control == null)
     {
         DontDestroyOnLoad(gameObject);
         control = this;
     }
     else if (control != this)
     {
         Destroy(gameObject);
     }
     //TEMPORARILY HERE vvv
     OnLevelWasLoaded();
 }
        private void initWork()
        {
            DataSet   ds  = new DataSet();
            DataTable dt1 = source(); dt1.TableName = "T1";
            DataTable dt2 = source(); dt2.TableName = "T2";

            ds.Tables.AddRange(new DataTable[] { dt1, dt2 });
            //这是对应关系的时候主键必须唯一
            ds.Relations.Add("1", ds.Tables["T1"].Columns["序号"], ds.Tables["T2"].Columns["序号"]);

            MasterControl masterDetail;

            masterDetail = new MasterControl(ds, controlType.middle);
            panel1.Controls.Add(masterDetail);
        }
    public GestureBatchData(MasterControl mastercontrol)
    {
        //deep copy of gestureBatch
        int numberOfPics = mastercontrol.gestureBatch.GetLength(0);

        for (int i = 0; i < numberOfPics; i++)
        {
            for (int j = 0; j < 32; j++)             //<32 because the image is 32 pixles wide
            {
                for (int k = 0; k < 24; k++)         //<24 because the image is 24 pixels tall
                {
                    gestureBatch[i, j, k] = mastercontrol.gestureBatch[i, j, k];
                }
            }
        }
    }
Exemple #18
0
 void Awake()
 {
     MasterControl.Instance = this;
     if (!modeTest)
     {
         InputPath = Application.dataPath + "/Input/" + "Subject" + SubjectSettings.instance.SubjectID + ".csv";
         InputFile = new System.IO.StreamReader(InputPath);
     }
     else
     {
         InputPath = Application.dataPath + "/Input/" + "Subject" + SubjectT + ".csv";
         InputFile = new System.IO.StreamReader(InputPath);
     }
     Time_Trials.TrialCounter = 0;
     TrialSettings            = new List <TempStruct>();
     MFW = gameObject.GetComponent <MovementRecorder>();
     PlayerHitbox.transform.localScale = new Vector3(1, 1, 2 * float.Parse(SubjectSettings.instance.ShWidth));
     //temporary function
     MakeArray();
 }
Exemple #19
0
        public void Initialise(MasterControl mc, Action<String> speakHandler, Action ShutupHandler, Action<String> LogHandler)
        {
            Assembly asm = Assembly.GetAssembly(typeof(Command));

            IEnumerable<Type> embeddedTypes = from type in asm.GetTypes()
                                              where typeof(Command).IsAssignableFrom(type) && !type.IsAbstract
                                              select type;

            foreach (Type type in embeddedTypes)
            {
                Command toAdd = Activator.CreateInstance(type) as Command;
                _commands.Add(type.FullName, toAdd);

                toAdd.Target = mc;
                toAdd.OnSilenceRequested += ShutupHandler;
                toAdd.OnSpeak += speakHandler;
                toAdd.OnLog += LogHandler;

                toAdd.Initialise();
            }
        }
        static void Main(string[] args)
        {
            //Console.WriteLine("Presiona cualquier tecla para jugar");
            //Console.ReadKey();
            //Console.Clear();
            MasterControl masterControl = new MasterControl();

            masterControl.run();
            AgregarDecisiones agregacion = new AgregarDecisiones();
            PruebaDecisiones  prueba     = new PruebaDecisiones();



            // Personaje rockstar = new Personaje();
            // rockstar.quitarSeguidores();
            // rockstar.Seguidores = 300;

            // Console.WriteLine("Ahorita tienes " +rockstar.Seguidores + " seguidores");


            // Personaje artista = new Personaje();
            // artista.quitarSeguidores();
            // artista.Seguidores = 100;


            //// var qutarSeg = artista.Seguidores - 10;



            // //StreamWriter historial = new StreamWriter("");
            // //foreach (var a in arrayName)
            // //{
            // //    historial.WriteLine
            // //        historial.Close();
            // //}
        }
    private void Awake()
    {
        isAI      = false;
        playerRef = gameObject;
        color     = new Color(1, 1, 1);
        controls  = new MasterControl();
        controls.Enable();
        controls.Player.MovementAxis.performed += ctr =>
        {
            Vector2 input = ctr.ReadValue <Vector2>();
            targetDirection = input;
        };
        controls.Player.MovementAxis.canceled  += ctr => { targetDirection = new Vector2(); };
        controls.Player.RotateTurret.performed += ctr =>
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            // Save the info
            RaycastHit hit;
            // You successfully hi
            if (Physics.Raycast(ray, out hit, Mathf.Infinity, ~(1 << 14), QueryTriggerInteraction.Collide))
            {
                turretTarget = hit.point;
            }
        };
        controls.Player.XBoxRotateTurret.performed += crt =>
        {
            Vector2 read   = crt.ReadValue <Vector2>();
            Vector3 target = new Vector3(read.x, 0, read.y) * 10 + transform.Find("Tank").position;

            turretTarget = target;
        };
        controls.Player.Fire.performed       += crt => fireEvent.Invoke();
        controls.Player.FireStrong.performed += crt => strongFireEvent.Invoke();
        controls.Player.Shield.performed     += crt => shieldEvent.Invoke();
        controls.Player.Escape.performed     += crt => SceneManager.LoadScene(0);
    }
    void Start()
    {
        currentEvent = gameObject.GetComponent <MasterControl>();
        audioSource  = gameObject.GetComponent <AudioSource>();

        mainCam.transform.position = midView;
        mainSlider.value           = (float)Global.CameraView.MID;
        mainSlider.onValueChanged.AddListener(delegate { CameraChange(); });

        lunaBtn.onClick.AddListener(delegate { SwitchToLuna(); });
        davidBtn.onClick.AddListener(delegate { SwitchToDavid(); });

        preBtn = GameObject.Find("Canvas/Previous").GetComponent <Button>();
        preBtn.onClick.AddListener(delegate { Previous(); });

        nextBtn = GameObject.Find("Canvas/Next").GetComponent <Button>();
        nextBtn.onClick.AddListener(delegate { Next(); });

        debugBtn = GameObject.Find("Canvas/Debug").GetComponent <Button>();
        debugBtn.onClick.AddListener(delegate { ToggleDebugLog(); });

        reloadBtn = GameObject.Find("Canvas/Reload").GetComponent <Button>();
        reloadBtn.onClick.AddListener(delegate { ReloadScene(); });

        pausePlayBtn = GameObject.Find("Canvas/PausePlay").GetComponent <Button>();
        pausePlayBtn.onClick.AddListener(delegate { PausePlayModifier(); });

        XMLTog = GameObject.Find("Canvas/XMLReader").GetComponent <Toggle>();
        XMLTog.onValueChanged.AddListener(delegate { ToggleXMLReader(); });

        BeatTog = GameObject.Find("Canvas/BeatDetect").GetComponent <Toggle>();
        BeatTog.onValueChanged.AddListener(delegate { ToggleBeatDect(); });

        EmotionTog = GameObject.Find("Canvas/EmotionInput").GetComponent <Toggle>();
        EmotionTog.onValueChanged.AddListener(delegate { ToggleEmotionRec(); });
    }
Exemple #23
0
 public Microminer(DataDBContext dbContext)
 {
     dataManager   = new DataManager(dbContext);
     masterControl = new MasterControl();
 }
Exemple #24
0
 void Start()
 {
     mc    = GameObject.Find("MasterControl").GetComponent <MasterControl>();
     mc.dc = this;
     StartCoroutine(DrawableSend());
 }
Exemple #25
0
 /// <summary>清空
 ///
 /// </summary>
 public void Clear()
 {
     panelView.Controls.Clear();
     _masterDetail = null;
     Refresh();
 }
 public PlayerActions(MasterControl wrapper)
 {
     m_Wrapper = wrapper;
 }
Exemple #27
0
        static void Main(string[] args)
        {
            MasterControl mstrcntrl = new MasterControl();

            mstrcntrl.Jugar();
        }
Exemple #28
0
 static void Main(string[] args)
 {
     MasterControl.StartProgram();
 }
Exemple #29
0
        private void frm_staffing_data_Load(object sender, EventArgs e)
        {
            try
            {
                StringBuilder _query;
                DataSet       _ds;

                _ds    = new DataSet();
                _query = new StringBuilder();

                this.WindowState  = FormWindowState.Maximized;
                this.AcceptButton = this.btn_load;

                WeekNumber = Common.GetIso8601WeekOfYear(DateTime.Now);
                //dataGridView1.EnableHeadersVisualStyles = false;

                //dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                //dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Aquamarine;
                //dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.Red;
                //dataGridView1.ColumnHeadersHeight = 30;


                DisplayCheckBoxes();

                _query.AppendLine("SELECT   dbo.GetMonthByWeekNumber(cast(sd_year_start as char(4)),sd_week_start) AS Month, * ");
                _query.AppendLine("  FROM   STAFFING_DATA                                                                      ");
                _query.AppendLine("  INNER JOIN EMPLOYEES ON EM_ID = SD_EM_ID                                                  ");
                _query.AppendLine("  INNER JOIN PROJECTS  ON PJ_ID = SD_PJ_ID                                                  ");
                _query.AppendLine(" WHERE   1 = 1                                                                              ");
                //_query.AppendLine("   AND   sd_week_start = " + WeekNumber);
                _query.AppendLine(" ORDER BY SD_WEEK_START ASC, SD_PJ_ID ASC, EM_NAME ASC                                      ");

                _query.AppendLine("select * from employees");
                Con.Open();

                //SqlDataAdapter da = new SqlDataAdapter("testSP",conn);
                //da.SelectCommand.CommandType = CommandType.StoredProcedure;
                using (SqlDataAdapter da = new SqlDataAdapter(_query.ToString(), Con))
                {
                    da.Fill(_ds);
                }
                _ds.Tables[0].TableName = "STAFFING_DATA";
                _ds.Tables[1].TableName = "EMPLOYEES";

                MasterDetail = new MasterControl(ref _ds); //(ref _ds, false);
                MasterDetail.CellFormatting += _masterDetail_CellFormatting;
                MasterDetail.setParentSource("STAFFING_DATA", "EM_ID");
                MasterDetail.childView.Add("EMPLOYEES", "employees");
                //_masterDetail.childView.Add("EMPLOYEES", "employees");
                //  masterDetail.childView.Add(NwindDataSet.Invoices.TableName, "Invoices")


                this.Controls.Add(MasterDetail);
                MasterDetail.Dock = DockStyle.Fill;
                MasterDetail.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

                String[] _show_columns = { "sd_year_start", "sd_week_start", "Month", "em_name", "em_team", "pj_product_code", "pj_dev_code", "pj_name", "pj_client" };
                String[] _name_columns = { "Year", "Week", "Month", "Emp. Name", "Team", "Product Code", "Dev. Code", "Name", "Client" };

                foreach (DataGridViewColumn _col in MasterDetail.Columns)
                {
                    if (!_show_columns.Contains(_col.Name))
                    {
                        _col.Visible = false;
                    }
                    else
                    {
                        int _index = Array.IndexOf(_show_columns, _col.Name);
                        _col.HeaderText = _name_columns[_index];
                    }
                }
                //_masterDetail.Columns[0].HeaderText = "Month";
                //_masterDetail.Columns["sd_week_start"].DisplayIndex = 1;
                //_masterDetail.Columns["sd_year_start"].DisplayIndex = 2;
                //_masterDetail.Columns[""].DisplayIndex = 1;



                this.Controls.Remove(dataGridView1);
                MasterDetail.BringToFront();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #30
0
 public GestureQuantityData(MasterControl mastercontrol)
 {
     gestureQuantity = mastercontrol.gestureQuantity;
 }
Exemple #31
0
 private void Start()
 {
     gameObject.AddComponent <EmotionUpdate>();
     currentEvent = gameObject.GetComponent <MasterControl>();
     pitchShifter = Resources.Load <AudioMixerGroup>("VoiceMixer");
 }
Exemple #32
0
    void Start()
    {
        offset = transform.position - Player.transform.position;

        instance = this;
    }