private void createPooledRevealer(Queue <HitboxRevealer> poolQueue, bool blast) { HitboxRevealer rev = Instantiate(blast ? _hitboxNotBoxPrefab : _hitboxBoxPrefab, transform); poolQueue.Enqueue(rev); //totalPool++; }
private BlastAttack.Result BlastAttack_Fire(On.RoR2.BlastAttack.orig_Fire orig, BlastAttack self) { BlastAttack.Result result = orig(self); HitboxRevealer box = Instantiate(_hitboxNotBoxPrefab).initBlastBox(self.position, self.radius); Utils.LogReadout($"making blast hitbox at {self.position}, {self.radius}: {box != null}"); return(result); }
private void populateAss() { AssetBundle MainAss = null; using (var assetStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SillyHitboxViewer.sillyhitbox")) { MainAss = AssetBundle.LoadFromStream(assetStream); } _hitboxBoxPrefab = MainAss.LoadAsset <GameObject>("hitboxPreviewInator")?.GetComponent <HitboxRevealer>(); _hitboxNotBoxPrefab = MainAss.LoadAsset <GameObject>("hitboxPreviewInatorSphere")?.GetComponent <HitboxRevealer>(); _hitboxNotBoxPrefabTall = MainAss.LoadAsset <GameObject>("hitboxPreviewInatorCapsule")?.GetComponent <HitboxRevealer>(); }
public void init(HitBoxGroup hitboxGroup_, HitboxRevealer hitboxPrefab_, GameObject attacker) { hitboxGroup = hitboxGroup_; _hitboxPrefab = hitboxPrefab_; if (attacker) { CharacterBody bod = attacker.GetComponent <CharacterBody>(); if (bod) { _isMerc = checkMerc((int)bod.bodyIndex); } } initVisaulizinators(); }
private HitboxRevealer requestPooledRevealer(Queue <HitboxRevealer> poolQueue, bool blast) { if (poolQueue.Count <= 0) { instance.createPooledRevealer(poolQueue, blast); Utils.LogWarning($"requestPooledRevealer: pool full. adding revealer to total"); } HitboxRevealer revealer = poolQueue.Dequeue(); if (revealer == null) { Utils.LogWarning($"requestPooledRevealer: pooled revealer is null. trying again"); return(requestPooledRevealer(poolQueue, blast)); } return(revealer); }
private void returnPooledRevealer(HitboxRevealer rev, Queue <HitboxRevealer> poolQueue) { rev.transform.parent = instance.transform; poolQueue.Enqueue(rev); }
public void returnPooledBlastRevealer(HitboxRevealer rev) { returnPooledRevealer(rev, _blastPool); }