unity 有趣的蚂蚁搬东西

2021-10-06  本文已影响0人  安宇辛

一:原作地址
https://www.youtube.com/watch?v=nXKiKGZ20Wg
二:项目源码
https://github.com/mixandjam/Pikmin-Gameplay

三:运行结果
运行环境:2020.3.8f1c1
报错

'PropertyUtils' is inaccessible due to its protection leve

原因是PropertyUtils变成了私有的
解决:在报错的地方添加下面代码

 internal static class PropertyUtils
    {
        public static string ConstructConstraintDataPropertyName(string property)
        {
            return "m_Data." + property;
        }

        public static string ConstructCustomPropertyName(Component component, string property)
        {
            return component.transform.GetInstanceID() + "/" + component.GetType() + "/" + property;
        }
    }

运行结果:


有趣的游戏
上一篇 下一篇

猜你喜欢

热点阅读