Skip to content

Releases: PixeyeHQ/actors.unity

Actors Framework

09 Mar 20:40
Compare
Choose a tag to compare
2019.03.09

Hot fix

Actors Framework

08 Mar 21:59
Compare
Choose a tag to compare
Fix

-> Added frame delay before adding entity to a group

Actors Framework

07 Mar 11:57
Compare
Choose a tag to compare
2018.03.07c

Update

Actors Framework

06 Mar 22:45
Compare
Choose a tag to compare
2019.03.07b

Update

Actors Framework

06 Mar 22:12
Compare
Choose a tag to compare
2019.03.07a

Update

ACTORS framework

24 Feb 18:35
Compare
Choose a tag to compare
2019.02.24

Update

ACTORS framework

23 Feb 11:35
Compare
Choose a tag to compare
2019.02.23

Update

ACTORS framework

22 Feb 08:54
e91d4d0
Compare
Choose a tag to compare
ACTORS framework Pre-release
Pre-release
2019.02.22

Update README.md

ACTORS framework

08 Dec 11:19
Compare
Choose a tag to compare
  • Group events changed:
    Add instead Added
    Remove instead Removed
  • Factory workflow changed. Added Default Factory Singleton
  • New methods included in Framework Extensions:
    Every - to iterate variables each x steps ( frames )
    Plus, Minus - to calculate values with a clamp to min/max size.
	if ((cReload.timer = cReload.timer.Minus(delta)) == 0)
		cWeapon.clip = cWeapon.weapon.clipSize;
  • Tags moved from common folder to [1]Source
  • ComponentRelease and ProcessingRelease added. These scripts control entity destroying flow.
    If you need to destroy entity use
	entity.Release();

If entity is an actor use

	entity.Release(true);
  • Several components can be taken from the entity by once
           // example 
            ComponentMotion cMotion;
            ComponentPlayer cPlayer;
            ComponentView   cView;
        
            if (entity.Get(out cMotion, out cPlayer, out cView))
            {
                
            }

ACTORS framework

27 Oct 10:01
bf9c815
Compare
Choose a tag to compare

Changes

Groups

Previously groups worked with entity index taken from a group. Now all groups correspond to entity directly.
This lead to several changes in code:

  • Events such as Group.OnAdd/OnRemove listen to the entity, not the group index.
  • Use foreach to iterate through entities in groups:
   foreach (var entity in groupMotion)
        {
            var cMotion = entity.ComponentMotion();
            var cRigid  = entity.ComponentRigidBody();
            var cBounds = entity.ComponentBounds();
            
            var pos     = cRigid.body.position;

            pos += cMotion.stepFixed;

            pos.x = Mathf.Clamp(pos.x, cBounds.limitation.min.x, cBounds.limitation.max.x);
            pos.y = Mathf.Clamp(pos.y, cBounds.limitation.min.y, cBounds.limitation.max.y);

            cRigid.body.MovePosition(pos);
        }

Components

To use components directly from entities you will have to write some extension methods to a component script:

    [Serializable]
    public class ComponentMotion : IComponent
    {
        public TemplateMotion template;

        [FoldoutGroup("Debug")] public float speedActual;
        [FoldoutGroup("Debug")] public Vector2 direction;
        [FoldoutGroup("Debug")] public Vector2 step;
        [FoldoutGroup("Debug")] public Vector2 stepFixed;

        [HideInInspector] public float speedOverride = 1;
    }
// The extension methods pattern you will need to add to each component.
    public static partial class Game
    {
        public static ComponentMotion ComponentMotion(this int entity)
        {
            return Storage<ComponentMotion>.Instance.components[entity];
        }

        public static bool TryGetComponentMotion(this int entity, out ComponentMotion component)
        {
            component = Storage<ComponentMotion>.Instance.TryGet(entity);
            return component != null;
        }
    }