コード例 #1
0
 public void Refresh()
 {
     LeagueEditor.Refresh();
     TournamentEditor.Refresh();
     PlayerEditor.Refresh();
     TeamEditor.Refresh();
 }
コード例 #2
0
 static void CreateInstance()
 {
     if (mInstance == null)
     {
         mInstance = new PlayerEditor();
     }
 }
コード例 #3
0
    public void EditPlayer(Player player)
    {
        DisableMegaBoxes();
        DisableList();
        isEditorOpen = true;

        Slot slot = slotList.GetSlotForPlayer(player);

        if (slot == null)
        {
            return;
        }

        Go.to(mainContainer, 0.4f, new TweenConfig().floatProp("scale", 0.75f).setEaseType(EaseType.Linear).removeWhenComplete());
        Go.to(mainContainer, 0.4f, new TweenConfig().floatProp("alpha", 0.0f).setDelay(0.0f).setEaseType(EaseType.Linear));

        slot.PauseMathMode();

        //mainholdertween
        //disable touches on mainholder

        playerEditor = new PlayerEditor();
        AddChild(playerEditor);

        playerEditor.Setup(slot);

        AddChild(effectContainer);         //effects on top

        FSoundManager.PlaySound("UI/Woosh");
    }
コード例 #4
0
        /// <summary>
        /// Загрузить игроков. Возвращает массив футболистов
        /// </summary>
        /// <returns></returns>
        public IFootballPlayer[] LoadPlayers()
        {
            List <IFootballPlayer> players = new List <IFootballPlayer>();

            //Костыль
            PlayerEditor plEditor = new PlayerEditor(null);

            if (Directory.Exists(_footballPlayersPath))
            {
                string[] playersPath = Directory.GetFiles(_footballPlayersPath);

                if (playersPath.Length > 0)
                {
                    BinaryFormatter formatter = new BinaryFormatter();

                    foreach (string path in playersPath)
                    {
                        using (FileStream fStream = new FileStream(path, FileMode.Open))
                        {
                            //Костыль
                            IFootballPlayer pl = plEditor.UpdateParametersNames((FootballPlayer)formatter.Deserialize(fStream));

                            players.Add(pl);
                        }
                    }
                }
            }
            return(players.ToArray());
        }
コード例 #5
0
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            PlayerName = PlayerList.Text;
            PlayerEditor ed = new PlayerEditor();

            ed.Show();
        }
コード例 #6
0
ファイル: FruitLauncher.cs プロジェクト: Colafroth/Cup
    void Launch(PlayerEditor.ChargeStage chargeStage)
    {
        //Based on the attack on charge
        float fruitSpawnRate = 0.0f;
        switch (chargeStage)
        {
            case PlayerEditor.ChargeStage.NotCharge:
                fruitSpawnRate = 0.3f;
                break;
            case PlayerEditor.ChargeStage.StageOne:
                fruitSpawnRate = 0.5f;
                break;
            case PlayerEditor.ChargeStage.StageTwo:
                fruitSpawnRate = 0.7f;
                break;
            case PlayerEditor.ChargeStage.StageThree:
                fruitSpawnRate = 1.0f;
                break;
        }

        int randomFruit;
        for (int i = 0; i < (int) (amount * fruitSpawnRate); i++)
        {
            randomFruit = (int) Random.Range (0, Fruits.Length - 0.01f);
            Quaternion randRotation = Quaternion.Euler (0, 0, Random.Range (-360.0f, 360.0f));
            GameObject fruit = Instantiate (Fruits[randomFruit], transform.position, randRotation) as GameObject;

            FruitExplosion fE = fruit.GetComponent <FruitExplosion> ();
            fE.initVertiForce = Random.Range (initLowerVertiForce, initHigherVertiForce);
            fE.initHoriForce = Random.Range (initLowerHoriForce, initHigherHoriForce);
        }
        Destroy (gameObject);
    }
コード例 #7
0
        public async Task EditPlayer()
        {
            var playerEditorPage    = new PlayerEditor(this.SelectedPlayer);
            var selectedPlayerIndex = this.PlayerList.IndexOf(this.SelectedPlayer);

            await this.GoToPage(playerEditorPage);

            playerEditorPage.Model().PlayerSaved = async(player) =>
            {
                if (selectedPlayerIndex < 0)
                {
                    this.PlayerList.Add(player);
                }
                else
                {
                    this.PlayerList.RemoveAt(selectedPlayerIndex);
                    this.PlayerList.Insert(selectedPlayerIndex, player);
                }

                await this.ClosePage();

                //await this.GetPlayers();
                //this.PlayerList.Add(player);
            };
        }
コード例 #8
0
        public async Task EditPlayer()
        {
            var playerEditorPage = new PlayerEditor(this.SelectedPlayer);

            await this.GoToPage(playerEditorPage);

            playerEditorPage.Model().PlayerSaved = async(player) =>
            {
                await this.ClosePage();

                this.PlayerList.Add(player);
            };
        }
