fix #273 - GetBoneSafe doesn't accept StringHash

This commit is contained in:
EgorBo 2018-03-01 18:23:01 +03:00
Родитель 0bd658b95d
Коммит f796bfc13b
3 изменённых файлов: 9 добавлений и 3 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -37,3 +37,5 @@ clang+llvm-3.7.0-x86_64-apple-darwin*
project.lock.json
/ProjectTemplates/SharpRealityVsix/ProjectTemplates
/ProjectTemplates/VSIX/ProjectTemplates
/Tests/Playgrounds/Playgrounds.NetCoreApp/CoreData.pak
/Tests/Playgrounds/Playgrounds.NetCoreApp/Urho3D.log

Просмотреть файл

@ -8,7 +8,8 @@ namespace Urho {
// have dangling pointers, we only surface the constructor that retains a copy
// to the container
public partial class Skeleton {
public partial class Skeleton
{
IntPtr handle;
[Preserve]
@ -29,17 +30,19 @@ namespace Urho {
}
}
public BoneWrapper GetBoneSafe(String name)
public BoneWrapper GetBoneSafe(StringHash nameHash)
{
Runtime.ValidateObject(this);
unsafe
{
Bone* result = Skeleton_GetBone0(handle, new StringHash(name).Code);
Bone* result = Skeleton_GetBone0(handle, nameHash.Code);
if (result == null)
return null;
return new BoneWrapper(this, result);
}
}
public BoneWrapper GetBoneSafe(string name) => GetBoneSafe(new StringHash(name));
}
public partial class AnimatedModel {

Просмотреть файл

@ -9,6 +9,7 @@ namespace Playgrounds.NetCoreApp
{
static void Main(string[] args)
{
throw new NotImplementedException("Not fully implemented yet, requires changes in Urho3D (FileSystem)");
Console.WriteLine("Dir: " + Environment.CurrentDirectory);
// the current directory is not "bin" ?? https://github.com/dotnet/project-system/issues/589
// workaround: