/// <summary>Parses an XML horn node</summary> /// <param name="node">The node to parse</param> /// <param name="car">The car</param> /// <param name="Horn">The horn to apply this node's contents to</param> /// <param name="Position">The default sound position</param> /// <param name="Radius">The default sound radius</param> private void ParseHornNode(XmlNode node, CarBase car, out Horn Horn, Vector3 Position, double Radius) { Horn = new Horn(car); foreach (XmlNode c in node.ChildNodes) { switch (c.Name.ToLowerInvariant()) { case "start": ParseNode(c, out Horn.StartSound, ref Position, Radius); break; case "loop": ParseNode(c, out Horn.LoopSound, ref Position, Radius); break; case "end": case "release": case "stop": ParseNode(c, out Horn.EndSound, ref Position, Radius); break; case "toggle": if (c.InnerText.ToLowerInvariant() == "true" || c.InnerText.ToLowerInvariant() == "1") { Horn.Loop = true; } break; } Horn.SoundPosition = Position; } }
public static void Postfix(Horn __instance) { foreach (var layer in __instance.loopLayered.layers) { layer.inertialPitch = false; } }
public void Beep() { // Tạo Horn phải cung cập level Horn horn = new Horn(10); horn.Beep(); }
public override int GetHashCode() { int hash = 1; if (TurnSignal != 0) { hash ^= TurnSignal.GetHashCode(); } if (HighBeam != false) { hash ^= HighBeam.GetHashCode(); } if (LowBeam != false) { hash ^= LowBeam.GetHashCode(); } if (Horn != false) { hash ^= Horn.GetHashCode(); } if (EmergencyLight != false) { hash ^= EmergencyLight.GetHashCode(); } return(hash); }
// Use this for initialization void Awake() { sandwiches = new List<GameObject>(); foodInWater = new Queue<GameObject>(); horn = GameObject.FindGameObjectWithTag("Horn").GetComponent<Horn>(); if (onDuty == null) { onDuty = this; } orderPad = GameObject.FindGameObjectWithTag("OrderPad").GetComponent<Text>(); }
public Game() { GameClock = new GameClock(); Horn = new Horn(); Period = new Period(); ShotClock = new ShotClock(); Possession = new Possession(); Home = new Team(); Guest = new Team(); TimeoutClock = new TimeoutClock(); }
// Use this for initialization void Awake() { sandwiches = new List <GameObject>(); foodInWater = new Queue <GameObject>(); horn = GameObject.FindGameObjectWithTag("Horn").GetComponent <Horn>(); if (onDuty == null) { onDuty = this; } orderPad = GameObject.FindGameObjectWithTag("OrderPad").GetComponent <Text>(); }
public static bool Prefix(Horn __instance) { if (__instance.input < 0.1f) { lastReset[__instance] = Time.time; } else if (!__instance.hitPlayed && __instance.input >= 0.9f && Time.time - lastReset[__instance] < 0.5f && __instance.hit != null) { __instance.hit.Play(); __instance.hitPlayed = true; } __instance.loopLayered.Set(__instance.input); return(false); }
private void InitializeHorn() { try { timerNotifications = new Timer(CheckNotifications, null, 0, 1000); Dispatcher.BeginInvoke(new Action(() => { horn = Horn.GetInstance(); })); } catch (Exception ex) { Logger.LogIndustrialMonitoring(ex); } }
// horn trong có được qua hàm tạo, ta nói // horn Inject (bơm vào) bằng hàm khởi tạo public Car(Horn horn) => this.horn = horn;
protected override void ProcessBuild(Horn.Core.PackageStructure.IPackageTree packageTree, IProcessFactory processFactory, string pathToBuildTool, string cmdLineArguments) { Console.WriteLine("Processing Build"); }
protected override void CopyDependenciesTo(Horn.Core.PackageStructure.IPackageTree packageTree) { Console.WriteLine(packageTree.Name); }
//public override BuildEngine Build(IProcessFactory processFactory, PackageStructure.IPackageTree packageTree) //{ // return this; //} protected override void CopyArtifactsToBuildDirectory(Horn.Core.PackageStructure.IPackageTree packageTree) { Console.WriteLine("Copying"); }
public override void TestConstructor() { Horn h = new Horn(); Assert.AreEqual("Brass", h.Material); }