小编The*_*tit的帖子

尝试从字符串创建材质 - 不再支持

错误是:

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)

c# unity-game-engine

4
推荐指数
1
解决办法
4412
查看次数

标签 统计

c# ×1

unity-game-engine ×1