Пример #1
0
    // Set the colours of the grid cubes
    void SetColours()
    {
        // Set the particle system color over lifetime gradients
        Colours.ColoursPSGradient();

        // Set colours CVD
        if (GameDataManager.instance.SelectedColourScheme() == COLOURSCHEME.CVD)
        {
            // Red safe
            if (GameDataManager.instance.SelectedCVDColourScheme() == CVDCOLOURSCHEME.RED)
            {
                // Cube colours
                borderMaterial.color               = Colours.borderColourRedSafe;
                rockMaterial.color                 = Colours.rockColourRedSafe;
                edgeMaterial.color                 = Colours.edgeColourRedSafe;
                rockDamagedMaterial.color          = Colours.rockDamagedColourRedSafe;
                crystalMaterial.color              = Colours.crystalColourRedSafe;
                crystalDamagedMaterial.color       = Colours.crystalColourRedSafe;
                crystalMoreDamagedMaterial.color   = Colours.crystalColourRedSafe;
                crystalReallyDamagedMaterial.color = Colours.crystalColourRedSafe;

                // Floor colour
                floor.GetComponent <MeshRenderer>().material.color = Colours.floorColourRedSafe;

                // Particle system colours (damaged rock PS)
                var main = rockDamagedSystem.main;
                main.startColor = Colours.rockDamagedPSColourRedSafe;
                var col = rockDamagedSystem.colorOverLifetime;
                col.color = Colours.rockDamagedColourGradRedSafe;

                // Particle system colours (destroyed rock PS)
                main            = rockDestroyedSystem.main;
                main.startColor = Colours.rockDamagedPSColourRedSafe;
                col             = rockDestroyedSystem.colorOverLifetime;
                col.color       = Colours.rockDamagedColourGradRedSafe;

                // Particle system colours (crystal damaged PS)
                main            = crystalDamagedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourRedSafe;
                col             = crystalDamagedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourRedSafe;

                // Particle system colours (crystal destroyed PS)
                main            = crystalDestroyedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourRedSafe;
                col             = crystalDestroyedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourRedSafe;
            }

            // Green safe
            if (GameDataManager.instance.SelectedCVDColourScheme() == CVDCOLOURSCHEME.GREEN)
            {
                // Cube colours
                borderMaterial.color               = Colours.borderColourGreenSafe;
                rockMaterial.color                 = Colours.rockColourGreenSafe;
                edgeMaterial.color                 = Colours.edgeColourGreenSafe;
                rockDamagedMaterial.color          = Colours.rockDamagedColourGreenSafe;
                crystalMaterial.color              = Colours.crystalColourGreenSafe;
                crystalDamagedMaterial.color       = Colours.crystalColourGreenSafe;
                crystalMoreDamagedMaterial.color   = Colours.crystalColourGreenSafe;
                crystalReallyDamagedMaterial.color = Colours.crystalColourGreenSafe;

                // Floor colour
                floor.GetComponent <MeshRenderer>().material.color = Colours.floorColourGreenSafe;

                // Particle system colours (damaged rock PS)
                var main = rockDamagedSystem.main;
                main.startColor = Colours.rockDamagedPSColourGreenSafe;
                var col = rockDamagedSystem.colorOverLifetime;
                col.color = Colours.rockDamagedColourGradGreenSafe;

                // Particle system colours (destroyed rock PS)
                main            = rockDestroyedSystem.main;
                main.startColor = Colours.rockDamagedPSColourGreenSafe;
                col             = rockDestroyedSystem.colorOverLifetime;
                col.color       = Colours.rockDamagedColourGradGreenSafe;

                // Particle system colours (crystal damaged PS)
                main            = crystalDamagedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourGreenSafe;
                col             = crystalDamagedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourGreenSafe;

                // Particle system colours (crystal destroyed PS)
                main            = crystalDestroyedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourGreenSafe;
                col             = crystalDestroyedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourGreenSafe;
            }

            // Blue safe
            if (GameDataManager.instance.SelectedCVDColourScheme() == CVDCOLOURSCHEME.BLUE)
            {
                // Cube colours
                borderMaterial.color               = Colours.borderColourBlueSafe;
                rockMaterial.color                 = Colours.rockColourBlueSafe;
                edgeMaterial.color                 = Colours.edgeColourBlueSafe;
                rockDamagedMaterial.color          = Colours.rockDamagedColourBlueSafe;
                crystalMaterial.color              = Colours.crystalColourBlueSafe;
                crystalDamagedMaterial.color       = Colours.crystalColourBlueSafe;
                crystalMoreDamagedMaterial.color   = Colours.crystalColourBlueSafe;
                crystalReallyDamagedMaterial.color = Colours.crystalColourBlueSafe;

                // Floor colour
                floor.GetComponent <MeshRenderer>().material.color = Colours.floorColourBlueSafe;

                // Particle system colours (damaged rock PS)
                var main = rockDamagedSystem.main;
                main.startColor = Colours.rockDamagedPSColourBlueSafe;
                var col = rockDamagedSystem.colorOverLifetime;
                col.color = Colours.rockDamagedColourGradBlueSafe;

                // Particle system colours (destroyed rock PS)
                main            = rockDestroyedSystem.main;
                main.startColor = Colours.rockDamagedPSColourBlueSafe;
                col             = rockDestroyedSystem.colorOverLifetime;
                col.color       = Colours.rockDamagedColourGradBlueSafe;

                // Particle system colours (crystal damaged PS)
                main            = crystalDamagedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourBlueSafe;
                col             = crystalDamagedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourBlueSafe;

                // Particle system colours (crystal destroyed PS)
                main            = crystalDestroyedSystem.main;
                main.startColor = Colours.crystalDamagedPSColourBlueSafe;
                col             = crystalDestroyedSystem.colorOverLifetime;
                col.color       = Colours.crystalDamagedPSColourBlueSafe;
            }
        }

        // Set colours Normal
        else if (GameDataManager.instance.SelectedColourScheme() == COLOURSCHEME.NORMAL)
        {
            // Cube colours
            borderMaterial.color               = Colours.borderColour;
            rockMaterial.color                 = Colours.rockColour;
            edgeMaterial.color                 = Colours.edgeColour;
            rockDamagedMaterial.color          = Colours.rockDamagedColour;
            crystalMaterial.color              = Colours.crystalColour;
            crystalDamagedMaterial.color       = Colours.crystalColour;
            crystalMoreDamagedMaterial.color   = Colours.crystalColour;
            crystalReallyDamagedMaterial.color = Colours.crystalColour;

            // Floor colour
            floor.GetComponent <MeshRenderer>().material.color = Colours.floorColour;

            // Particle system colours (damaged rock PS)
            var main = rockDamagedSystem.main;
            main.startColor = Colours.rockDamagedPSColour;
            var col = rockDamagedSystem.colorOverLifetime;
            col.color = Colours.rockDamagedColourGrad;

            // Particle system colours (destroyed rock PS)
            main            = rockDestroyedSystem.main;
            main.startColor = Colours.rockDamagedPSColour;
            col             = rockDestroyedSystem.colorOverLifetime;
            col.color       = Colours.rockDamagedColourGrad;

            // Particle system colours (crystal damaged PS)
            main            = crystalDamagedSystem.main;
            main.startColor = Colours.crystalDamagedPSColour;
            col             = crystalDamagedSystem.colorOverLifetime;
            col.color       = Colours.crystalDamagedPSColour;

            // Particle system colours (crystal destroyed PS)
            main            = crystalDestroyedSystem.main;
            main.startColor = Colours.crystalDamagedPSColour;
            col             = crystalDestroyedSystem.colorOverLifetime;
            col.color       = Colours.crystalDamagedPSColour;
        }

        Debug.Log("MAP - SET COLOURS - COMPLETE");
    }