コード例 #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();
        }
コード例 #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();
     }
 }
コード例 #3
0
ファイル: UWorld.cs プロジェクト: quinsmpang/box2d4unity
    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");
    }