示例#1
0
    void Awake()
    {
        _overlayCanvas.gameObject.SetActive(false);

        _backgroundUIMaterial = _backgroundImaged.materialForRendering;

        _plantBoy = FindObjectOfType <PlantBoy>();
        _plantBoy.FinishedGrowingCallback += () =>
        {
            _overlayCanvas.gameObject.SetActive(true);
            StartCoroutine(ShowUIRoutine());
        };

        _targetTopColor    = _backgroundUIMaterial.GetColor("_Color");
        _targetBottomColor = _backgroundUIMaterial.GetColor("_Color2");

        _colorSliders[0].value = (int)(_targetTopColor.r * 255f);
        _colorSliders[1].value = (int)(_targetTopColor.b * 255f);
        _colorSliders[2].value = (int)(_targetTopColor.g * 255f);

        _colorSliders[3].value = (int)(_targetBottomColor.r * 255f);
        _colorSliders[4].value = (int)(_targetBottomColor.b * 255f);
        _colorSliders[5].value = (int)(_targetBottomColor.g * 255f);
    }
示例#2
0
 void Awake()
 {
     _plantBoy = FindObjectOfType <PlantBoy>();
     _plantBoy.FinishedGrowingCallback += () => StartCoroutine(GiveCameraControl());
 }