错误是:
Trying to create a material from string - this is no longer supported.
UnityEngine.Material:.ctor(String)
Drawer:CreateLineMaterial() (at Assets/Flying Birds/Scripts/Drawer.cs:27)
Drawer:Awake() (at Assets/Flying Birds/Scripts/Drawer.cs:46)
Run Code Online (Sandbox Code Playgroud)
第 27 行是:
var mat = new Material(
Run Code Online (Sandbox Code Playgroud)
第 46 行:
lineMaterial = CreateLineMaterial();
using System;
using UnityEngine;
using System.Collections.Generic;
public class Drawer: MonoBehaviour
{
public Material lineMaterial;
struct Line
{
public Vector3 from;
public Vector3 to;
public Color color;
public Line( Vector3 from, Vector3 to, Color color )
{
this.from = from;
this.to = to;
this.color …Run Code Online (Sandbox Code Playgroud)