Update README-RU.md

This commit is contained in:
Mikhail 2023-11-08 16:51:35 +08:00 committed by GitHub
parent 32c218f852
commit bfe60eece6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -579,7 +579,7 @@ public class Transform : ITransform
public Vector3 Position { get; set; }
// ...
}
public class Rigidbody : ITransform
public class Rigidbody : Transform
{
public Vector3 Position { get; set; }
public float Mass { get; set; }
@ -592,6 +592,16 @@ public class Camera : ITransform
}
// ...
pubcli TransformAspect : EcsAspect
{
public EcsPool<Transform> transforms;
public Aspect(Builder b)
{
transforms = b.Include<Transform>();
}
}
// ...
EcsWorld _world;
Rigidbody _rigidbody;
// ...
@ -610,6 +620,9 @@ Rigidbody rigidbody = _world.GetPool<Rigidbody>().Get(entity);
//Исключение - отсутсвует компонент. Camera не является наследником или наследуемым классом для _rigidbody.
Camera camera = _world.GetPool<Camera>().Get(entity);
//Вернет True.
bool isMatches = _world.GetAspect<TransformAspect>().IsMatches(entity);
//Все эти строчки вернут True.
bool isITransform = _world.GetPool<ITransform>().Has(entity);
bool isTransform = _world.GetPool<Transform>().Has(entity);