Пример #1
0
    private void FixedUpdate()
    {
        Vector3 sourcePosition = GetSourcePosition();

        Collider[] colliders = Physics.OverlapSphere(sourcePosition, poisoningRadius);
        foreach (Collider c in colliders)
        {
            if (c.gameObject != gameObject)
            {
                Explosive explosive = c.gameObject.GetComponent <Explosive>();
                if (explosive != null)
                {
                    explosive.AddPoisoning(GetCorrectPoisoningAmount(c, sourcePosition));
                }
            }
        }
    }