Esempio n. 1
0
    public override void AlwaysStart()
    {
        SceneLoader instance = SceneLoader.Instance;

        m_stepIndexes = new int[Steps.Length];
        int i;

        for (i = 0; i < Steps.Length; i++)
        {
            m_stepIndexes[i] = PersistentSingleton <Economies> .Instance.TutorialGoals.FindIndex((PlayerGoalConfig goal) => goal.ID == Steps[i]);
        }
        UniRx.IObservable <bool> observable = from step in PlayerData.Instance.TutorialStep
                                              select IsVisible(step);

        if (m_delay != 0f)
        {
            observable = observable.Delay(TimeSpan.FromSeconds(m_delay));
        }
        UniRx.IObservable <bool> left = from step in PlayerData.Instance.TutorialStep
                                        select IsVisible(step);

        left.CombineLatest(observable, (bool a, bool b) => a && b).DistinctUntilChanged().TakeUntilDestroy(instance)
        .SubscribeToActiveUntilNull(base.gameObject)
        .AddTo(this);
    }
Esempio n. 2
0
    public override void AlwaysStart()
    {
        SceneLoader instance  = SceneLoader.Instance;
        int         stepIndex = PersistentSingleton <Economies> .Instance.TutorialGoals.FindIndex((PlayerGoalConfig goal) => goal.ID == Step);

        UniRx.IObservable <bool> observable = from step in PlayerData.Instance.TutorialStep
                                              select step == stepIndex;

        if (m_delay != 0f)
        {
            observable = observable.Delay(TimeSpan.FromSeconds(m_delay));
        }
        UniRx.IObservable <bool> left = from step in PlayerData.Instance.TutorialStep
                                        select step == stepIndex;

        (from turn in left.CombineLatest(observable, (bool a, bool b) => a && b).DistinctUntilChanged()
         where turn
         select turn).TakeUntilDestroy(instance).SubscribeToActiveUntilNull(base.gameObject).AddTo(this);
    }
Esempio n. 3
0
    public override void AlwaysStart()
    {
        m_selectable = GetComponent <Toggle>();
        SceneLoader instance = SceneLoader.Instance;

        m_stepIndex = PersistentSingleton <Economies> .Instance.TutorialGoals.FindIndex((PlayerGoalConfig goal) => goal.ID == Step);

        UniRx.IObservable <bool> observable = from step in PlayerData.Instance.TutorialStep
                                              select IsVisible(step);

        if (m_delay != 0f)
        {
            observable = observable.Delay(TimeSpan.FromSeconds(m_delay));
        }
        UniRx.IObservable <bool> left = from step in PlayerData.Instance.TutorialStep
                                        select IsVisible(step);

        left.CombineLatest(observable, (bool a, bool b) => a && b).DistinctUntilChanged().TakeUntilDestroy(instance)
        .SubscribeToInteractable(m_selectable)
        .AddTo(this);
    }