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;
            }
        }
Пример #2
0
    /// <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);
     }
 }
Пример #4
0
    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);
        }
Пример #6
0
 protected override void OnDeselected()
 {
     if (_gridObject.HasBeenPlaced)
     {
         resetObject();
         base.OnDeselected();
     }
     else
     {
         PoolBoss.Despawn(_gridObject.transform);
     }
 }
Пример #7
0
    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);
        }
    }
Пример #8
0
    /// <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
    }
Пример #9
0
        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>();
        }
    }
Пример #11
0
 /// <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();
 }
Пример #12
0
    private IEnumerator WaitUntilTimeUp()
    {
        yield return(_timerDelay);

        PoolBoss.Despawn(_trans);
    }
Пример #13
0
 private void DestroyBullet(DanmakuBullet bullet)
 {
     //Core GameKit Integration
     PoolBoss.Despawn(bullet.transform);
 }
Пример #14
0
 private void OnEnable()
 {
     World.Instance.Executor.DelayExecute(Delay, x => PoolBoss.Despawn(transform));
 }