// Use this for initialization
    void Start()
    {
        crumbleState = CrumbleState.SAFE;

        switch (type)
        {
        case 0:
            crumbleType = CrumbleType.CONSTANT;
            break;

        case 1:
            crumbleType = CrumbleType.ONOFF;
            break;

        case 2:
            crumbleType = CrumbleType.RESPAWN;
            break;

        default:
            crumbleType = CrumbleType.ONOFF;
            break;
        }

        //BlueScale provides the scale to multiply timer by to provide the new blue value
        blueScale = blueValue / timer;

        //Set the base color
        gameObject.renderer.material.color = new Color(0, 0, blueValue);

        timerMax        = timer;
        respawnTimerMax = respawnTimer;
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        crumbleState = CrumbleState.SAFE;

        switch (type)
        {
        case 0:
            crumbleType = CrumbleType.CONSTANT;
            break;

        case 1:
            crumbleType = CrumbleType.ONOFF;
            break;

        case 2:
            crumbleType = CrumbleType.RESPAWN;
            break;

        default:
            crumbleType = CrumbleType.ONOFF;
            break;
        }

        //BlueScale provides the scale to multiply timer by to provide the new blue value
        blueScale = blueValue / timer;

        //Set the color to the original's color
        origB = gameObject.renderer.material.color.b;
        origG = gameObject.renderer.material.color.g;
        origR = gameObject.renderer.material.color.r;

        timerMax        = timer;
        respawnTimerMax = respawnTimer;
    }