コード例 #9
0
    //called by player editor
    public void RemovePlayerEditor()
    {
        EnableMegaBoxes();
        EnableList();
        isEditorOpen = false;

        //resume math mode on the player view (if needed)
        if (playerEditor.slot != null)
        {
            playerEditor.slot.ResumeMathMode();
        }

        playerEditor.Destroy();
        playerEditor = null;

        SKDataManager.MarkDirty();
    }
コード例 #10
0
    void CreateCurrentEditor()
    {
        switch (mActiveEditor)
        {
        case EditorType.AssetEditor:
            mCurrentEditor = AssetEditor.CreateNewAssetEditorUI();
            break;

        case EditorType.GameObjectEditor:
            mCurrentEditor = GameObjectEditor.CreateNewGameObjectEditorUI();
            break;

        case EditorType.LevelEditor:
            mCurrentEditor = LevelEditor.CreateNewLevelEditorUI();
            break;

        case EditorType.PlayerEditor:
            mCurrentEditor = PlayerEditor.CreateNewPlayerEditorUI();
            break;
        }
    }
コード例 #11
0
            public TeamRow(TournamentTeam team)
            {
                Model = team;

                Masking      = true;
                CornerRadius = 10;

                PlayerEditor playerEditor = new PlayerEditor(Model)
                {
                    Width = 0.95f
                };

                InternalChildren = new Drawable[]
                {
                    new Box
                    {
                        Colour           = OsuColour.Gray(0.1f),
                        RelativeSizeAxes = Axes.Both,
                    },
                    drawableContainer = new Container
                    {
                        Size   = new Vector2(100, 50),
                        Margin = new MarginPadding(10),
                        Anchor = Anchor.TopRight,
                        Origin = Anchor.TopRight,
                    },
                    new FillFlowContainer
                    {
                        Margin           = new MarginPadding(5),
                        Spacing          = new Vector2(5),
                        Direction        = FillDirection.Full,
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Children         = new Drawable[]
                        {
                            new SettingsTextBox
                            {
                                LabelText = "Name",
                                Width     = 0.2f,
                                Bindable  = Model.FullName
                            },
                            new SettingsTextBox
                            {
                                LabelText = "Acronym",
                                Width     = 0.2f,
                                Bindable  = Model.Acronym
                            },
                            new SettingsTextBox
                            {
                                LabelText = "Flag",
                                Width     = 0.2f,
                                Bindable  = Model.FlagName
                            },
                            new SettingsTextBox
                            {
                                LabelText = "Seed",
                                Width     = 0.2f,
                                Bindable  = Model.Seed
                            },
                            new SettingsSlider <int>
                            {
                                LabelText = "Last Year Placement",
                                Width     = 0.33f,
                                Bindable  = Model.LastYearPlacing
                            },
                            new SettingsButton
                            {
                                Width  = 0.11f,
                                Margin = new MarginPadding(10),
                                Text   = "Add player",
                                Action = () => playerEditor.CreateNew()
                            },
                            new DangerousSettingsButton
                            {
                                Width  = 0.11f,
                                Text   = "Delete Team",
                                Margin = new MarginPadding(10),
                                Action = () =>
                                {
                                    Expire();
                                    ladderInfo.Teams.Remove(Model);
                                },
                            },
                            playerEditor,
                            new SettingsButton
                            {
                                Width  = 0.2f,
                                Margin = new MarginPadding(10),
                                Text   = "Edit seeding results",
                                Action = () =>
                                {
                                    sceneManager?.SetScreen(new SeedingEditorScreen(team));
                                }
                            },
                        }
                    },
                };

                RelativeSizeAxes = Axes.X;
                AutoSizeAxes     = Axes.Y;

                Model.FlagName.BindValueChanged(updateDrawable, true);
            }
コード例 #12
0
            public TeamRow(TournamentTeam team)
            {
                Model = team;

                Masking      = true;
                CornerRadius = 10;

                PlayerEditor playerEditor = new PlayerEditor(Model)
                {
                    Width = 0.95f
                };

                InternalChildren = new Drawable[]
                {
                    new Box
                    {
                        Colour           = OsuColour.Gray(0.1f),
                        RelativeSizeAxes = Axes.Both,
                    },
                    drawableContainer = new Container
                    {
                        Size   = new Vector2(100, 50),
                        Margin = new MarginPadding(10),
                        Anchor = Anchor.TopRight,
                        Origin = Anchor.TopRight,
                    },
                    new FillFlowContainer
                    {
                        Margin           = new MarginPadding(5),
                        Spacing          = new Vector2(5),
                        Direction        = FillDirection.Full,
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Children         = new Drawable[]
                        {
                            //new SettingsTextBox
                            //{
                            //    LabelText = "Name",
                            //    Width = 0.2f,
                            //    Bindable = Model.FullName
                            //},
                            new SettingsTextBox
                            {
                                LabelText = "Name",
                                Width     = 0.2f,
                                Bindable  = Model.Acronym
                            },
                            new SettingsTextBox
                            {
                                LabelText = "ID",
                                Width     = 0.2f,
                                Bindable  = Model.FlagName
                            },
                            //new SettingsButton
                            //{
                            //    Width = 0.11f,
                            //    Margin = new MarginPadding(10),
                            //    Text = "Add player",
                            //    Action = () => playerEditor.CreateNew()
                            //},
                            new DangerousSettingsButton
                            {
                                Width  = 0.11f,
                                Text   = "Delete Team",
                                Margin = new MarginPadding(10),
                                Action = () =>
                                {
                                    Expire();
                                    ladderInfo.Teams.Remove(Model);
                                },
                            },
                            playerEditor
                        }
                    },
                };

                RelativeSizeAxes = Axes.X;
                AutoSizeAxes     = Axes.Y;

                Model.FlagName.BindValueChanged(updateDrawable, true);
            }
