Example #1
0
        public FreeActor(ActorInitializer init, FreeActorInfo info)
        {
            if (init.Contains <FreeActorInit>() && !init.Get <FreeActorInit>().ActorValue)
            {
                return;
            }

            init.Self.World.AddFrameEndTask(w =>
            {
                w.CreateActor(info.Actor, new TypeDictionary
                {
                    new ParentActorInit(init.Self),
                    new LocationInit(init.Self.Location + info.SpawnOffset),
                    new OwnerInit(init.Self.Owner),
                    new FacingInit(info.Facing),
                });
            });
        }
Example #2
0
        public FreeActor(ActorInitializer init, FreeActorInfo info)
        {
            if (init.Contains <FreeActorInit>() && !init.Get <FreeActorInit>().ActorValue)
            {
                return;
            }

            init.Self.World.AddFrameEndTask(w =>
            {
                var a = w.CreateActor(info.Actor, new TypeDictionary
                {
                    new ParentActorInit(init.Self),
                    new LocationInit(init.Self.Location + info.SpawnOffset),
                    new OwnerInit(init.Self.Owner),
                    new FacingInit(info.Facing),
                });

                if (info.InitialActivity != null)
                {
                    a.QueueActivity(Game.CreateObject <Activity>(info.InitialActivity));
                }
            });
        }