πActors is a framework empowering developers to make better games faster on Unity.
Minor bug fixes.
Known issues:
*If you created an actor or entity and didn't set a component to it, AddGet
method won't work as intended.
//Example
var e = Entity.Create();
Timer.Add(1f, ()=>e.AddGet<ComponentTest>()); //ComponentTest won't be added
//Example of working code:
var e = Entity.Create();
e.Set<ComponentTest1>();
Timer.Add(1f, ()=> e.AddGet<ComponentTest2>());
Fixes:
Fixed minor bugs
New
Fixed
void run(){
routines.run(move()); // local coroutines that dies if scene get removed
routines.app.run(move()); // global coroutines that live out of the scene scope
}
IEnumerator move()
{
yield return routines.wait(1f);
yield return routines.waitFrame;
}
Eliminate the need for making global static groups.
[Bind(tag.importantGroup)] // use Bind with int ID to register group in cache
private Group<ComponentTest> TestGroup;
// retrieve your group by ID somewhere in the code.
var gr = ent.groups[tag.importantGroup];
Safely use this method everywhere. It won't be used in the release mode of ACTORS.
debug.log("your_debug");
#fixes
The info about the changes will be soon.
ENG Breaking changes & Improvements:
static partial class Components
{
public const string Health = "Pixeye.Source.ComponentHealth";
[RuntimeInitializeOnLoadMethod]
static void ComponentHealthInit() => new SComponentHealth();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ref ComponentHealth ComponentHealth(in this ent entity)
=> ref Storage<ComponentHealth>.components[entity.id];
internal class SComponentHealth : Storage<ComponentHealth>.Setup
{
public override ComponentHealth Create() => new ComponentHealth();
public override void Dispose(int[] id, int len)
{
for (int i = 0; i < len; i++)
{
ref var component = ref components[id[i]];
component.val = 0;
component.valMax = 0;
}
}
}
}
to
static partial class component
{
public const string health = "Pixeye.Source.ComponentHealth";
public static ref ComponentHealth ComponentHealth(in this ent entity)
=> ref StorageComponentHealth.components[entity.id];
}
sealed class StorageComponentHealth : Storage<ComponentHealth>
{
public override ComponentHealth Create() => new ComponentHealth();
public override void Dispose()
{
for (int i = 0; i < disposedLen; i++)
{
ref var component = ref components[disposed[i]];
component.val = 0;
component.valMax = 0;
}
}
}
[GroupWantEvent]
attribute changed to [WantEvent]
[GroupExclude]
attribute changed to [Exclude]
You can gain slightly better performance at project initialization by defining a namespace you use for your components in the framework settings file. ```SettingsFramework.json````
{
"SizeEntities": 1024, // initial size of entity arrays
"SizeComponents": 256, // how many components can be registered
"SizeGenerations": 4, // you don't need to change anything
"SizeProcessors": 64, // how many processors you want
"DataNamespace": "Pixeye.Source" // define Assembly Definition that you use in your components. (optional)
}
RU ΠΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΈ ΡΠ»ΡΡΡΠ΅Π½ΠΈΡ
static partial class Components
{
public const string Health = "Pixeye.Source.ComponentHealth";
[RuntimeInitializeOnLoadMethod]
static void ComponentHealthInit() => new SComponentHealth();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ref ComponentHealth ComponentHealth(in this ent entity)
=> ref Storage<ComponentHealth>.components[entity.id];
internal class SComponentHealth : Storage<ComponentHealth>.Setup
{
public override ComponentHealth Create() => new ComponentHealth();
public override void Dispose(int[] id, int len)
{
for (int i = 0; i < len; i++)
{
ref var component = ref components[id[i]];
component.val = 0;
component.valMax = 0;
}
}
}
}
Π½Π°
static partial class component
{
public const string health = "Pixeye.Source.ComponentHealth";
public static ref ComponentHealth ComponentHealth(in this ent entity)
=> ref StorageComponentHealth.components[entity.id];
}
sealed class StorageComponentHealth : Storage<ComponentHealth>
{
public override ComponentHealth Create() => new ComponentHealth();
public override void Dispose()
{
for (int i = 0; i < disposedLen; i++)
{
ref var component = ref components[disposed[i]];
component.val = 0;
component.valMax = 0;
}
}
}
[GroupWantEvent]
Π°ΡΡΠΈΠ±ΡΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ Π½Π° [WantEvent]
[GroupExclude]
Π°ΡΡΠΈΠ±ΡΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ Π½Π° [Exclude]
ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΏΡΠΎΠ΅ΠΊΡΠ° Π½Π° ΡΡΠ°ΡΡΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΡΡΠΊΠΎΡΠΈΡΡ Π½Π°ΡΡΡΠΎΠΈΠ² ΡΠ°ΠΉΠ» ```SettingsFramework.json```` ( Π½Π°Ρ ΠΎΠ΄ΠΈΡΡΡ Π² ΡΠ΅ΡΡΡΡΠ°Ρ , Π΅ΡΠ»ΠΈ Π½Π΅Ρ ΡΠΎ ΡΠΎΠ·Π΄Π°ΠΉΡΠ΅ Π²ΡΡΡΠ½ΡΡ )
{
"SizeEntities": 1024, // ΡΡΠ°ΡΡΠΎΠ²ΠΎΠ΅ ΠΊΠΎΠ»-Π²ΠΎ ΡΡΡΠ½ΠΎΡΡΠ΅ΠΉ
"SizeComponents": 256, // ΠΊΠΎΠ»-Π²ΠΎ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠΎΠ²
"SizeGenerations": 4, // ΠΊΠΎΠ»-Π²ΠΎ ΠΏΠΎΠΊΠΎΠ»Π΅Π½ΠΈΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠΎΠ² ( ΡΠΊΠΎΡΠ΅Π΅ Π²ΡΠ΅ Π²Π°ΠΌ Π½Π΅ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡΡΡ ΡΡΠΎ ΠΌΠ΅Π½ΡΡΡ )
"SizeProcessors": 64, // ΠΊΠΎΠ»-Π²ΠΎ ΠΏΡΠΎΡΠ΅ΡΡΠΎΡΠΎΠ²
"DataNamespace": "Pixeye.Source" // ΠΠ°Π·Π²Π°Π½ΠΈΠ΅ Assembly Definition Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ Π² ΠΊΠΎΡΠΎΡΠΎΠΉ Π»Π΅ΠΆΠ°Ρ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΡ
}