예제 #1
0
        private void MinimapClickHandle()
        {
            Ray ray;

            UIHelp.ForwardRaycastThrowUIObject(_minimapScreen, _minimapCamera, Input.mousePosition, out ray);
            Vector2 position = ray.GetPoint(9.7f);

            _mainCameraTransform.position = (Vector3)position - Vector3.forward * 10;
        }
예제 #2
0
 private void Update()
 {
     if (Input.GetButtonDown("MouseClick"))
     {
         if (UIHelp.Contains(_minimapScreen, Input.mousePosition))
         {
             MinimapClickHandle();
         }
     }
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        // get access to some of the different objects
        difficultyDropdown = UIHelp.getAccessTo <Dropdown>("Difficulty");
        levelSizeDropdown  = UIHelp.getAccessTo <Dropdown>("LevelSize");
        movingWallsToggle  = UIHelp.getAccessTo <Toggle>("MovingWalls");

        settingsInfo = Object.FindObjectOfType <SettingsInfo>();

        // store difficulty settings
        if (difficultyDropdown != null && settingsInfo != null)
        {
            settingsInfo.setDifficulty(difficultyDropdown.value);
        }
        else
        {
            Debug.Log("Could Not Find Either Difficulty Dropdown Object Or The Settings Info Object");
            settingsInfo.setDifficulty(0);
        }

        // store level size settings
        if (levelSizeDropdown != null && settingsInfo != null)
        {
            settingsInfo.setLevelSize(levelSizeDropdown.value);
        }
        else
        {
            Debug.Log("Could Not Find Either Level Size Dropdown Object Or The Settings Info Object");
            settingsInfo.setLevelSize(0);
        }

        // store moving wall settings
        if (movingWallsToggle != null && settingsInfo != null)
        {
            settingsInfo.setMovingWalls(movingWallsToggle.isOn);
        }
        else
        {
            Debug.Log("Could Not Find Either Moving Walls Object Or The Settings Info Object");
            settingsInfo.setMovingWalls(false);
        }


        SceneManager.LoadSceneAsync(startScene);         // could assign a variable to this if necessary

        scene = SceneManager.GetSceneByName(startScene);

        Debug.Log(scene.name);
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this);         // want to keep this between scenes

        pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
        if (pss == null)
        {
            Instantiate(playersScoresObj);
            Debug.Log("Instantiated PlayerScoresObj");
            pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
        }

        // set defaults
        difficulty  = 0;
        levelSize   = 0;
        movingWalls = false;
    }
예제 #5
0
    /// <summary>
    /// Allows this class to access the UI elements that are holding the current gamemode combination.
    /// Needs to be called at some point after they exist and before this class tries to access them.
    /// </summary>
    private void InitAccess()
    {
        if (difficultyDropdown == null)
        {
            difficultyDropdown = UIHelp.getAccessTo <Dropdown>("HsDifficulty");
        }

        if (levelSizeDropdown == null)
        {
            levelSizeDropdown = UIHelp.getAccessTo <Dropdown>("HsSize");
        }

        if (movingWallsToggle == null)
        {
            movingWallsToggle = UIHelp.getAccessTo <Toggle>("HsMoving");
        }

        if (scoresText == null)
        {
            scoresText = UIHelp.getAccessTo <Text>("ScoresText");
        }
    }
예제 #6
0
        public InstanceManager(MainWindow mainWindow)
        {
            this.userlogin        = new UserLogin(this);
            this.mainWindow       = mainWindow;
            this.backgroundthread = new BackgroundThread(this);
            this.uihelp           = new UIHelp(this);
            this.action           = new ACTION(this);
            this.configManager    = new ConfigManager(this);

            this.asset_textes     = new Programe.TextRes.Asset_Textes(this);
            this.catchdatasummery = new CatchDataSummery(this);
            this.userdatasummery  = new UserDataSummery(this);
            this.friend           = new Friend(this);

            this.battleloop_n = new BattleLoop_Normal(this);
            this.battleloop_a = new BattleLoop_Activity(this);
            this.battleloop_s = new BattleLoop_Simulation(this);
            //4个后勤任务
            for (int x = 0; x < 4; x++)
            {
                Operation_Act_Info auto_operation_act = new Operation_Act_Info();
                Dic_auto_operation_act.Add(Dic_auto_operation_act.Count, auto_operation_act);
            }
            //练级任务
            new_User_Normal_MissionInfo nunm = new new_User_Normal_MissionInfo(BattleLoop_AN_Teams, 0);

            dic_userbattletaskinfo.Add(dic_userbattletaskinfo.Count, nunm);

            for (int x = 0; x < 2; x++)
            {
                EquipBuilt eb = new EquipBuilt();
                this.list_equipBuilt.Add(eb);
            }

            this.auto_summery = new Auto_Summery(this);
            this.battle_loop  = new BattleLoop(this);
        }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
     TellScores();
 }
