Esempio n. 1
0
        //获取设置文件
        QuadtreeSettingUpwards GetSettingObject(string settingObjectName)
        {
            QuadtreeSettingUpwards settingObject = LoadSetting(settingObjectName);

            if (settingObject != null)
            {
                return(settingObject);
            }
            return(CreatSettingObject(settingObjectName));
        }
Esempio n. 2
0
        QuadtreeSettingUpwards CreatSettingObject(string settingObjectName)
        {
            string settingScriptFilePath = GetSettingScriptFilePath();

            if (!AssetDatabase.IsValidFolder(settingScriptFilePath + "Resources"))
            {
                CreatResourcesFolder(settingScriptFilePath);
            }

            QuadtreeSettingUpwards settingObject = CreateInstance <QuadtreeSettingUpwards>();

            AssetDatabase.CreateAsset(settingObject, settingScriptFilePath + "Resources/" + settingObjectName + ".asset");

            return(settingObject);
        }
        //初始化
        private void Awake()
        {
            QuadtreeSettingUpwards setting = Resources.Load <QuadtreeSettingUpwards>("QuadtreeCanUpwardsSetting");

            _quadtree = new QuadtreeDataUpwards <GameObject>(setting.startTop, setting.startRight, setting.startBottom, setting.startLeft, setting.maxLeafsNumber, setting.minSideLength);
        }