コード例 #1
0
        protected override void OnGameObjectEntityCreationStarting(EntityCreationStartingEventArgs args)
        {
            //We do nothing if something has already initialized the movement.
            if (MovementDataMappable.ContainsKey(args.EntityGuid))
            {
                return;
            }

            GameObjectInstanceModel instanceModel = GameObjectInstanceModelMappable.RetrieveEntity(args.EntityGuid);

            MovementDataMappable.AddObject(args.EntityGuid, new PositionChangeMovementData(0, instanceModel.InitialPosition, Vector2.zero, instanceModel.YAxisRotation));
        }
コード例 #2
0
 protected override void OnEventFired(object source, PlayerSessionClaimedEventArgs args)
 {
     //TODO: We should probably handle initial movement data differently.
     MovementDataMappable.AddObject(args.EntityGuid, new PositionChangeMovementData(TimeService.CurrentLocalTime, args.SpawnPosition, Vector2.zero, 0.0f));
 }