Ejemplo n.º 1
0
    void Swap()
    {
        Equipped   = GameObject.Find(active.name);
        Unequipped = GameObject.Find(active2.name);
        GameObject   temp1       = Instantiate(Equipped);
        HeroSelector tempEquip   = temp1.GetComponent <HeroSelector>();
        GameObject   temp2       = Instantiate(Unequipped);
        HeroSelector tempUnequip = temp2.GetComponent <HeroSelector>();

        HeroSelector unEQ = Unequipped.GetComponent <HeroSelector>();
        HeroSelector EQ   = Equipped.GetComponent <HeroSelector>();

        bothSelected = false;

        active.GetComponent <HeroSelector>().ActiveHeroUnselected();
        active.isOn  = false;
        active2.isOn = false;

        unEQ.HeroID = tempEquip.HeroID;
        GlobalVariable.SetPlayerHeroID(unEQ.slot, unEQ.HeroID, unEQ.Active);
        EQ.HeroID = tempUnequip.HeroID;
        GlobalVariable.SetPlayerHeroID(EQ.slot, EQ.HeroID, EQ.Active);

        //CopyHeroComponent(tempEquip, Unequipped);
        //CopyHeroComponent(tempUnequip, Equipped);

        DestroyImmediate(temp1);
        DestroyImmediate(temp2);

        active  = null;
        active2 = null;
    }
Ejemplo n.º 2
0
 void Start()
 {
     waveManager = GameObject.FindWithTag("WaveManager").GetComponent <WaveManager>();
     currentRequisitionPoints = startingRequisitionPoints;
     setRequisitionPointsView();
     nextRequisitionPoint = 0.0f;
     heroSelector         = GameObject.FindWithTag("HeroSelector").GetComponent <HeroSelector>();
 }
Ejemplo n.º 3
0
 public void SelectHero(HeroSelector heroselector)
 {
     informationText.text = heroselector.heroName + "\n" + heroselector.description;
     selectedHero         = heroselector;
     if (heroselector.invited)
     {
         inviteButton.GetComponentInChildren <TextMeshProUGUI>().text = "kick";
         inviteButton.interactable = true;
     }
     else if (heroesCount < maxHeroes)
     {
         inviteButton.GetComponentInChildren <TextMeshProUGUI>().text = "invite";
         inviteButton.interactable = true;
     }
     else
     {
         inviteButton.GetComponentInChildren <TextMeshProUGUI>().text = "max team";
         inviteButton.interactable = false;
     }
 }
Ejemplo n.º 4
0
 void ChangeSelect(int id, int mapId)
 {
     if (isEnemy)
     {
         EnemySelect = this;
         if (EnemySelect != null)
         {
             SpEnemyFight.transform.parent        = EnemySelect.transform;
             SpEnemyFight.transform.localPosition = Vector3.zero;
         }
         GameLibrary.emeny = ToLong(id);
     }
     else
     {
         SelfSelect = this;
         if (SelfSelect != null)
         {
             SpSelfFight.transform.parent        = SelfSelect.transform;
             SpSelfFight.transform.localPosition = Vector3.zero;
         }
         GameLibrary.player = ToLong(id);
     }
 }
Ejemplo n.º 5
0
 void Start()
 {
     heroSelector       = GameObject.FindWithTag("HeroSelector").GetComponent <HeroSelector>();
     requisitionManager = GameObject.FindWithTag("RequisitionManager").GetComponent <RequisitionManager>();
 }
