Ejemplo n.º 1
0
    void Start()
    {
        data = Master.EnemyData.GetEnemyDataWithUpgradeByID(enemyID, GameplayController.gameDifficult);

        Master.WaitAndDo(2.5f, () => {
            if (Master.EnemyData.CheckAndUnlockEnemy(enemyID))
            {
                Master.UIGameplay.SetNewEnemy(enemyID);
            }
        }, this);

        status.CurrentHealth = data.Health;
        Walk();
        ActionController();
        OnStart();
        if (isSpineAnim)
        {
            if (anim == null)
            {
                anim = transform.GetComponent <SkeletonAnimation> ();
            }
            transform.localScale = new Vector3(33f, 33f, 33f);
            Master.GetChildByName(gameObject, "Sprite").gameObject.SetActive(false);
        }
    }
Ejemplo n.º 2
0
    public override void OnOpen(string[] agruments = null, Action onCloseComplete = null)
    {
        enemyID = agruments[0];

        if (agruments.Length > 1)
        {
            isOpenInGameplay = true;
        }

        if (isOpenInGameplay)
        {
            Time.timeScale       = 0;
            this.onCloseComplete = () =>
            {
                Time.timeScale = 1;
            };
        }

        enemyCard.SetActive(true);
        enemyInfo.SetActive(false);

        enemyData = Master.EnemyData.GetEnemyDataByID(enemyID);

        card.mainTexture = Resources.Load <Texture2D>("Textures/Characters/Enemies/Enemy_" + enemyID + "/Card");
        enemyName.text   = enemyData.EnemyName;
        ability.text     = enemyData.Ability;
        SetStatsSlider(EnemyDataController.StatsType.Health);
        SetStatsSlider(EnemyDataController.StatsType.Damage);
        SetStatsSlider(EnemyDataController.StatsType.MoveSpeed);
        SetStatsSlider(EnemyDataController.StatsType.AttackSpeed);
    }
Ejemplo n.º 3
0
    public override void OnOpen(string[] agruments = null, Action onCloseComplete = null)
    {
        enemyID = agruments [0];

        if (agruments.Length > 1)
        {
            isOpenInGameplay = true;
        }

        if (isOpenInGameplay)
        {
            this.onCloseComplete = () => {
                Master.Gameplay.ResumeGame();
            };
        }

        enemyCard.SetActive(true);
        enemyInfo.SetActive(false);

        enemyData = Master.EnemyData.GetEnemyDataByID(enemyID);
        if (enemyData != null)
        {
            id             = int.Parse(enemyID);
            enemyName.text = enemyData.EnemyName;
            ability.text   = enemyData.Ability;
            SetStatsSlider(EnemyDataController.StatsType.Health);
            SetStatsSlider(EnemyDataController.StatsType.Damage);
            SetStatsSlider(EnemyDataController.StatsType.MoveSpeed);
            SetStatsSlider(EnemyDataController.StatsType.AttackSpeed);
        }
    }
Ejemplo n.º 4
0
    void Start()
    {
        data = Master.EnemyData.GetEnemyDataWithUpgradeByID(enemyID);

        Master.WaitAndDo(2.5f, () =>
        {
            if (Master.EnemyData.CheckAndUnlockEnemy(enemyID))
            {
                Master.UIGameplay.SetNewEnemy(enemyID);
            }
        }, this);

        status.CurrentHealth = data.Health;
        Walk();
        ActionController();
        OnStart();
    }
Ejemplo n.º 5
0
    void OnGUI()
    {
        if (!isShowWindow)
        {
            isShowWindow = true;
            // EditorWindow.GetWindow(typeof(LevelEditor));
            LoadEnemiesData();
        }

        //header
        float space = 15;

        GUILayout.Space(space * 0.5f);
        EditorGUILayout.LabelField("Enemy Data Manager!");

        GUILayout.Space(space * 0.5f);
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Add Enemy"))
        {
            EnemyDataController.EnemyData newEnemyData = new EnemyDataController.EnemyData();
            newEnemyData.EnemyID = ((enemyDataController.enemyDataCollection.ListEnemiesData.Count + 1) < 10) ? "0" + (enemyDataController.enemyDataCollection.ListEnemiesData.Count + 1).ToString() : (enemyDataController.enemyDataCollection.ListEnemiesData.Count + 1).ToString();
            // newEnemyData.EnemyID = (enemyDataController.enemyDataCollection.ListEnemiesData.Count < 10 ? "0" + (enemyDataController.enemyDataCollection.ListEnemiesData.Count + 1).ToString() : (enemyDataController.enemyDataCollection.ListEnemiesData.Count + 1).ToString());
            enemyDataController.enemyDataCollection.ListEnemiesData.Add(newEnemyData);
        }

        if (GUILayout.Button("Save Data"))
        {
            enemyDataController.Save(enemyDataController.enemyDataCollection);
        }
        EditorGUILayout.EndHorizontal();

        GUILayout.Space(10);

        EditorGUILayout.BeginVertical();
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(450), GUILayout.Height(490));

        ///load list
        for (int i = 0; i < enemyDataController.enemyDataCollection.ListEnemiesData.Count; i++)
        {
            listEnemiesSelect[i] = EditorGUILayout.Foldout(listEnemiesSelect[i], "Enemy " + enemyDataController.enemyDataCollection.ListEnemiesData[i].EnemyID);
            GUILayout.Space(space * 0.3f);
            if (listEnemiesSelect[i])
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].EnemyID = EditorGUILayout.TextField("ID", enemyDataController.enemyDataCollection.ListEnemiesData[i].EnemyID);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].EnemyName = EditorGUILayout.TextField("Name", enemyDataController.enemyDataCollection.ListEnemiesData[i].EnemyName);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].Health = float.Parse(EditorGUILayout.TextField("Health", enemyDataController.enemyDataCollection.ListEnemiesData[i].Health.ToString()));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].Damage = float.Parse(EditorGUILayout.TextField("Damage", enemyDataController.enemyDataCollection.ListEnemiesData[i].Damage.ToString()));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].MoveSpeed = float.Parse(EditorGUILayout.TextField("Move Speed", enemyDataController.enemyDataCollection.ListEnemiesData[i].MoveSpeed.ToString()));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].AttackSpeed = float.Parse(EditorGUILayout.TextField("Attack Speed", enemyDataController.enemyDataCollection.ListEnemiesData[i].AttackSpeed.ToString()));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].Range = float.Parse(EditorGUILayout.TextField("Range", enemyDataController.enemyDataCollection.ListEnemiesData[i].Range.ToString()));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].Ability = EditorGUILayout.TextField("Ability", enemyDataController.enemyDataCollection.ListEnemiesData[i].Ability.ToString());
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                enemyDataController.enemyDataCollection.ListEnemiesData[i].CoinDrop = EditorGUILayout.TextField("Coin Drop (a,b,c...)", enemyDataController.enemyDataCollection.ListEnemiesData[i].CoinDrop.ToString());
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(space);
                if (GUILayout.Button("Remove enemy"))
                {
                    enemyDataController.enemyDataCollection.ListEnemiesData.Remove(enemyDataController.enemyDataCollection.ListEnemiesData[i]);
                }
                EditorGUILayout.EndHorizontal();
            }
        }
        EditorGUILayout.EndScrollView();
        EditorGUILayout.EndVertical();
    }