コード例 #13
0
 void OnGUI()
 {
     EditorGUILayout.BeginVertical();
     mAnimationData.mAnimationName = EditorGUILayout.TextField("Name: ", mAnimationData.mAnimationName);
     mAnimationData.mAnimSpeed     = EditorGUILayout.Slider("Animation Speed: ", mAnimationData.mAnimSpeed, 0, 50);
     mAnimationScroll = EditorGUILayout.BeginScrollView(mAnimationScroll, GUILayout.Width(500), GUILayout.Height(450));
     if (Event.current.commandName == "ObjectSelectorUpdated" && mObjectPickerId == EditorGUIUtility.GetObjectPickerControlID())
     {
         Sprite a = (Sprite)EditorGUIUtility.GetObjectPickerObject();
         mObjectPickerId = -1;
         if (a != null)
         {
             if (mAnimationData.mSprites.Count > 0)
             {
                 if (AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(a.texture)) != mAnimationData.mTextureAssetGUID)
                 {
                     EditorUtility.DisplayDialog("Cannot Add Sprite", "Sprite Not Part of The Same Texture Asset", "Okay");
                 }
                 else
                 {
                     mAnimationData.mSprites.Add(a);
                     if (mIsPlayer)
                     {
                         EditorUtility.SetDirty(PlayerEditor.GetActivePlayer());
                     }
                     else
                     {
                         EditorUtility.SetDirty(GameObjectEditor.GetCurrentScriptable());
                     }
                     mWindow.Repaint();
                 }
             }
             else
             {
                 mAnimationData.mTextureAssetGUID = DoesAssetExists(a);
                 if (mAnimationData.mTextureAssetGUID != null)
                 {
                     mAnimationData.mSprites.Add(a);
                     if (mIsPlayer)
                     {
                         EditorUtility.SetDirty(PlayerEditor.GetActivePlayer());
                     }
                     else
                     {
                         EditorUtility.SetDirty(GameObjectEditor.GetCurrentScriptable());
                     }
                     mWindow.Repaint();
                 }
             }
         }
     }
     mAnimations.DoLayoutList();
     EditorGUILayout.EndScrollView();
     if (GUILayout.Button("Save Animation"))
     {
         if (mAnimationData.mSprites.Count <= 0)
         {
             EditorUtility.DisplayDialog("Animation Data Empty", "Cannot add an empty animation to the animation data", "Okay");
         }
         else
         {
             if (!mIsPlayer)
             {
                 GameObjectEditor.AddToCurrentAnimationList(mAnimationData);
                 mWindow.Close();
             }
             else
             {
                 PlayerEditor.AddToPlayerAnimation(mAnimationData);
                 mWindow.Close();
             }
         }
     }
     EditorGUILayout.EndVertical();
 }
コード例 #14
0
    public static void Init()
    {
        PlayerEditor brobotEditor = GetWindow <PlayerEditor>();

        brobotEditor.Show();
    }
コード例 #15
0
ファイル: Keeper.cs プロジェクト: MattRix/ScorekeeperX
    public void EditPlayer(Player player)
    {
        DisableMegaBoxes();
        DisableList();
        isEditorOpen = true;

        Slot slot = slotList.GetSlotForPlayer(player);
        if(slot == null) return;

        Go.to(mainContainer, 0.4f, new TweenConfig().floatProp("scale",0.75f).setEaseType(EaseType.Linear).removeWhenComplete());
        Go.to(mainContainer, 0.4f, new TweenConfig().floatProp("alpha",0.0f).setDelay(0.0f).setEaseType(EaseType.Linear));

        slot.PauseMathMode();

        //mainholdertween
        //disable touches on mainholder

        playerEditor = new PlayerEditor();
        AddChild(playerEditor);

        playerEditor.Setup(slot);

        AddChild(effectContainer); //effects on top

        FSoundManager.PlaySound("UI/Woosh");
    }
コード例 #16
0
ファイル: Keeper.cs プロジェクト: MattRix/ScorekeeperX
    //called by player editor
    public void RemovePlayerEditor()
    {
        EnableMegaBoxes();
        EnableList();
        isEditorOpen = false;

        //resume math mode on the player view (if needed)
        if(playerEditor.slot != null) playerEditor.slot.ResumeMathMode();

        playerEditor.Destroy();
        playerEditor = null;

        SKDataManager.MarkDirty();
    }