コード例 #1
0
        public virtual void Load(LevelCore level, RegionDifficulty difficulty)
        {
            if (Contains(level) == false)
            {
                throw new ArgumentException("Trying to load " + level.name + " But it's not a part of the " + name + " Region");
            }

            World.Load(level, difficulty);
        }
コード例 #2
0
        protected virtual RegionDifficultyUITemplate CreateTemplate(RegionDifficulty difficulty)
        {
            var instance = Instantiate(template, panel);

            var script = instance.GetComponent <RegionDifficultyUITemplate>();

            script.Init();
            script.Set(difficulty);

            script.OnClick += OnElementClicked;

            return(script);
        }
コード例 #3
0
        public bool UnlockedOn(RegionDifficulty difficulty)
        {
            if (difficulty == null)
            {
                return(true);
            }

            if (difficulty > Region.Progress.Difficulty)
            {
                return(Region.Progress.At(difficulty.Previous) == Region.Size && Index == 0);
            }
            else
            {
                return(Region.Progress.At(difficulty) >= Index);
            }
        }
コード例 #4
0
            public virtual int At(RegionDifficulty target)
            {
                if (difficulty == null)
                {
                    return(0);
                }

                if (target > difficulty) //haven't reached this difficulty yet
                {
                    return(0);
                }
                else if (target < difficulty) //have surpassed this difficulty
                {
                    return(Region.Size);
                }
                else //this is the current difficulty
                {
                    return(count);
                }
            }
コード例 #5
0
 public virtual void Request(LevelCore level, RegionDifficulty difficulty, float time)
 {
     Request(level.Region.name, level.Index, difficulty.ID, time);
 }
コード例 #6
0
        public virtual void Set(RegionDifficulty difficulty)
        {
            this.Difficulty = difficulty;

            UpdateState();
        }
コード例 #7
0
        public virtual void Load(LevelCore level, RegionDifficulty difficulty)
        {
            Current = new SelectionData(level, difficulty);

            Scenes.Load.All(level.Scene, Scenes.Level);
        }
コード例 #8
0
 public SelectionData(LevelCore level, RegionDifficulty difficulty) : this()
 {
     this.Level      = level;
     this.Difficulty = difficulty;
 }
コード例 #9
0
 public virtual bool Contains(RegionDifficulty element)
 {
     return(list.Contains(element));
 }
コード例 #10
0
 public virtual int IndexOf(RegionDifficulty element)
 {
     return(Array.IndexOf(list, element));
 }
コード例 #11
0
        void DifficultySelectCallback(RegionDifficulty difficulty)
        {
            Selection.Difficulty = difficulty;

            LoadSelection();
        }
コード例 #12
0
 public virtual void Load(RegionDifficulty difficulty)
 {
     Region.Load(this, difficulty);
 }