Пример #1
0
    //Check shop based mission status
    void CheckShopBased(MissionTemplate mission, int i)
    {
        mission.ModifyStoredValue(true, 1);
        GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);

        if (mission.valueA == mission.StoredValue())
        {
            MissionCompleted(mission, i);
            Save();
        }
    }
Пример #2
0
    //Checks Obstalce based mission status
    void CheckObstacleBased(MissionTemplate mission, int i)
    {
        if (mission.goalType == MissionTemplate.GoalType.InOneRun || mission.goalType == MissionTemplate.GoalType.InMultipleRun)
        {
            mission.ModifyStoredValue(true, 1);
            GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);

            if (mission.valueA == mission.StoredValue())
            {
                MissionCompleted(mission, i);
            }
        }
    }
Пример #3
0
    //Checks Coin based mission status
    void CheckCoinIn(MissionTemplate mission, int number, int i)
    {
        if (mission.goalType == MissionTemplate.GoalType.InOneRun)
        {
            GUIManager.Instance.UpdateMissionStatus(i, number, mission.valueA);

            if (mission.valueA <= number)
            {
                MissionCompleted(mission, i);
            }
        }
        else if (mission.goalType == MissionTemplate.GoalType.InMultipleRun)
        {
            mission.ModifyStoredValue(false, number);
            GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);

            if (mission.valueA <= mission.StoredValue())
            {
                MissionCompleted(mission, i);
            }
        }
    }
Пример #4
0
    //Save progress
    public void Save()
    {
        //Loop trought the missions
        for (int i = 0; i < 3; i++)
        {
            //If the mission is completed
            if (activeMissionComplete[i] && activeMissionIDs[i] != -1)
            {
                print("Mission " + (i + 1) + " Completed!");
                //Modify the data string
                char[] newData = data.ToCharArray();
                newData[activeMissionIDs[i]] = '1';
                data = new string (newData);

                //Reset mission data
                if (i == 0)
                {
                    SaveManager.SetMission1Data(0);
                }
                else if (i == 1)
                {
                    SaveManager.SetMission2Data(0);
                }
                else
                {
                    SaveManager.SetMission3Data(0);
                }

                //Save the modifies
                SaveManager.SetMissionData(data);

                //Find a new mission
                GetNewMission(i);
            }
            //If the mission is not completed
            else if (!activeMissionComplete[i])
            {
                //Set a reference
                MissionTemplate mission = missions[activeMissionIDs[i]];

                //If the mission requires data save
                if (mission.goalType == MissionTemplate.GoalType.InMultipleRun || mission.goalType == MissionTemplate.GoalType.InShop)
                {
                    //Save the data
                    if (i == 0)
                    {
                        SaveManager.SetMission1Data(mission.StoredValue());
                    }
                    else if (i == 1)
                    {
                        SaveManager.SetMission2Data(mission.StoredValue());
                    }
                    else
                    {
                        SaveManager.SetMission3Data(mission.StoredValue());
                    }
                }
            }
        }

        UpdateGUITexts();
    }
	//Check shop based mission status
	void CheckShopBased(MissionTemplate mission, int i)
	{
		mission.ModifyStoredValue(true, 1);
        GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);
		
		if (mission.valueA == mission.StoredValue())
		{
			MissionCompleted(mission, i);
			Save();
		}
	}
	//Checks Obstalce based mission status
	void CheckObstacleBased(MissionTemplate mission, int i)
	{
		if (mission.goalType == MissionTemplate.GoalType.InOneRun || mission.goalType == MissionTemplate.GoalType.InMultipleRun)
		{
			mission.ModifyStoredValue(true, 1);
            GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);
			
			if (mission.valueA == mission.StoredValue())
				MissionCompleted(mission, i);
		}
	}
	//Checks Coin based mission status
	void CheckCoinIn(MissionTemplate mission, int number, int i)
	{
		if (mission.goalType == MissionTemplate.GoalType.InOneRun)
		{
            GUIManager.Instance.UpdateMissionStatus(i, number, mission.valueA);
			
			if (mission.valueA <= number)
				MissionCompleted(mission, i);
		}
		else if (mission.goalType == MissionTemplate.GoalType.InMultipleRun)
		{
			mission.ModifyStoredValue(false, number);
            GUIManager.Instance.UpdateMissionStatus(i, mission.StoredValue(), mission.valueA);
			
			if (mission.valueA <= mission.StoredValue())
				MissionCompleted(mission, i);
		}
	}