mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
Update README-RU.md
This commit is contained in:
parent
32c218f852
commit
bfe60eece6
15
README-RU.md
15
README-RU.md
@ -579,7 +579,7 @@ public class Transform : ITransform
|
|||||||
public Vector3 Position { get; set; }
|
public Vector3 Position { get; set; }
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
public class Rigidbody : ITransform
|
public class Rigidbody : Transform
|
||||||
{
|
{
|
||||||
public Vector3 Position { get; set; }
|
public Vector3 Position { get; set; }
|
||||||
public float Mass { 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;
|
EcsWorld _world;
|
||||||
Rigidbody _rigidbody;
|
Rigidbody _rigidbody;
|
||||||
// ...
|
// ...
|
||||||
@ -610,6 +620,9 @@ Rigidbody rigidbody = _world.GetPool<Rigidbody>().Get(entity);
|
|||||||
//Исключение - отсутсвует компонент. Camera не является наследником или наследуемым классом для _rigidbody.
|
//Исключение - отсутсвует компонент. Camera не является наследником или наследуемым классом для _rigidbody.
|
||||||
Camera camera = _world.GetPool<Camera>().Get(entity);
|
Camera camera = _world.GetPool<Camera>().Get(entity);
|
||||||
|
|
||||||
|
//Вернет True.
|
||||||
|
bool isMatches = _world.GetAspect<TransformAspect>().IsMatches(entity);
|
||||||
|
|
||||||
//Все эти строчки вернут True.
|
//Все эти строчки вернут True.
|
||||||
bool isITransform = _world.GetPool<ITransform>().Has(entity);
|
bool isITransform = _world.GetPool<ITransform>().Has(entity);
|
||||||
bool isTransform = _world.GetPool<Transform>().Has(entity);
|
bool isTransform = _world.GetPool<Transform>().Has(entity);
|
||||||
|
Loading…
Reference in New Issue
Block a user