Beispiel #1
0
        void InitRendererAndMaterial(bool verifyShader)
        {
            _renderer = GetComponent <Renderer>();

            if (_renderer)
            {
#if UNITY_EDITOR
                if (Application.isPlaying && _checkShaderName && verifyShader)
                {
                    ValidatedHelper.ValidateRenderer(gameObject, ShaderPrefix, ValidatedHelper.DebugLog);
                }
#endif

                _material = _renderer.sharedMaterial;
            }
        }
Beispiel #2
0
        void InitRendererAndMaterial(bool verifyShader)
        {
            _renderer = GetComponent <Renderer>();

            if (_renderer)
            {
#if UNITY_EDITOR
                if (Application.isPlaying && _checkShaderName && verifyShader)
                {
                    ValidatedHelper.ValidateInputMesh(RendererRequired, gameObject, ValidatedHelper.DebugLog);

                    if (TryGetComponent <MeshRenderer>(out var meshRenderer))
                    {
                        ValidatedHelper.ValidateMaterial(meshRenderer.sharedMaterial, ShaderPrefix, gameObject, ValidatedHelper.DebugLog);
                    }
                }
#endif

                _material = _renderer.sharedMaterial;
            }
        }