using System; using SUISS.Core; using UnityEngine; public class RoadSelectionPopupState : PopupBaseState { public override void Enter(State oldState) { base.Enter(oldState); CIGTutorialManager instanceIfAvailable = SingletonMonobehaviour.InstanceIfAvailable; if (instanceIfAvailable != null && instanceIfAvailable.state == CIGTutorialState.Road) { this.ShowTutorialDialog(); } else { this.HideTutorialDialog(); } } public override void Leave(State newState) { base.Leave(newState); this.HideTutorialDialog(); } public void RoadClicked() { base.ClosePopup(delegate() { CityIsland.Current.StartBuildingRoad(this._roadPrefab); }); } public void WalkwayClicked() { base.ClosePopup(delegate() { CityIsland.Current.StartBuildingRoad(this._walkwayPrefab); }); } public void RiverClicked() { base.ClosePopup(delegate() { CityIsland.Current.StartBuildingRoad(this._riverPrefab); }); } private void ShowTutorialDialog() { ((RoadSelectionPopupView)this.View).ShowTutorialDialog(); } private void HideTutorialDialog() { ((RoadSelectionPopupView)this.View).HideTutorialDialog(); } [SerializeField] private GameObject _roadPrefab; [SerializeField] private GameObject _walkwayPrefab; [SerializeField] private GameObject _riverPrefab; }