コード例 #1
0
 void OnDestroy()
 {
     if (I == this)
     {
         I = null;
     }
 }
コード例 #2
0
        static void Init()
        {
            if (I != null)
            {
                return;
            }

            I = Instantiate(Resources.Load <GameResultUI>(ResourcesPath));
            I.BonesCounter.Hide();
        }
コード例 #3
0
        void Start()
        {
            // Navigation manager
            NavigationManager.I.CurrentScene = AppScene.PlaySessionResult;

            // Calculate items to unlock count
            int itemsToUnlock = NavigationManager.I.CalculateUnlockItemCount();

            List <RewardPack> oldRewards = AppManager.I.Player.RewardsUnlocked.FindAll(ru => ru.PlaySessionId == AppManager.I.Player.CurrentJourneyPosition.ToString());
            int itemAlreadyUnlocked      = oldRewards.Count;

            for (int i = 0; i < itemsToUnlock - oldRewards.Count; i++)
            {
                // if necessary add one new random reward unlocked
                RewardPack newRewardToUnlock = RewardSystemManager.GetNextRewardPack()[0];
                oldRewards.Add(newRewardToUnlock);
                AppManager.I.Player.AddRewardUnlocked(newRewardToUnlock);
            }

            // Show UI result and unlock transform parent where show unlocked items
            GameObject[] objs = new GameObject[] { };
            objs = GameResultUI.ShowEndsessionResult(NavigationManager.I.UseEndSessionResults(), itemAlreadyUnlocked);

            for (int i = 0; i < objs.Length - oldRewards.Count; i++)
            {
                // if necessary add one new random reward not to be unlocked!
                oldRewards.Add(RewardSystemManager.GetNextRewardPack()[0]);
            }

            LogManager.I.LogPlaySessionScore(TeacherAI.I.journeyHelper.GetCurrentPlaySessionData().Id, objs.Length);
            // save max progression (internal check if necessary)
            NavigationManager.I.MaxJourneyPosistionProgress();

            // for any rewards mount them model on parent transform object (objs)
            for (int i = 0; i < oldRewards.Count && i < objs.Length; i++)
            {
                ModelsManager.MountModel(
                    oldRewards[i].ItemID,
                    objs[i].transform,
                    oldRewards[i].GetMaterialPair()
                    );
            }
        }
コード例 #4
0
 void Awake()
 {
     I = this;
 }
コード例 #5
0
 public void Show(int stars)
 {
     GameResultUI.ShowEndgameResult(stars);
 }
コード例 #6
0
 public void Hide()
 {
     GameResultUI.HideEndgameResult();
 }