示例#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));
 }
示例#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++;
            }
        }
    }
示例#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);
 }
示例#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);
 }
示例#5
0
 private bool GetRewardGiven(BasePart.PartType type)
 {
     return(GameProgress.GetBool("Pre_RewardGiven_" + type.ToString(), false, GameProgress.Location.Local, null));
 }
示例#6
0
 public static int GetLastUsedPartIndex(BasePart.PartType partType)
 {
     return(UserSettings.GetInt("LastUsed_" + partType.ToString(), 0));
 }
示例#7
0
 public static void SetLastUsedPartIndex(BasePart.PartType partType, int index)
 {
     UserSettings.SetInt("LastUsed_" + partType.ToString(), index);
 }
示例#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);
    }
示例#9
0
 public static void SetUnlockedSandboxPartCount(BasePart.PartType part, int count)
 {
     GameProgress.m_data.SetInt("part_unlocked_" + part.ToString(), count);
 }
示例#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));
    }
示例#11
0
 public static int GetUnlockedSandboxPartCount(BasePart.PartType part)
 {
     return(GameProgress.m_data.GetInt("part_unlocked_" + part.ToString(), 0));
 }