Beispiel #1
0
 private void Start()
 {
     difficultyBonus = FindObjectOfType <DifficultyBonus>();
     anim            = GetComponent <Animator>();
     scoreManager    = FindObjectOfType <ScoreManager>();
 }
Beispiel #2
0
 public static DifficultyBonus[] Add(DifficultyBonus n, DifficultyBonus[] list)
 {
     ArrayList tmp = new ArrayList();
     foreach(DifficultyBonus str in list) tmp.Add(str);
     tmp.Add(n);
     return tmp.ToArray(typeof(DifficultyBonus)) as DifficultyBonus[];
 }
Beispiel #3
0
    public static void DifficultyBonusSettings(ref DifficultyBonus bonus, bool showExp)
    {
        bonus.difficultyID = EditorGUILayout.Popup("Difficulty", bonus.difficultyID,
                DataHolder.Difficulties().GetNameList(true), GUILayout.Width(mWidth));
        EditorGUILayout.Separator();

        EditorGUILayout.BeginHorizontal();
        // status value bonuses
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Status value bonuses", EditorStyles.boldLabel);
        for(int i=0; i<bonus.statusBonus.Length; i++)
        {
            if(DataHolder.StatusValue(i).IsConsumable() ||
                (!showExp && DataHolder.StatusValue(i).IsExperience()))
            {
                bonus.statusBonus[i] = 0;
            }
            else
            {
                bonus.statusBonus[i] = EditorGUILayout.IntField(DataHolder.StatusValues().GetName(i),
                        bonus.statusBonus[i], GUILayout.Width(mWidth));
            }
        }
        EditorGUILayout.EndVertical();

        // chance bonuses
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Chance bonuses", EditorStyles.boldLabel);
        bonus.hitBonus = EditorGUILayout.FloatField("Hit bonus", bonus.hitBonus, GUILayout.Width(mWidth));
        bonus.counterBonus = EditorGUILayout.FloatField("Counter bonus", bonus.counterBonus, GUILayout.Width(mWidth));
        bonus.criticalBonus = EditorGUILayout.FloatField("Critical bonus", bonus.criticalBonus, GUILayout.Width(mWidth));
        bonus.blockBonus = EditorGUILayout.FloatField("Block bonus", bonus.blockBonus, GUILayout.Width(mWidth));
        bonus.escapeBonus = EditorGUILayout.FloatField("Escape bonus", bonus.escapeBonus, GUILayout.Width(mWidth));
        bonus.speedBonus = EditorGUILayout.FloatField("Speed bonus", bonus.speedBonus, GUILayout.Width(mWidth));
        bonus.itemStealBonus = EditorGUILayout.FloatField("Item steal bonus", bonus.itemStealBonus, GUILayout.Width(mWidth));
        bonus.moneyStealBonus = EditorGUILayout.FloatField("Money steal bonus", bonus.moneyStealBonus, GUILayout.Width(mWidth));
        EditorGUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.Separator();

        EditorGUILayout.BeginHorizontal();
        // element bonuses
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Element bonuses", EditorStyles.boldLabel);
        for(int i=0; i<bonus.elementBonus.Length; i++)
        {
            bonus.elementBonus[i] = EditorGUILayout.IntField(DataHolder.Elements().GetName(i),
                    bonus.elementBonus[i], GUILayout.Width(mWidth));
        }
        EditorGUILayout.EndVertical();

        // race bonuses
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Race bonuses", EditorStyles.boldLabel);
        for(int i=0; i<bonus.raceBonus.Length; i++)
        {
            bonus.raceBonus[i] = EditorGUILayout.IntField(DataHolder.Races().GetName(i),
                    bonus.raceBonus[i], GUILayout.Width(mWidth));
        }
        EditorGUILayout.EndVertical();

        // size bonuses
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Size bonuses", EditorStyles.boldLabel);
        for(int i=0; i<bonus.sizeBonus.Length; i++)
        {
            bonus.sizeBonus[i] = EditorGUILayout.IntField(DataHolder.Sizes().GetName(i),
                    bonus.sizeBonus[i], GUILayout.Width(mWidth));
        }
        EditorGUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
    }
Beispiel #4
0
 public static DifficultyBonus[] Remove(int index, DifficultyBonus[] list)
 {
     ArrayList tmp = new ArrayList();
     foreach(DifficultyBonus str in list) tmp.Add(str);
     tmp.RemoveAt(index);
     return tmp.ToArray(typeof(DifficultyBonus)) as DifficultyBonus[];
 }