Ejemplo n.º 1
0
 void LevelCompleteCallback(LevelCore level)
 {
     if (level.IsLast)
     {
         Complete();
     }
 }
Ejemplo n.º 2
0
        public virtual void Set(LevelCore data, int index)
        {
            Level = data;

            label.text = (index + 1).ToString();

            UpdateState();
        }
        public virtual void For(LevelCore level)
        {
            for (int i = 0; i < Elements.Count; i++)
            {
                Elements[i].Interactable = level.UnlockedOn(Elements[i].Difficulty);
            }

            Show();
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        protected virtual LevelUITemplate Create(LevelCore level, int index)
        {
            var instance = Instantiate(template, transform);

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

            script.Init();
            script.Set(level, index);
            script.OnClick += TemplateClickedCallback;

            return(script);
        }
Ejemplo n.º 6
0
        public int IndexOf(LevelCore level)
        {
            for (int i = 0; i < levels.Length; i++)
            {
                if (levels[i] == level)
                {
                    return(i);
                }
            }

            throw new ArgumentException();
        }
 public virtual void Request(LevelCore level, float time)
 {
     Request(level, level.Region.Progress.Difficulty, time);
 }
 public virtual void Request(LevelCore level, RegionDifficulty difficulty, float time)
 {
     Request(level.Region.name, level.Index, difficulty.ID, time);
 }
Ejemplo n.º 9
0
        public virtual void Load(LevelCore level, RegionDifficulty difficulty)
        {
            Current = new SelectionData(level, difficulty);

            Scenes.Load.All(level.Scene, Scenes.Level);
        }
Ejemplo n.º 10
0
 public virtual void Load(LevelCore level) => Load(level, level.Region.Progress.Difficulty);
Ejemplo n.º 11
0
 public SelectionData(LevelCore level, RegionDifficulty difficulty) : this()
 {
     this.Level      = level;
     this.Difficulty = difficulty;
 }
Ejemplo n.º 12
0
        void OnLevelSelected(LevelCore level)
        {
            Selection.Level = level;

            Difficulty.For(level);
        }
Ejemplo n.º 13
0
 public virtual void Load(LevelCore level)
 {
     Load(level, progress.Difficulty);
 }
Ejemplo n.º 14
0
        public virtual void Unlock(LevelCore level)
        {
            Unlocked = true;

            progress.Count = level.Index;
        }
Ejemplo n.º 15
0
 public virtual bool Contains(LevelCore level)
 {
     return(levels.Contains(level));
 }
Ejemplo n.º 16
0
 public virtual void Set(LevelCore reference) => Level = reference;