Пример #1
0
    private IEnumerator PopulateGoalContents()
    {
        Dictionary <string, object> pars = new Dictionary <string, object>();

        foreach (PlayerGoalRunner goalRunner2 in Singleton <PlayerGoalCollectionRunner> .Instance.PlayerGoalRunners)
        {
            pars.Clear();
            pars.Add("PlayerGoalRunner", goalRunner2);
            GameObject card2 = Singleton <PropertyManager> .Instance.Instantiate(m_goalPrefab, Vector3.zero, Quaternion.identity, pars);

            card2.transform.SetParent(base.transform, worldPositionStays: false);
            yield return(null);
        }
        for (int i = PersistentSingleton <Economies> .Instance.TutorialGoals.Count - 1; i >= 0; i--)
        {
            PlayerGoalRunner goalRunner = Singleton <TutorialGoalCollectionRunner> .Instance.GetOrCreatePlayerGoalRunner(i);

            if (goalRunner.GoalConfig.GetShowInUI())
            {
                pars.Clear();
                pars.Add("PlayerGoalRunner", goalRunner);
                GameObject card = Singleton <PropertyManager> .Instance.Instantiate(m_tutorialPrefab, Vector3.zero, Quaternion.identity, pars);

                card.transform.SetParent(base.transform, worldPositionStays: false);
                yield return(null);
            }
        }
    }
Пример #2
0
    public void InstantiatePlayerGoalNotification(PlayerGoalRunner playerGoal)
    {
        string path = "UI/Notifications/GoalCompletedNotification";
        Dictionary <string, object> dictionary = new Dictionary <string, object>();

        dictionary.Add("PlayerGoalRunner", playerGoal);
        Singleton <PropertyManager> .Instance.InstantiateFromResourcesSetParent(path, Vector3.zero, Quaternion.identity, dictionary, base.transform);
    }
Пример #3
0
    private PlayerGoalRunner GetOrCreatePlayerGoalRunner(string id)
    {
        PlayerGoalRunner playerGoalRunner = TutorialGoalRunners.ToList().Find((PlayerGoalRunner pgr) => pgr.GoalConfig.ID == id);

        if (playerGoalRunner == null)
        {
            PlayerGoalConfig config = PersistentSingleton <Economies> .Instance.TutorialGoals.Find((PlayerGoalConfig cfg) => cfg.ID == id);

            playerGoalRunner = new PlayerGoalRunner(config);
            TutorialGoalRunners.Add(playerGoalRunner);
        }
        return(playerGoalRunner);
    }
Пример #4
0
    private void SetupTutorialGoal(PlayerGoalRunner goalRunner)
    {
        base.transform.DestroyChildrenImmediate();
        if (goalRunner == null || !goalRunner.GoalConfig.GetShowInUI())
        {
            m_animator = null;
            return;
        }
        Dictionary <string, object> dictionary = new Dictionary <string, object>();

        dictionary.Add("PlayerGoalRunner", goalRunner);
        GameObject gameObject = Singleton <PropertyManager> .Instance.Instantiate(m_notificationPrefab, Vector3.zero, Quaternion.identity, dictionary);

        gameObject.transform.SetParent(base.transform, worldPositionStays: false);
        m_animator = gameObject.GetComponent <Animator>();
    }
Пример #5
0
    private string GetPrefabPath()
    {
        PlayerGoalRunner playerGoalRunner = (PlayerGoalRunner)Singleton <PropertyManager> .Instance.GetContext("PlayerGoalRunner", base.transform);

        switch (playerGoalRunner.GoalConfig.Task)
        {
        case PlayerGoalTask.AmountSkillUsed:
            return("UI/GoalCardProfiles/GoalProfile." + playerGoalRunner.GoalConfig.Task + "." + (SkillsEnum)playerGoalRunner.GoalConfig.Parameter);

        case PlayerGoalTask.HeroLevel:
            return("UI/GoalCardProfiles/GoalProfile." + playerGoalRunner.GoalConfig.Task + "." + playerGoalRunner.GoalConfig.Parameter);

        default:
            return("UI/GoalCardProfiles/GoalProfile." + playerGoalRunner.GoalConfig.Task);
        }
    }
Пример #6
0
 public override void Install(Dictionary <string, object> parameters)
 {
     m_runner = (parameters["PlayerGoalRunner"] as PlayerGoalRunner);
     Add("PlayerGoalRunner", m_runner);
 }