void Start()
    {
        // Get the attached components we need
        layoutAnim = GetComponent <LayoutAnimator>();

        // Init lists
        _crateItems = new List <LootCrateItem>();

        _headerBar = (HeaderBarInterface)MenuManager.Instance.Load("Interface_HeaderBar");
        _headerBar.ShowHeader();

        signals.OnChangedCurrency += OnChangedCurrency;
        signals.OnItemRemoved     += OnItemRemoved;
    }
    void Start()
    {
        canvasGroup.alpha = 0;
        canvasGroup.DOFade(1, 1.0f);

        //Hook Footer button click-handlers:
        btnGoBack.onClick.AddListener(BtnGoBack);

        _scrollerInitPos = scroller.transform.localPosition;

        _headerBar = (HeaderBarInterface)MenuManager.Instance.Load("Interface_HeaderBar");
        _headerBar.ShowHeader();

        signals.OnChangedCurrency += OnChangedCurrency;
        signals.OnGetEverything   += OnGetEverything;

        LoadCrates();
    }
Esempio n. 3
0
    public void Initialize(HeaderBarInterface userInfo)
    {
        if (!DataManager.Instance.isLoaded)
        {
            return;
        }

        tutorialManager = GameObject.Find("TutorialManager").GetComponent <TutorialManager>();
        MenuManager.Instance.Remove("Interface_Splash");

        Name = "CampInterface";

        UserInformation = userInfo;
        UserInformation.ShowHeader();

        signals.OnExploreStarted += OnExploreStarted;

        ScrollMenuRef.onIndexChanged += OnIndexChangedFromSwipe;

        //Triggers callbacks hooked to ".OnStatusChanged", such as the mailbox icon.
        API.Messages.CheckInbox();

        LoadExplorePanel();
        ChangePanelIndex(2, false);

        // Check player level ups
        StartCoroutine(CheckLevel());

        if (playerMan.CampScreenToLoadInto > -1)
        {
            ChangePanelIndex(playerMan.CampScreenToLoadInto, false);
            playerMan.CampScreenToLoadInto = -1;
        }

        if (!PlayerPrefs.HasKey("ftue_intro_story") && !PlayerPrefs.HasKey("tutorial_step"))
        {
            StoryManager.Instance.DisplayStory("story_intro_story", tutorialManager.LockToSummon);
            PlayerPrefs.SetInt("tutorial_step", 1);
            PlayerPrefs.SetInt("ftue_intro_story", 1);
        }
        else
        {
            // If the user quit out partway through the tutorial, show the current state here
            switch (PlayerPrefs.GetInt("tutorial_step"))
            {
            case 1:
                tutorialManager.LockToSummon();
                break;

            case 2:
                tutorialManager.LockToSummon();
                break;

            case 3:
                tutorialManager.LockToHeroDetails();
                break;

            case 4:
                tutorialManager.LockToHeroDetails();
                PlayerPrefs.SetInt("tutorial_step", 3);
                break;

            case 5:
            case 6:
            case 7:
            case 8:
                StoryManager.Instance.DisplayStory("story_tutorial_herodetails_complete", tutorialManager.LockToExplore);
                PlayerPrefs.SetInt("tutorial_step", 6);
                break;

            case 9:
                // Play the hero details complete story
                StoryManager.Instance.DisplayStory("story_tutorial_end_ftue", tutorialManager.Unlock);
                PlayerPrefs.SetInt("tutorial_step", 10);
                break;
            }
        }
    }