コード例 #1
0
        //加载保存的技能asset
        public static void LoadSkillArt(string Path)
        {
            SkillAssetData copydata = AssetDatabase.LoadAssetAtPath(Path, typeof(SkillAssetData)) as SkillAssetData;

            currentskillAssetData = copydata.Copy();
            //MemoryStream outPhy = new MemoryStream(currentskillAssetData.skillartString);
            //currentskillAssetData.skillart = CloneSkillArt(ProtoBuf.Serializer.Deserialize<SkillUnit.SkillArt>(outPhy));
            //MemoryStream outPhy1 = new MemoryStream(currentskillAssetData.skillunitString);
            //currentskillAssetData.skillunit = CloneSkillUnit(ProtoBuf.Serializer.Deserialize<SkillUnit.SkillUnit>(outPhy1));
            AssetDatabase.Refresh();
        }
コード例 #2
0
        //保存当前技能为Asset
        public static void SaveSkillArt(string Path)
        {
            // MemoryStream outPhy = new MemoryStream();
            // ProtoBuf.Serializer.Serialize<SkillUnit.SkillArt>(outPhy, currentskillAssetData.skillart);
            // currentskillAssetData.skillartString = outPhy.ToArray();
            // MemoryStream outPhy1 = new MemoryStream();
            // ProtoBuf.Serializer.Serialize<SkillUnit.SkillUnit>(outPhy1, currentskillAssetData.skillunit);
            // currentskillAssetData.skillunitString = outPhy1.ToArray();
            SkillAssetData copydata = currentskillAssetData.Copy();

            AssetDatabase.CreateAsset(copydata, Path);
            AssetDatabase.Refresh();
        }