Esempio n. 1
0
        public override void BeginPlay()
        {
            Console.WriteLine("BeginPlay()");
            var  world             = K2_GetWorld();
            var  worldClass        = UWorld.StaticClass();
            bool isWorldClass      = world.IsA(worldClass);
            var  anotherWorldClass = (UClass)typeof(UWorld);
            bool isSameClass       = worldClass == anotherWorldClass;
            bool isWorldClassDerivedFromObjectClass = worldClass.IsChildOf(UObject.StaticClass());

            world.Dispose();
        }
Esempio n. 2
0
 public static void OnMain()
 {
     if (Utils.IsGameOnDisplay())
     {
         int ss      = Engine.oUWorld;
         int uWorlds = Read <int>(Engine.oUWorld);
         uWorld           = Driver.Read <UWorld>(uWorlds);
         LocalPlayer      = uWorld.OwningGameInstance().LocalPlayer();
         playerController = LocalPlayer.PlayerController();
         cameraManager    = playerController.PlayerCameraManager();
         localPawn        = playerController.AknowledgedPawn();
         actors           = uWorld.CurrentLevel().AActors();
     }
 }
Esempio n. 3
0
    void Awake()
    {
        instance = this;

        world           = new World(gravity, true);
        mouse           = new Vector2(0, 0);
        world.DebugDraw = _debugDraw;



        uint flags = 0;

        flags += (uint)DebugDrawFlags.Shape;
        flags += (uint)DebugDrawFlags.Joint;
        //flags +=  (uint)DebugDrawFlags.AABB;
        flags += (uint)DebugDrawFlags.Pair;

        flags           += (uint)DebugDrawFlags.CenterOfMass;
        _debugDraw.Flags = (DebugDrawFlags)flags;

        _bombSpawning = false;



        BodyDef bodyDef = new BodyDef();

        _groundBody = world.CreateBody(bodyDef);



        create_box(436 / 2, 20, 430, 10, false);
        create_box(436 / 2, 290, 430, 10, false);

        create_box(20, 327 / 2, 10, 330, false);
        create_box(400, 327 / 2, 10, 330, false);



        print("box 2d is ready");
    }