Unity3d public 变量和private 变量区别

public 变量 一经修改会保存值,相当于static 变量,在editor 模式下每次run之后变量会记住editor下设置的值

private 每次run 变量都会初始化,如果是float类型,默认初始值为0

原文地址:https://www.cnblogs.com/pengyingh/p/2977436.html