예제 #8
0
 // Use this for initialization
 void Start()
 {
     pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
     pss.SetupStoredScores();
 }
예제 #9
0
 //exit UI Help
 public void closeHelp()
 {
     UIHelp.SetActive(false);
 }
예제 #10
0
 // click button Help(UI start)
 public void buttonHelp()
 {
     UIHelp.SetActive(true);
 }
예제 #11
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            this.TbPrescription.RowDefinitions.Add(new RowDefinition());
            #region UI elements

            // UI element for DrugName
            drugName      = new TextBox();
            drugName.Text = TxtSearch.Text;
            drugName.HorizontalAlignment = HorizontalAlignment.Center;
            drugName.VerticalAlignment   = VerticalAlignment.Center;

            drugForm = new ComboBox();
            drugForm.HorizontalAlignment = HorizontalAlignment.Center;
            drugForm.VerticalAlignment   = VerticalAlignment.Center;
            drugForm.ItemsSource         = Enum.GetValues(typeof(DrugForm));

            drugBrand = new TextBox();
            drugBrand.TextWrapping        = TextWrapping.Wrap;
            drugBrand.HorizontalAlignment = HorizontalAlignment.Center;
            drugBrand.VerticalAlignment   = VerticalAlignment.Center;

            drugGeneric = new TextBox();
            drugGeneric.TextWrapping        = TextWrapping.Wrap;
            drugGeneric.HorizontalAlignment = HorizontalAlignment.Center;
            drugGeneric.VerticalAlignment   = VerticalAlignment.Center;

            drugRoute = new ComboBox();
            drugRoute.HorizontalAlignment = HorizontalAlignment.Center;
            drugRoute.VerticalAlignment   = VerticalAlignment.Center;
            drugRoute.ItemsSource         = Enum.GetValues(typeof(DrugRoute));

            drugFrequency = new ComboBox();
            drugFrequency.HorizontalAlignment = HorizontalAlignment.Center;
            drugFrequency.VerticalAlignment   = VerticalAlignment.Center;
            drugFrequency.ItemsSource         = Enum.GetValues(typeof(DrugFrequency));

            drugDays = new TextBox();
            drugDays.TextWrapping        = TextWrapping.Wrap;
            drugDays.HorizontalAlignment = HorizontalAlignment.Center;
            drugDays.VerticalAlignment   = VerticalAlignment.Center;

            btnDone                     = new Button();
            btnDone.Content             = "Done";
            btnDone.Click              += BtnDone_Click;
            btnDone.HorizontalAlignment = HorizontalAlignment.Center;

            #endregion

            #region Display elements
            var ui = new UIHelp();

            ui.DisplayUIElementInColoumn(TbPrescription, drugForm, 0);
            //this.TbPrescription.Children.Add(drugForm);
            //Grid.SetRow(drugForm, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugForm, 0);

            ui.DisplayUIElementInColoumn(TbPrescription, drugName, 1);
            //this.TbPrescription.Children.Add(drugName);
            //Grid.SetRow(drugName, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugName, 1);

            ui.DisplayUIElementInColoumn(TbPrescription, drugBrand, 2);
            //this.TbPrescription.Children.Add(drugBrand);
            //Grid.SetRow(drugBrand, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugBrand, 2);

            ui.DisplayUIElementInColoumn(TbPrescription, drugGeneric, 3);
            //this.TbPrescription.Children.Add(drugGeneric);
            //Grid.SetRow(drugGeneric, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugGeneric, 3);

            ui.DisplayUIElementInColoumn(TbPrescription, drugRoute, 4);
            //this.TbPrescription.Children.Add(drugRoute);
            //Grid.SetRow(drugRoute, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugRoute, 4);

            ui.DisplayUIElementInColoumn(TbPrescription, drugFrequency, 5);
            //this.TbPrescription.Children.Add(drugFrequency);
            //Grid.SetRow(drugFrequency, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugFrequency, 5);

            ui.DisplayUIElementInColoumn(TbPrescription, drugDays, 6);
            //this.TbPrescription.Children.Add(drugDays);
            //Grid.SetRow(drugDays, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugDays, 6);

            ui.DisplayUIElementInColoumn(TbPrescription, btnDone, 7);
            //this.TbPrescription.Children.Add(btnDone);
            //Grid.SetRow(btnDone, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(btnDone, 7);
            #endregion
        }
