void go(Sheriff agent, eLocation loc) { GameObject g = GameObject.Find(loc.ToString()); agent.toLoc = new Vector2(g.transform.position.x, g.transform.position.z); agent.CreateSpeechBubble("Goin' to " + loc.ToString()); agent.path = agent.aStar(); }
void go(Outlaw agent, eLocation loc) { arrived = false; goinOutlawCamp = (loc == eLocation.OutlawCamp) ? true : false; index = 0; GameObject g = GameObject.Find(loc.ToString()); agent.toLoc = new Vector2(g.transform.position.x, g.transform.position.z); agent.CreateSpeechBubble("Goin' to " + loc.ToString()); agent.path = agent.aStar(); }
//===================================================== private string GetLocationName(eLocation targetLocation) { switch (targetLocation) { case eLocation.NULL: case eLocation.NUM_PUZZLE_LOCATIONS: case eLocation.MAIN_HALL: return("MainHall"); case eLocation.COMMON_ROOM: return("CommonRoom"); case eLocation.BOSS_ROOM: return("BossRoom01"); case eLocation.REFECTORY: return("RefectoryRoom"); case eLocation.TRADING_CARD_ROOM: return("TradingCardsRoom"); case eLocation.HIGHSCORES_ROOM: return("HighScoresRoom"); case eLocation.CLOTHING_ROOM: return("ClothingRoom"); default: // Puzzle Rooms var loc = targetLocation.ToString(); var index = loc.Substring(loc.Length - 2); //Debug.Log( "Room index: " + index ); return("PuzzleRoom" + index); } }
//===================================================== public void SetNextLocation(eLocation target, bool registerForCutscene = true) { // Store current location as previous for use with alternate spawn-points in target room e.g. Main Hall _lastLocation = _targetLocation; _targetLocation = target; // If we have a valid start time for the last location then upload an analytics event // showing how long we've been in that location for if (_lastLocationStartTime > 0.0f) { var timeElapsed = Mathf.Clamp(Time.time - _lastLocationStartTime, 0.0f, 3600.0f); var eventDictionary = new Dictionary <string, object>(); eventDictionary["locationID"] = _lastLocation.ToString(); eventDictionary["timeSpent"] = timeElapsed; Analytics.CustomEvent("VisitLocation", eventDictionary); } _lastLocationStartTime = Time.time; // Wait for cutscene completion before loading next scene (fade-out triggered by a door or CutsceneManager) if (registerForCutscene) { CutsceneManager.CutsceneCompleteEvent += OnCutsceneCompleteEvent; } }