示例#1
0
        static void AddPerk(SerializableDictionaryPod <string, int> perks, string name)
        {
            int oldValue;

            if (!perks.TryGetValue(name, out oldValue))
            {
                oldValue = 0;
            }
            perks[name] = (oldValue + 1);
        }
示例#2
0
 protected override void SaveLoad(bool save, GenericEnemyCharacter comp)
 {
     if (save)
     {
         m_Perks = comp.m_Perks.CloneTyped();
     }
     else
     {
         comp.m_Perks = m_Perks;
     }
 }
示例#3
0
    public object Clone()
    {
        SerializableDictionaryPod <TKey, TValue> clone = new SerializableDictionaryPod <TKey, TValue>();

        foreach (KeyValuePair <TKey, TValue> pair in this)
        {
            clone.Add(pair.Key, (TValue)pair.Value);
        }

        return(clone);
    }
示例#4
0
 static public void AddPerk(SerializableDictionaryPod <string, int> perks, float normalizedRand)
 {
     string[] perkslist = { "fast", "scout", "deadly", "tanky" };
     AddPerk(perks, perkslist.RandomlyPick(normalizedRand));
 }