예제 #12
0
        private void DisplayUI(Drug obj)
        {
            // Add a new Row Definition
            this.TbPrescription.RowDefinitions.Add(new RowDefinition());

            #region UI elements

            // UI element for DrugName
            TextBlock drugName = new TextBlock();
            drugName.Text = obj.DrugName;
            drugName.HorizontalAlignment = HorizontalAlignment.Center;
            drugName.VerticalAlignment   = VerticalAlignment.Center;
            drugName.TextWrapping        = TextWrapping.Wrap;

            TextBlock drugForm = new TextBlock();
            drugForm.Text = obj.DrugForm;
            drugForm.HorizontalAlignment = HorizontalAlignment.Center;
            drugForm.VerticalAlignment   = VerticalAlignment.Center;
            drugForm.TextWrapping        = TextWrapping.Wrap;

            TextBlock drugBrand = new TextBlock();
            drugBrand.Text = obj.Brand;
            drugBrand.HorizontalAlignment = HorizontalAlignment.Center;
            drugBrand.VerticalAlignment   = VerticalAlignment.Center;
            drugBrand.TextWrapping        = TextWrapping.Wrap;

            TextBlock drugGeneric = new TextBlock();
            drugGeneric.Text = obj.GenericName.ToUpper();
            drugGeneric.HorizontalAlignment = HorizontalAlignment.Center;
            drugGeneric.VerticalAlignment   = VerticalAlignment.Center;
            drugGeneric.TextWrapping        = TextWrapping.Wrap;

            TextBlock drugRoute = new TextBlock();
            drugRoute.Text = obj.Route;
            drugRoute.HorizontalAlignment = HorizontalAlignment.Center;
            drugRoute.VerticalAlignment   = VerticalAlignment.Center;
            drugRoute.TextWrapping        = TextWrapping.Wrap;

            TextBox drugFrequency = new TextBox();
            drugFrequency.Text = obj.Frequency;
            drugFrequency.HorizontalAlignment = HorizontalAlignment.Center;
            drugFrequency.VerticalAlignment   = VerticalAlignment.Center;
            drugFrequency.TextWrapping        = TextWrapping.Wrap;

            TextBox drugDays = new TextBox();
            drugDays.Text = obj.Days.ToString();
            drugDays.HorizontalAlignment = HorizontalAlignment.Center;
            drugDays.VerticalAlignment   = VerticalAlignment.Center;
            drugDays.TextWrapping        = TextWrapping.Wrap;

            Button btnDelete = new Button();
            btnDelete.Content             = "Delete";
            btnDelete.Click              += BtnDelete_Click;
            btnDelete.HorizontalAlignment = HorizontalAlignment.Center;

            #endregion

            #region Display elements
            var ui = new UIHelp();
            ui.DisplayUIElementInColoumn(TbPrescription, drugForm, 0);
            //this.TbPrescription.Children.Add(drugForm);
            //Grid.SetRow(drugForm, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugForm, 0);

            ui.DisplayUIElementInColoumn(TbPrescription, drugName, 1);
            //this.TbPrescription.Children.Add(drugName);
            //Grid.SetRow(drugName, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugName, 1);

            ui.DisplayUIElementInColoumn(TbPrescription, drugBrand, 2);
            //this.TbPrescription.Children.Add(drugBrand);
            //Grid.SetRow(drugBrand, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugBrand, 2);

            ui.DisplayUIElementInColoumn(TbPrescription, drugGeneric, 3);
            //this.TbPrescription.Children.Add(drugGeneric);
            //Grid.SetRow(drugGeneric, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugGeneric, 3);

            ui.DisplayUIElementInColoumn(TbPrescription, drugRoute, 4);
            //this.TbPrescription.Children.Add(drugRoute);
            //Grid.SetRow(drugRoute, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugRoute, 4);

            ui.DisplayUIElementInColoumn(TbPrescription, drugFrequency, 5);
            //this.TbPrescription.Children.Add(drugFrequency);
            //Grid.SetRow(drugFrequency, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugFrequency, 5);

            ui.DisplayUIElementInColoumn(TbPrescription, drugDays, 6);
            //this.TbPrescription.Children.Add(drugDays);
            //Grid.SetRow(drugDays, TbPrescription.RowDefinitions.Count() - 1);
            //Grid.SetColumn(drugDays, 6);

            ui.DisplayUIElementInColoumn(TbPrescription, btnDelete, 7);
            #endregion

            // Add to display string
            string displayFreq = null;
            switch (drugFrequency.Text)
            {
            case "OD": displayFreq = "ONCE A DAY"; break;

            case "BD": displayFreq = "TWICE A DAY"; break;

            case "ES": displayFreq = "EMPTY STOMACH"; break;

            case "HS": displayFreq = "AT BEDTIME"; break;

            default: break;
            }

            string displayCurrent = drugForm.Text + ". " + drugName.Text + " (" + drugBrand.Text + ") " + drugRoute.Text + " " + drugFrequency.Text + ";(" + drugGeneric.Text + ") " + displayFreq + " for " + drugDays.Text + " days";
            display.Add(displayCurrent);

            TxtSearch.Text = string.Empty;
        }