public void ReceiveEvent(string customEventName, Vector3 eventOrigin) { switch (eventReceivedBehavior) { case EventReceivedBehavior.None: break; case EventReceivedBehavior.Despawn: PoolBoss.Despawn(Trans); break; case EventReceivedBehavior.DealXDamage: if (Kill == null) { LogNoKillable(); break; } Kill.TakeDamage(1); break; case EventReceivedBehavior.Destroy: if (Kill == null) { LogNoKillable(); break; } Kill.DestroyKillable(); break; } }
/// <summary> /// Releases bullet (back to pool or destroy). /// </summary> public void ReleaseBullet(UbhBullet bullet, bool destroy = false) { if (bullet == null || bullet.gameObject == null) { return; } bullet.OnFinishedShot(); UbhBulletManager.instance.RemoveBullet(bullet); #if USING_CORE_GAME_KIT // +++++ Replace PoolingSystem with DarkTonic's CoreGameKit. +++++ InitializePoolBoss(); PoolBoss.Despawn(bullet.transform); #else if (destroy) { Destroy(bullet.gameObject); Destroy(bullet); bullet = null; return; } bullet.SetActive(false); #endif }
// ReSharper disable once UnusedMember.Local void Update() { if (!_particles.IsAlive()) { PoolBoss.Despawn(_trans); } }
private IEnumerator ShowRoutine(Text messageLabel) { messageLabel.transform.localScale = Vector3.zero; Hashtable ht = new Hashtable(); ht.Add("time", 0.25f); ht.Add("scale", Vector3.one); ht.Add("easetype", iTween.EaseType.easeOutBack); iTween.ScaleTo(messageLabel.gameObject, ht); yield return(new WaitForSeconds(2.0f)); ht["time"] = 0.1f; ht["scale"] = Vector3.zero; ht["easetype"] = iTween.EaseType.easeInQuad; iTween.ScaleTo(messageLabel.gameObject, ht); yield return(new WaitForSeconds(0.3f)); _messages.Remove(messageLabel); PoolBoss.Despawn(messageLabel.transform); }
private IEnumerator WaitUntilTimeUp() { yield return(_timerDelay); if (listener != null) { listener.Despawning(_trans); } PoolBoss.Despawn(_trans); }
protected override void OnDeselected() { if (_gridObject.HasBeenPlaced) { resetObject(); base.OnDeselected(); } else { PoolBoss.Despawn(_gridObject.transform); } }
public void FlushMessages() { for (int i = 0; i < _animations.Count; ++i) { _animations[i].Kill(); } for (int i = 0; i < _messages.Count; ++i) { PoolBoss.Despawn(_messages[i].transform); } }
/// <summary> /// Releases game object (back to pool or destroy). /// </summary> public void ReleaseGameObject(GameObject go, bool destroy = false) { #if USING_CORE_GAME_KIT // +++++ Replace PoolingSystem with DarkTonic's CoreGameKit. +++++ PoolBoss.Despawn(go.transform); #else if (destroy) { Destroy(go); return; } go.SetActive(false); #endif }
private void Despawn(TriggeredSpawner.EventType eType) { if (LevelSettings.AppIsShuttingDown || _isDespawning) { return; } _isDespawning = true; if (listener != null) { listener.Despawning(eType, _trans); } PoolBoss.Despawn(_trans); }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.name.Contains("Pony")) { coll.enabled = false; _addNewPony(coll.transform); } if (coll.gameObject.name.Equals("SafeZone")) // Заходим в зону - оставляем овечек там { for (int i = 0; i < _ponyTransformList.Count; i++) { PonyCreation.PonyCatch(); PoolBoss.Despawn(_ponyTransformList[i]); } _ponyTransformList = new List <Transform>(); } }
/// <summary> /// Resets the object to its last valid coordinates, and clears the visualization for it. /// </summary> protected void resetObject() { if (_isPlacing) { GridManager.Instance.ClearVisualization(_gridObject); _gridObject.transform.position = GridManager.Instance.GetCell(_gridObject.Coordinates).transform.position; if (GridManager.Instance.CanBePlaced(_gridObject)) { placeObject(); } else { Debug.LogWarning("Could not find a valid placement to return object '" + _gridObject.name + "' to. Destroying."); PoolBoss.Despawn(_gridObject.transform); } _dragging = false; _isPlacing = false; } setHighlight(); }
private IEnumerator WaitUntilTimeUp() { yield return(_timerDelay); PoolBoss.Despawn(_trans); }
private void DestroyBullet(DanmakuBullet bullet) { //Core GameKit Integration PoolBoss.Despawn(bullet.transform); }
private void OnEnable() { World.Instance.Executor.DelayExecute(Delay, x => PoolBoss.Despawn(transform)); }