C# 错误CS0619&;错误CS1061

C# 错误CS0619&;错误CS1061,c#,unity3d,C#,Unity3d,我正在观看一个似乎有效的教程,但就我而言,我遇到了以下错误: 错误CS0619:UnityEngine.Component.renderer'已过时:Property 渲染器已被弃用。改用GetComponent()。 (UnityUpgradable)' 以及: 错误CS1061:类型UnityEngine.Component'不包含 类型的material'和无扩展方法material'的定义 UnityEngine.Component'无法找到(您是否缺少使用 指令或程序集引用?) 以下是

我正在观看一个似乎有效的教程,但就我而言,我遇到了以下错误:

错误CS0619:
UnityEngine.Component.renderer'已过时:
Property 渲染器已被弃用。改用GetComponent()。 (UnityUpgradable)'

以及:

错误CS1061:类型
UnityEngine.Component'不包含
类型的
material'和无扩展方法material'的定义 UnityEngine.Component'无法找到(您是否缺少使用 指令或程序集引用?)

以下是脚本:

using UnityEngine;
using System.Collections;

public class ScrollScript : MonoBehaviour {

    public float speed = 0;

    void Update () {
        renderer.material.mainTextureOffset = new Vector2 (Time.time * speed, 0f);
    }
}

公共服务

void Start(){

render=this.GetComponent“”()

}

不要使用引号

关于“属性呈现程序已被弃用。请改用GetComponent()”的不清楚之处?