示例#1
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    void OnEnable()
    {
        //--------------

        StartCoroutine(Class_Mineral.FakeUpdate(transform, thisRigidbody, gameObject, thisLineRenderer));

        //--------------
    }
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


    void Particles()
    {
        //--------------

        amountDamage += currentDamage;

        if (amountDamage >= 1.8f)
        {
            if (visible == true)
            {
                Class_Forest.ParticlesDestroyed(thisTransform);
            }
            Class_Mineral.RandomMinerals(thisTransform);
            TreesPool.TakeTree(gameObject);
        }

        //--------------
    }
示例#3
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    IEnumerator SplitСube()
    {
        //--------------

        amountDamage += currentDamage;

        if (amountDamage >= 10.0f + (faultSize * 0.5f) && brokenStage0 == false)
        {
            brokenStage0 = true;
            StartCoroutine(Class_ChunkCube.CheckChildCount(thisTransform, gameObject));
            if (thisScaleX > faultSize * faultSizeOptimize)
            {
                Class_ChunkCube.CubeOutOfPool(thisTransform, numberCubeOutOfPool, cubeOutOfPoolScale, uvOffset);
                thisRenderer.enabled    = false;
                thisBoxCollider.enabled = false;
            }
            else
            {
                outPool = false;

                if (visible == true)
                {
                    Class_ChunkCube.ParticlesOutOfPool(thisTransform, ExplosionParticlesPool.GiveExplosionParticle(0), Random.Range(0.75f, 1.25f));
                    Class_ChunkCube.ParticlesOutOfPool(thisTransform, ExplosionParticlesPool.GiveExplosionParticle(1), Random.Range(0.75f, 1.25f));
                    for (int i = 0; i < numberDebris; i++)
                    {
                        Class_ChunkCube.DebrisOutOfPool(thisTransform, thisRenderer, DebrisesPool.GiveDebris(Random.Range(0, 2)), numberDebris, Random.Range(0.4f, 0.9f), uvOffset);
                    }
                }

                Class_Mineral.RandomMinerals(thisTransform);
                yield return(delay0);

                ChunkCubesPool.TakeCube(gameObject);
            }
        }

        //--------------
    }
示例#4
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    void Particles()
    {
        //--------------

        amountDamage += currentDamage;

        if (amountDamage >= 2 && brokenStage0 == false)
        {
            brokenStage0 = true;

            if (visible == true)
            {
                Class_ChunkCube.ParticlesOutOfPool(thisTransform, ExplosionParticlesPool.GiveExplosionParticle(2), Random.Range(0.75f, 1.25f));
                Class_ChunkCube.ParticlesOutOfPool(thisTransform, ExplosionParticlesPool.GiveExplosionParticle(3), Random.Range(0.75f, 1.25f));
            }

            Class_Mineral.RandomMinerals(thisTransform);
            DebrisesPool.TakeDebris(gameObject);
        }

        //--------------
    }