【发布时间】:2019-04-26 10:23:44
【问题描述】:
我试图添加一个脚本,将全局损坏等级附加到对象上,但是脚本出现了控制台错误,
错误 CS0120:非静态对象需要对象引用 字段、方法或属性
AttackStat.atk
所以我很困惑,是否需要一个我没有遇到的统一脚本或什么,我对统一编程很陌生
感谢您的宝贵时间
Attackstat.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AttackStat : MonoBehaviour
{
public float atk;
}
【问题讨论】:
标签: c# variables unity3d methods