void LevelCompleteCallback(LevelCore level) { if (level.IsLast) { Complete(); } }
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(); }
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); }
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); }
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); }
public virtual void Load(LevelCore level, RegionDifficulty difficulty) { Current = new SelectionData(level, difficulty); Scenes.Load.All(level.Scene, Scenes.Level); }
public virtual void Load(LevelCore level) => Load(level, level.Region.Progress.Difficulty);
public SelectionData(LevelCore level, RegionDifficulty difficulty) : this() { this.Level = level; this.Difficulty = difficulty; }
void OnLevelSelected(LevelCore level) { Selection.Level = level; Difficulty.For(level); }
public virtual void Load(LevelCore level) { Load(level, progress.Difficulty); }
public virtual void Unlock(LevelCore level) { Unlocked = true; progress.Count = level.Index; }
public virtual bool Contains(LevelCore level) { return(levels.Contains(level)); }
public virtual void Set(LevelCore reference) => Level = reference;