public override void Apply(Entity e, ModuleWorker worker) { Vector2 rndPos = Random.insideUnitCircle; Vector3 newPosition = new Vector3(Mathf.Clamp(rndPos.x, minRadius, maxRadius), 0, Mathf.Clamp(rndPos.y, minRadius, maxRadius)); e.transform.position += newPosition; worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (target) { target.SendMessage(functionToCall, e); } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (positions.Count > 0) { e.transform.position = positions[Random.Range(0, positions.Count)]; } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (target) { target.BroadcastMessage(functionToCall, SendMessageOptions.RequireReceiver); } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (worker.linkedSpawnPath != null) { e.TriggerBehaviour(worker.pathStartIdentifier, worker.linkedSpawnPath); } worker.ProcessNext(e); }
IEnumerator Execute(ModuleWorker worker) { worker.Restart(); yield return new WaitForSeconds(delay); while (GameWorld.Instance.IsPaused) yield return null; if (prefab != null) { worker.ProcessNext(Instantiate(prefab, worker.source.transform.position, Quaternion.AngleAxis(Random.Range(0, 360f), Vector3.up)) as Entity); } }
public override void Apply(Entity e, ModuleWorker worker) { if (path == null) { throw new ArgumentException("Path invalid"); } worker.linkedSpawnPath = path; worker.pathStartIdentifier = triggerIdentifier; if (path.points.Count > 0) { e.transform.position = path.points[0].position; } worker.ProcessNext(e); }
private void StartXssDetection(HttpApplication application) { IUrlChecker urlChecker = new UrlChecker(Configuration); IRegexHelper regexHelper = new RegexHelper(); IRequestSanitizer requestSanitizer = new RequestSanitizer(new ReflectionHelper(), regexHelper); ILogger nullLogger = _logger ?? (_logger = new NullLogger()); IXssGuard xssGuard = new XssGuard(Configuration, regexHelper, nullLogger); IIpAdressHelper ipAdressHelper = new IpAdressHelper(); IModuleWorker moduleWorker = new ModuleWorker(Configuration, urlChecker, requestSanitizer, xssGuard, ipAdressHelper, nullLogger); moduleWorker.Attach(application); }
IEnumerator Execute(ModuleWorker worker) { if (started) { yield break; } started = true; yield return new WaitForSeconds(delay); RESTART: if (prefab == null) { Debug.LogError("human prefab not assigned"); yield break; } if (worker.markedForDeletion) { yield break; } while (GameWorld.Instance.IsPaused) yield return null; worker.Restart(); worker.ProcessNext(Instantiate(prefab, worker.source.transform.position, Quaternion.AngleAxis(Random.Range(0, 360f), Vector3.up)) as Entity); yield return new WaitForSeconds(timeInterval); goto RESTART; }
public override void Apply(Entity e, ModuleWorker worker) { if (e.SetBehaviour(behaviour)) { if (path != null) { e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (e.SetBehaviour(behaviour)) { if (paths.Count > 0) { PatrolPath path = paths[Random.Range(0, paths.Count - 1)]; e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (behaviours.Count == 0) { throw new System.Exception("No behaviours to apply!"); } Intelligence behaviour = behaviours[Random.Range(0, behaviours.Count - 1)]; if (e.SetBehaviour(behaviour)) { if (path != null) { e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }
IEnumerator Execute(ModuleWorker worker) { yield return new WaitForSeconds(delay); float partTime = timeSpan / Mathf.Max(1f, amount); for (int i = 0; i < amount; i++) { if (worker.markedForDeletion) { yield break; } while (GameWorld.Instance.IsPaused) yield return null; if (prefab != null) { Entity e = Instantiate(prefab, worker.source.transform.position, Quaternion.AngleAxis(Random.Range(0, 360f), Vector3.up)) as Entity; e.name = e.GetInstanceID().ToString(); worker.ProcessNext(e); } yield return new WaitForSeconds(partTime); worker.Restart(); } }
public abstract void Apply(Entity e, ModuleWorker worker);
public override void Apply(Entity e, ModuleWorker worker) { worker.source.StartCoroutine(Execute(worker)); }