Unity-Technologies / Animation-Instancing

This technique is designed to instance Characters(SkinnedMeshRender).
Other
1.65k stars 301 forks source link

Issue with XBOX One uwp. #49

Open hensoup opened 5 years ago

hensoup commented 5 years ago

I am attempting to get this to work on Xbox One altering the manager code but i keep getting access denied and wondering if anyone got this working for Consoles yet?

hensoup commented 5 years ago

I solved it doing some tinkering it works on Xbox 1 UWP

hensoup commented 5 years ago

added this function in AnimationManager.cs

        string GetFilePath(string fileName)
        {
            return Path.Combine(Application.streamingAssetsPath, fileName);
        }

added this in private InstanceAnimationInfo CreateAnimationInfoFromFile(GameObject prefab) in AnimatonManager before #endif line


#elif UNITY_WSA_10_0
            //path = Application.dataPath;
            WWW w = new WWW(GetFilePath(prefab.name + ".bytes"));
            //wwwLoad(path + "/boneTexture/" + thisPrefab.name + ".aniData", SetupAniInfo);
            while (!w.isDone) { }
//             BinaryReader reader = new BinaryReader(new MemoryStream(w.bytes));
//             List<AnimationInfo> listInfo = ReadAnimationInfo(reader);
//             m_animationInfo.Add(prefab, listInfo);
            BinaryReader reader = new BinaryReader(new MemoryStream(w.bytes));  
            InstanceAnimationInfo info = new InstanceAnimationInfo();
            info.listAniInfo = ReadAnimationInfo(reader);
            info.extraBoneInfo = ReadExtraBoneInfo(reader);
            m_animationInfo.Add(prefab, info);
            AnimationInstancingMgr.Instance.ImportAnimationTexture(prefab.name, reader);
hensoup commented 5 years ago

also I had to copy my .byte folders to the streamingasset folder

CloudJin commented 5 years ago

Cool. I haven't supported the console. As you can see, I only support Android iOS and standalone in CreateAnimationInfoFromFile(). Thanks for your fixing.

hensoup commented 5 years ago

your welcome though I have not submitted to the source code yet.