我有一个错误
找不到类型或命名空间名称"List".您是否缺少using指令或程序集引用?
示例代码:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class city1 : MonoBehaviour
{
public static List<string> items = new List ();
public static List<double> itemsprice = new List();
public static List<double> qu = new List();
}
Run Code Online (Sandbox Code Playgroud)
如果重要我会使用单声道.
我如何使用线程作为对象?我试图这样做.
对象类
public class Object implements Runnable{
public String name = "";
public void run(){
//logic code here
}
}
Run Code Online (Sandbox Code Playgroud)
我这样称呼它.
Thread contract1 = new Thread(new Object());
contract1.name = "foo";
contract1.start();
Run Code Online (Sandbox Code Playgroud)
我收到了错误
The field Thread.name is not visible
Run Code Online (Sandbox Code Playgroud)
什么是最有资源的方法来做到这一点,并需要最短的代码量?
谢谢.