Example #1
0
    protected virtual void Initialize()
    {
        experience = new Experience();
        experience.onLevelChanged += LevelUpHandler;

        DamageEffect de = new DamageEffect(damage);

        onDamageChange += de.ChangeDamageValue; //connect damage updating with damage effect
        impactEffects.Add(de);
    }
Example #2
0
    void OnGUI()
    {
        tab = GUILayout.Toolbar(tab, toolBar);
        switch (tab)
        {
        case 0:
            scrollPositon = GUILayout.BeginScrollView(scrollPositon);
            GUILayout.Label("Player Settings", EditorStyles.boldLabel);


            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Player Name :");
            //GUI.Label(new Rect(50, 50, 200, 30), "Name :" +m_PlayerName);
            playername = GUILayout.TextField(playername, 10, GUILayout.Width(200));

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();

            image = (Texture2D)EditorGUILayout.ObjectField("Avatar", image, typeof(Texture2D), false);

            GUILayout.Label(playerTexture, GUILayout.Width(200));
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);



            GUILayout.Label("Attack", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Attack delay :");
            //stringToEdit = Editdelay.ToString();
            stringToEdit = GUILayout.TextField(stringToEdit, 5, GUILayout.Width(200));

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Dmg :");

            stringToEdit1 = GUILayout.TextField(stringToEdit1, 5, GUILayout.Width(200));

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
            GUILayout.Label("Skill 1 ", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Colldowns :");
            stringToEdit2 =
                GUILayout.TextField(stringToEdit2, 5, GUILayout.Width(200));

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Dmg :");

            stringToEdit3 =
                GUILayout.TextField(stringToEdit3, 5, GUILayout.Width(200));

            string tdmg1 = stringToEdit3.ToString();
            UpdateDamage.Updatedmg1((string)tdmg1);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
            GUILayout.Label("Skill 2 ", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Colldowns :");
            stringToEdit4 =
                GUILayout.TextField(stringToEdit4, 5, GUILayout.Width(200));


            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Dmg :");

            stringToEdit5 =

                GUILayout.TextField(stringToEdit5, 5, GUILayout.Width(200));

            string tdmg2 = stringToEdit5.ToString();
            UpdateDamage.Updatedmg2((string)tdmg2);

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);



            //EditorGUILayout.BeginHorizontal();
            //player1 = EditorGUILayout.ObjectField(player1, typeof(GameObject), true) as GameObject;
            //EditorGUILayout.EndHorizontal();

            //player1.gameObject.GetComponent<Player1Controller>().SetValues(playerTexture,playername, dmg, atd, dmg1, cod1, dmg2, cod2);


            if (GUILayout.Button("Save"))
            {
                Editurl  = stringtoEditurl;
                Editname = playername;
                if (stringToEdit != null)
                {
                    Editdelay = float.Parse(stringToEdit);
                }

                if (stringToEdit1 != null)
                {
                    Editdmg = float.Parse(stringToEdit1);
                }

                if (stringToEdit2 != null)
                {
                    Editcool1 = float.Parse(stringToEdit2);
                }

                if (stringToEdit3 != null)
                {
                    Editdmgskill1 = float.Parse(stringToEdit3);
                }

                if (stringToEdit4 != null)
                {
                    Editcool2 = float.Parse(stringToEdit4);
                }

                if (stringToEdit5 != null)
                {
                    Editdmgskill2 = float.Parse(stringToEdit5);
                }
                if (stringToEdit == null)
                {
                    stringToEdit = "0";
                    Editdelay    = 0;
                }
                if (stringToEdit1 == null)
                {
                    stringToEdit1 = "0";
                    Editdmg       = 0;
                }
                if (stringToEdit2 == null)
                {
                    stringToEdit2 = "0";
                    Editcool1     = 0;
                }
                if (stringToEdit3 == null)
                {
                    stringToEdit3 = "0";
                    Editdmgskill1 = 0;
                }
                if (stringToEdit4 == null)
                {
                    stringToEdit4 = "0";
                    Editcool2     = 0;
                }
                if (stringToEdit5 == null)
                {
                    stringToEdit5 = "0";
                    Editdmgskill2 = 0;
                }
                SaveData("/PlayerSave.json", 1, Editurl, Editname, Editdmg, Editdelay, Editdmgskill1, Editcool1, Editdmgskill2, Editcool2);
            }

            GUILayout.Label("Animation ", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Idle :     ");
            playIdle = (AnimationClip)EditorGUILayout.ObjectField("", playIdle, typeof(AnimationClip), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Attack1 :");
            playattack1 = (AnimationClip)EditorGUILayout.ObjectField("", playattack1, typeof(AnimationClip), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Attack2 :");
            playattack2 = (AnimationClip)EditorGUILayout.ObjectField("", playattack2, typeof(AnimationClip), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Skill1 :   ");
            playskill1 = (AnimationClip)EditorGUILayout.ObjectField("", playskill1, typeof(AnimationClip), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Skill2 :   ");
            playskill2 = (AnimationClip)EditorGUILayout.ObjectField("", playskill2, typeof(AnimationClip), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            if (GUILayout.Button("Add Player"))
            {
            }
            GUILayout.EndScrollView();
            break;

        case 1:
            GUILayout.Label("Enemy Settings", EditorStyles.boldLabel);



            break;

        case 2:
            GUILayout.Label("Map Settings", EditorStyles.boldLabel);
            break;

        case 3:
            GUILayout.Label("Shop Settings", EditorStyles.boldLabel);

            break;

        case 4:
            GUILayout.Label("Sence Settings", EditorStyles.boldLabel);
            //GUILayout.Label(EditorWindow.focusedWindow.ToString());
            GUILayout.Label("Sound Settings", EditorStyles.boldLabel);
            mybool = EditorGUILayout.Toggle("Mute All Sounds", mybool);


            myFloat = EditorGUILayout.Slider("Sounds", myFloat, 0, 10);
            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
            break;
        }
    }