public virtual void PatrolStreet(IPatrol place) { if (this.Heroe != null) { this.Heroe.PatrolStreet(place); } }
public static void CatchPlayer(IPatrol patrol) { if (Singleton <SceneController> .Instance.isGameOver || patrol.dropOff) { return; } Singleton <SceneController> .Instance.isGameOver = true; }
public static void ChasePlayer(IPatrol patrol, Transform player) { if (Singleton <SceneController> .Instance.isGameOver || patrol.dropOff) { return; } patrol.discover = true; patrol.chasePlayer = player; }
public static void DropPlayer(IPatrol patrol) { if (Singleton <SceneController> .Instance.isGameOver || patrol.dropOff) { return; } patrol.ChangeColor(); Singleton <SceneController> .Instance.AddScore((int)patrol.speed); patrol.discover = false; patrol.chasePlayer = null; patrol.dropOff = true; }
public override void PatrolStreet(IPatrol place) { Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("The cop wil patroll the streets..."); Console.ResetColor(); this.Vehicle.GetSate().TurnOn(); this.Vehicle.TurnOnSiren(); this.Vehicle.Drive(); if (this.Vehicle.GetSate().GetType() == typeof(Broken)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"\nOh no! the cop's vehicle has broken and now he can not patrol the streets.\n"); Console.ResetColor(); return; } else { // While the vehicle is not at rest, it slows down so that it can be switched off. if (this.Vehicle.GetSate().GetType() != typeof(StandOff) && this.Vehicle.GetSate().GetType() != typeof(TurnedOff)) { this.Vehicle.GetSate().Brake(); } this.Vehicle.GetSate().TurnOff(); Console.WriteLine(this.Vehicle.GetSate().ToString()); } if (place.ThereIsSomethingOutOfOrdinary()) { this.Tool.Use(); this.command.Execute(); this.Tool.PutAway(); } else { Console.WriteLine("There is nothing out of the ordinary."); } }
virtual protected void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform.GetChild(0).transform; deathBodyHolder = BodiesHolder.Instance.transform; rb = GetComponent <Rigidbody>(); nav = GetComponent <NavMeshAgent>(); nav.angularSpeed = 0; nav.speed = speed; attackFSM = GetComponentInChildren <IAttack>(); patrol = GetComponent <IPatrol>(); health = GetComponent <Health>(); health.OnDeath().AddListener(OnNoHealth); if (player) { Health playerHealth = player.GetComponentInParent <Health>(); playerHealth.OnDeath().AddListener(OnPlayerDeath); } }
static partial void FillBinaryTopicsCustom(MutagenFrame frame, IPatrol item) { item.Topics.SetTo(ATopicReferenceBinaryCreateTranslation.Factory(frame)); }
static partial void FillBinaryPatrolScriptMarkerCustom(MutagenFrame frame, IPatrol item) { if (frame.ReadSubrecordFrame().Content.Length != 0) { throw new ArgumentException($"Marker had unexpected length."); } }
public static partial ParseResult FillBinaryPatrolScriptMarkerCustom(MutagenFrame frame, IPatrol item, PreviousParse lastParsed) { if (frame.ReadSubrecordFrame().Content.Length != 0) { throw new ArgumentException($"Marker had unexpected length."); } return(lastParsed); }