protected virtual void Start() { manager = World.Active.EntityManager; archetype = manager.CreateArchetype( typeof(Translation), typeof(LinearMovementComponentData), typeof(VelocityAbsoluteComponentData), typeof(SpriteSheetAnimationComponentData), typeof(SpriteRendererComponentData), typeof(SpriteTintComponentData), typeof(Scale), typeof(RenderScaleComponentdata), typeof(ScaleByPositionComponentData), typeof(SquadTagSharedComponentData), typeof(SquadComponentData), typeof(RenderSharedComponentData), typeof(FactionComponentData), typeof(CacheByQuadrandSystemTag), typeof(ProcessProjectileCollisionTag), typeof(AnimationListSharedComponentData), typeof(AnimationPauseComponentData), typeof(ActionOnAnimationFrameComponentData), typeof(DestroyWithHealthComponentData), typeof(HealthComponentData), typeof(AnimatorStatesComponentData), typeof(FlibHorisontalByMoveDirTagComponentData), typeof(FlibHorisontalByTargetTagComponentData), typeof(ZbyYComponentData), typeof(AudioClipComponentData), typeof(DeathAudioClipComponentData), typeof(CastSpritesShadowComponentData) ); squadTag = DataToComponentData.ToComponentData(squadData, squadId, squadPosition.position); renderData = new RenderSharedComponentData() { material = animationProvider.Material, mesh = animationProvider.Mesh, }; animationData = new AnimationListSharedComponentData() { animations = animationProvider.Animations, pauses = animationProvider.PausesData, actions = animationProvider.ActionsData }; }
public static SquadTagSharedComponentData ToComponentData(SquadData squadData, int squadId, Vector3 formationCenter) { var res = new SquadTagSharedComponentData() { data = squadData.Data, id = new SquadTagSharedComponentData.RefInt() { value = squadId }, unitCount = new SquadTagSharedComponentData.RefInt() { value = 0 } }; res.data.formationCenter = new float2(formationCenter.x, formationCenter.y); return(res); }