Ejemplo n.º 1
0
 public static int AddSandboxParts(string levelName, BasePart.PartType part, int count, bool showUnlockAnimations = true)
 {
     if (showUnlockAnimations)
     {
         GameProgress.m_data.AddToInt(levelName + "_part_unlocked_" + part.ToString(), count, int.MinValue, int.MaxValue);
     }
     return(GameProgress.m_data.AddToInt(levelName + "_part_" + part.ToString(), count, int.MinValue, int.MaxValue));
 }
Ejemplo n.º 2
0
    private void ReadPartOrder()
    {
        this.m_partOrder.Clear();
        string text = this.m_gameData.m_partOrderList.text;

        char[] separator = new char[]
        {
            '\n'
        };
        string[] array = text.Split(separator);
        int      num   = 0;

        foreach (string text2 in array)
        {
            string text3 = text2.Trim();
            if (text3 != string.Empty)
            {
                BasePart.PartType key = BasePart.PartType.Unknown;
                foreach (GameObject gameObject in this.m_gameData.m_parts)
                {
                    BasePart.PartType partType = gameObject.GetComponent <BasePart>().m_partType;
                    if (partType.ToString() == text3)
                    {
                        key = partType;
                        break;
                    }
                }
                this.m_partOrder[key] = num;
                num++;
            }
        }
    }
Ejemplo n.º 3
0
 private void SetRewardGiven(BasePart.PartType type, bool given)
 {
     if (given && this.rewards.Contains(type))
     {
         this.rewards.Remove(type);
     }
     if (given)
     {
         this.RewardsGiven++;
     }
     GameProgress.SetBool("Pre_RewardGiven_" + type.ToString(), given, GameProgress.Location.Local);
 }
Ejemplo n.º 4
0
 private BasePart.PartType PartNameToType(string name)
 {
     BasePart.PartType result = BasePart.PartType.Unknown;
     foreach (GameObject gameObject in this.m_parts)
     {
         BasePart.PartType partType = gameObject.GetComponent <BasePart>().m_partType;
         if (partType.ToString() == name)
         {
             result = partType;
             break;
         }
     }
     return(result);
 }
Ejemplo n.º 5
0
 private bool GetRewardGiven(BasePart.PartType type)
 {
     return(GameProgress.GetBool("Pre_RewardGiven_" + type.ToString(), false, GameProgress.Location.Local, null));
 }
Ejemplo n.º 6
0
 public static int GetLastUsedPartIndex(BasePart.PartType partType)
 {
     return(UserSettings.GetInt("LastUsed_" + partType.ToString(), 0));
 }
Ejemplo n.º 7
0
 public static void SetLastUsedPartIndex(BasePart.PartType partType, int index)
 {
     UserSettings.SetInt("LastUsed_" + partType.ToString(), index);
 }
Ejemplo n.º 8
0
    public static void SetUnlockedSandboxPartCount(string levelName, BasePart.PartType part, int count)
    {
        string key = levelName + "_part_unlocked_" + part.ToString();

        GameProgress.m_data.SetInt(key, count);
    }
Ejemplo n.º 9
0
 public static void SetUnlockedSandboxPartCount(BasePart.PartType part, int count)
 {
     GameProgress.m_data.SetInt("part_unlocked_" + part.ToString(), count);
 }
Ejemplo n.º 10
0
    public static int GetUnlockedSandboxPartCount(string levelName, BasePart.PartType part)
    {
        string key = levelName + "_part_unlocked_" + part.ToString();

        return(GameProgress.m_data.GetInt(key, 0));
    }
Ejemplo n.º 11
0
 public static int GetUnlockedSandboxPartCount(BasePart.PartType part)
 {
     return(GameProgress.m_data.GetInt("part_unlocked_" + part.ToString(), 0));
 }