void OnTriggerEnter(Collider other)
    {
        // Adds paintballs to the pool
        PaintballPool.instance.AddPaintballToPool(gameObject);

        // creates particle effects.
        ParticleSystem cloudParticle = Instantiate(PaintProjectileManager.GetInstance().cloudParticlePrefab);
        ParticleSystem burstParticle = Instantiate(PaintProjectileManager.GetInstance().burstParticlePrefab);

        MyShaderBehavior script = null;

        cloudParticle.transform.position = transform.position;
        burstParticle.transform.position = transform.position;

        var cloudSettings = cloudParticle.main;
        var burstSettings = burstParticle.main;

        cloudSettings.startColor = paintColor;
        burstSettings.startColor = paintColor;

        cloudParticle.Play();
        burstParticle.Play();

        PaintProjectileManager manager = PaintProjectileManager.GetInstance();

        for (int i = 0; i < 14; ++i)
        {
            if (Physics.Raycast(transform.position, manager.GetSphereRay(i), out RaycastHit hit, paintDiameter))
            {
                if (hit.collider is MeshCollider)
                {
                    script = hit.collider.gameObject.GetComponent <MyShaderBehavior>();
                    if (null != script)
                    {
                        script.PaintOnColored(hit.textureCoord2, manager.GetRandomProjectileSplash(), paintColor);
                        script.PaintOnColored(hit.textureCoord2, manager.GetRandomProjectileSplash(), paintColor);
                    }
                }
            }
        }

        if (script != null)
        {
            float value = TextureColorFillCalculator.CalculateFill(GetObjectTexture().GetPixels(), paintColor, 0) * 100;
            menuController.SetSliderValue(value);
        }
    }
    void OnTriggerEnter(Collider other)
    {
        if (!isActive)
        {
            return;
        }

        Destroy(gameObject);
        ParticleSystem cloudParticle = Instantiate(GameManager.GetInstance().GetProjectileManager().cloudParticlePrefab);
        ParticleSystem burstParticle = Instantiate(GameManager.GetInstance().GetProjectileManager().burstParticlePrefab);

        cloudParticle.transform.position = transform.position;
        burstParticle.transform.position = transform.position;
        var cloudSettings = cloudParticle.main;

        cloudSettings.startColor = paintColor;
        var burstSettings = burstParticle.main;

        burstSettings.startColor = paintColor;
        cloudParticle.Play();
        burstParticle.Play();

        PaintProjectileManager manager = GameManager.GetInstance().GetProjectileManager();

        for (int i = 0; i < 14; ++i)
        {
            RaycastHit hit;
            if (Physics.Raycast(transform.position, manager.GetRandomSphereRay() /*GetSphereRay(i)*/, out hit, paintDiameter))
            {
                if (hit.collider is MeshCollider)
                {
                    MyShaderBehavior script = hit.collider.gameObject.GetComponent <MyShaderBehavior>();
                    if (null != script)
                    {
                        script.PaintOnColored(hit.textureCoord2, manager.GetRandomProjectileSplash(), paintColor);
                    }
                }
            }
        }

        INpcBehavior npcScript = other.GetComponent <INpcBehavior>();

        if (null != npcScript)
        {
            npcScript.DealDamage(damage);
        }
    }