Ejemplo n.º 6
0
        public Form1()
        {
            Model = new Model();
            InitializeComponent();

            Groups();

            imageResource = new ImageResource(this.imageList1)
            {
                Resource = "UI/Icons/"
            };
            imageResource.ImageSizeChange(Settings.Default.IconSize);
            largeImageResource = new ImageResource(this.imageList2)
            {
                Resource = "UI/Images/"
            };
            largeImageResource.Load(largeImageResource.Resource);

            contextMenu = new ContextMenuComponent(metroContextMenu1)
            {
                GetStatistic = (x) => Model.Hero.Statistic(x)
            };

            playerPick = new PlayerPickInfo(playerpickButton)
            {
                GetImage  = imageResource.Bitmap,
                GetHeroId = (x) => Model.Hero.Select(x).Item[0].Id
            };

            forecastResultComponent = new ForecastResultComponent(metroListView1, btn_forecast)
            {
                Compute        = Model.ForecastService.Select(x => x).ToList(),
                GetHeroes      = () => Model.Hero,
                GetPlayersPick = playerPick.GetPlayerPics,
                MatchupWith    = Model.Statistic.MatchUp.With,
                MatchupAgainst = Model.Statistic.MatchUp.Against
            };

            filterTab = new FilterTab(cont_Filter, btn_FilterVisibleChange);
            filterTab.Collapse();

            statfilterTab = new FilterTab(splitContainer2, bunifuTileButton1);
            statfilterTab.Collapse();

            heroFilter     = new HeroFilter(groupCheckBox, subgroupCheckBox, franchiseCheckBox, metroTextBox9);
            heroStatFilter = new HeroFilter(groupStatCheckBox, subgroupStatCheckBox,
                                            franchiseStatCheckBox, metroTextBox1);

            heroPicker = new HeroPicker(listView1)
            {
                GetImageId = imageResource.Index,
                GetHeroes  = () => Model.Hero
            };

            heroSelector = new HeroSelector(listView2)
            {
                GetImageId         = imageResource.Index,
                GetHeroes          = () => Model.Hero,
                GetFranchiseFilter = heroFilter.GetFranchiseFilter,
                GetGroupFilter     = heroFilter.GetGroupsFilter,
                GetSubGroupFilter  = heroFilter.GetSubGroupFilter,
                GetTextFilter      = heroFilter.GetTextFilter
            };

            heroComponent = new HeroComponent(controls)
            {
                GetImage      = imageResource.Bitmap,
                GetLargeImage = largeImageResource.Bitmap,
                GetHero       = (x) => Model.Hero.Select(x).Item[0]
            };

            renderSettings = new RenderSettings(metroComboBox1, metroTextBox15, metroCheckBox2, numericUpDown1)
            {
                GetRenderType = () => imageResource.RenderType.ToArray()
            };
            renderSettings.Init();

            styleManager = new StyleManager(controls, metroContextMenu1, metroStyleManager1, this);

            themeSelector = new ThemeSelector(metroComboBox2, metroComboBox3);

            statComponent = new StatComponent(zedGraphControl1)
            {
                Hero = x => Model.Hero.Item[x].Hero,
                HeroesAvgStatistic = () => Model.Statistic.HeroStatistic.All().Item1,
                HeroGameCount      = x => Model.Hero.Select(x).Item[0].Statistic.count,
                Image  = imageResource.Bitmap,
                Style  = () => styleManager.Style,
                Filter = () =>
                {
                    return(Model.Hero.
                           Select(heroStatFilter.GetGroupsFilter()).
                           Select(heroStatFilter.GetSubGroupFilter()).
                           Select(heroStatFilter.GetFranchiseFilter()).
                           Select(heroStatFilter.GetTextFilter()).Select(X => X.Id).ToList());
                }
            };
            statComponent.Init();

            statGraph = new StatGraph(metroComboBox4)
            {
                GetSupportHeroStatistic = () => statComponent.HeroStat
            };
            statGraph.HeroesSelectionChanged += statComponent.ComputeHeroesStat;
            statGraph.Init();

            heroSelector.SelectionChanged += contextMenu.SelectPlayer;

            heroPicker.SelectionChanged += heroComponent.Render;

            playerPick.PickChanged     += contextMenu.ChangeElement;
            contextMenu.OnPlayerPicked += playerPick.SetPick;

            heroFilter.OnGroupChanged     += heroSelector.Render;
            heroFilter.OnSubGroupChanged  += heroSelector.Render;
            heroFilter.OnFranchiseChanged += heroSelector.Render;
            heroFilter.OnTextСhanged      += heroSelector.Render;

            heroStatFilter.OnGroupChanged     += statComponent.ComputeHeroesStat;
            heroStatFilter.OnSubGroupChanged  += statComponent.ComputeHeroesStat;
            heroStatFilter.OnFranchiseChanged += statComponent.ComputeHeroesStat;
            heroStatFilter.OnTextСhanged      += statComponent.ComputeHeroesStat;

            themeSelector.OnThemeChanged += styleManager.ChangeTheme;
            themeSelector.OnStyleChanged += styleManager.ChangeStyle;

            renderSettings.OnBackgroundChanged  += styleManager.SetBackground;
            renderSettings.OnTransparentChanged += styleManager.TransparentChange;
            renderSettings.OnBackgroundChanged  += heroPicker.ChangeBackGround;
            renderSettings.OnRenderModeChanged  += heroPicker.RenderModeChange;
            renderSettings.OnImageSizeChanged   += heroPicker.ItemSizeChange;
            renderSettings.OnBackgroundChanged  += heroSelector.ChangeBackGround;
            renderSettings.OnRenderModeChanged  += heroSelector.RenderModeChange;
            renderSettings.OnImageSizeChanged   += heroSelector.ItemSizeChange;
            renderSettings.OnImageSizeChanged   += imageResource.ImageSizeChange;

            LoadToolTip();
            Render();
        }