Пример #1
0
    void FixedUpdate()
    {
        if (findObjects)
        {
            var physicItems = PhysicsManager.GetItemsInRange(pos, floarRange * 2);
            //Debug.LogError(physicItems.Count);

            foreach (var item in physicItems)
            {
                if (item.IsReactExplosion)
                {
                    Vector2 addVelosity = item.Position - (Vector2)pos;
                    //addVelosity.normalized
                    item.AddVelocity(50 * addVelosity.normalized);
                }
            }
            findObjects = false;
            Destroy(gameObject);

            TargetManager.ExplosionDamage(pos, floarRange * 5, damage);
        }
    }