├── .gitignore ├── Config ├── DefaultEditor.ini ├── DefaultEngine.ini ├── DefaultGame.ini └── DefaultInput.ini ├── Content ├── AICubeController.uasset ├── AIKubeController.uasset ├── Adventure │ ├── AdventureCharBlueprint.uasset │ ├── ChestBP.uasset │ ├── ChestBase.uasset │ ├── ChestLevelSequence.uasset │ ├── ChestTop.uasset │ ├── InteractiveCube_Blueprint.uasset │ └── SubtitlesWidget.uasset ├── BaseCylinder.uasset ├── BunnyMark │ ├── BunnyBP.uasset │ ├── BunnyBlueprintBP.uasset │ ├── BunnyMark_Blueprint.uasset │ ├── BunnyOptimizedBP.uasset │ ├── bunny.uasset │ └── bunnyMat.uasset ├── Color.uasset ├── ColorBlue.uasset ├── ColorOrange.uasset ├── CubeAI.uasset ├── CubeBP.uasset ├── CubeJS_Blueprint.uasset ├── ExampleBlueprint.uasset ├── FirstPerson │ ├── Animations │ │ ├── FirstPersonFire_Montage.uasset │ │ ├── FirstPerson_AnimBP.uasset │ │ ├── FirstPerson_Fire.uasset │ │ ├── FirstPerson_Idle.uasset │ │ ├── FirstPerson_JumpEnd.uasset │ │ ├── FirstPerson_JumpLoop.uasset │ │ ├── FirstPerson_JumpStart.uasset │ │ └── FirstPerson_Run.uasset │ ├── Audio │ │ └── FirstPersonTemplateWeaponFire02.uasset │ ├── Character │ │ ├── Materials │ │ │ ├── M_UE4Man_Body.uasset │ │ │ └── MaterialLayers │ │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ │ ├── FirstPersonAnimBlueprint_Copy.uasset │ │ │ ├── SK_Mannequin_Arms.uasset │ │ │ ├── SK_Mannequin_Arms_PhysicsAsset.uasset │ │ │ └── SK_Mannequin_Arms_Skeleton.uasset │ │ └── Textures │ │ │ ├── UE4_LOGO_CARD.uasset │ │ │ ├── UE4_Mannequin_MAT_MASKA.uasset │ │ │ └── UE4_Mannequin__normals.uasset │ ├── FPWeapon │ │ ├── Materials │ │ │ ├── M_FPGun.uasset │ │ │ └── MaterialLayers │ │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ │ ├── ML_Screen.uasset │ │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ │ ├── T_ML_FineRubber.uasset │ │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ │ ├── SK_FPGun.uasset │ │ │ ├── SK_FPGun_PhysicsAsset.uasset │ │ │ └── SK_FPGun_Skeleton.uasset │ │ └── Textures │ │ │ ├── T_FPGun_M.uasset │ │ │ └── T_FPGun_N.uasset │ └── Textures │ │ └── FirstPersonCrosshair.uasset ├── FirstPersonBP.uasset ├── Geometry │ └── Meshes │ │ └── TemplateFloor.uasset ├── HelloBlueprintActor_Blueprint.uasset ├── KotlinBlueprintLibrary.uasset ├── KotlinLogo.uasset ├── KotlinLogo_Blueprint.uasset ├── Mannequin │ ├── Animations │ │ ├── ThirdPersonIdle.uasset │ │ ├── ThirdPersonJump_Loop.uasset │ │ ├── ThirdPersonJump_Start.uasset │ │ ├── ThirdPersonRun.uasset │ │ ├── ThirdPersonWalk.uasset │ │ ├── ThirdPerson_AnimBP.uasset │ │ ├── ThirdPerson_IdleRun_2D.uasset │ │ └── ThirdPerson_Jump.uasset │ └── Character │ │ ├── Materials │ │ ├── M_UE4Man_Body.uasset │ │ ├── M_UE4Man_ChestLogo.uasset │ │ └── MaterialLayers │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ ├── SK_Mannequin.uasset │ │ ├── SK_Mannequin_PhysicsAsset.uasset │ │ └── UE4_Mannequin_Skeleton.uasset │ │ └── Textures │ │ ├── UE4Man_Logo_N.uasset │ │ ├── UE4_LOGO_CARD.uasset │ │ ├── UE4_Mannequin_MAT_MASKA.uasset │ │ └── UE4_Mannequin__normals.uasset ├── Maps │ ├── AdventureGame.umap │ ├── BunnyMark.umap │ ├── FirstPerson.umap │ ├── FirstPersonGame.umap │ ├── FirstPersonGame_Blueprint.uasset │ ├── FirstPersonGame_BuiltData.uasset │ ├── FirstPerson_Blueprint.uasset │ ├── HelloBlueprint.umap │ ├── HelloBlueprints.umap │ ├── HelloBlueprints_Blueprint.uasset │ ├── HelloKotlin.umap │ ├── Inheritance.umap │ ├── KeyboardInput.umap │ ├── RotatingCubes.umap │ ├── SceneLights.umap │ └── ThirdPerson.umap ├── Materials │ ├── PP_OutlineCustomDepthOcclusionInverse.uasset │ └── PP_OutlineCustomDepthOcclusionInverse_Inst.uasset ├── Pickup_Blueprint.uasset ├── ProxyGameMode.uasset ├── RotatingCube.uasset ├── Scripts │ ├── KotlinCodeMain.js │ ├── KotlinMain.js │ ├── KotlinUnreal.js │ ├── aliases.js │ ├── bootstrap.js │ ├── devjade.js │ ├── kotlin-examples.js │ ├── kotlin.js │ ├── kotlinx-atomicfu.js │ ├── kotlinx-coroutines-core.js │ ├── polyfill │ │ ├── timers.js │ │ ├── unrealengine.js │ │ └── windowTimers.js │ └── uklass.js ├── Switch_Blueprint.uasset ├── ThirdPerson │ └── Meshes │ │ └── CubeMaterial.uasset └── ThirdPersonBP.uasset ├── KotlinUnreal.sln ├── KotlinUnreal.uproject ├── LICENSE ├── README.md ├── Screenshots ├── adventure.jpg ├── cubes.jpg ├── firstperson.jpg ├── game.jpg ├── helloblueprint.jpg ├── helloblueprints.jpeg ├── helloworld.jpg ├── scenelights.jpg └── thirdperson.jpg ├── Source ├── KotlinUnreal.Target.cs ├── KotlinUnreal │ ├── KotlinComponent.cpp │ ├── KotlinComponent.h │ ├── KotlinGameInstance.cpp │ ├── KotlinGameInstance.h │ ├── KotlinObject.cpp │ ├── KotlinObject.h │ ├── KotlinUnreal.Build.cs │ ├── KotlinUnreal.cpp │ └── KotlinUnreal.h └── KotlinUnrealEditor.Target.cs ├── kotlin-examples ├── build.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── KotlinObject.kt │ ├── examples │ ├── adventure │ │ ├── AdventureCharacter.kt │ │ ├── InteractionManager.kt │ │ ├── InteractiveChest.kt │ │ ├── InteractiveCube.kt │ │ └── InteractiveObjectBase.kt │ ├── blueprint │ │ ├── HelloBlueprint.kt │ │ └── HelloBlueprints.kt │ ├── bunnymark │ │ └── BunnyMark.kt │ ├── cubes │ │ ├── RedRotatingCube.kt │ │ ├── RotatingCubeActor.kt │ │ └── WhiteRotatingCube.kt │ ├── firstperson │ │ └── FirstPerson.kt │ ├── game │ │ ├── Game.kt │ │ ├── KotlinLogo.kt │ │ ├── Pickup.kt │ │ └── Switch.kt │ ├── hello │ │ └── HelloKotlin.kt │ ├── inheritance │ │ ├── BaseCylinder.kt │ │ ├── CustomCylinder.kt │ │ ├── DelegatedCylinder.kt │ │ └── ICylinder.kt │ ├── keyboardinput │ │ └── KeyboardInput.kt │ ├── scenelights │ │ └── SceneLights.kt │ └── thirdperson │ │ └── ThirdPerson.kt │ ├── init.kt │ └── ueExtensions.kt └── kotlin-unreal-definitions ├── build.gradle.kts ├── convention-plugins ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── convention.publication.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src └── jsMain └── kotlin └── ue ├── _part_0_ue.kt ├── _part_1_ue.kt ├── _part_2_ue.kt ├── _part_3_ue.kt ├── _part_4_ue.kt ├── ue.kt └── ueExtensions.kt /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015 user specific files 2 | .vs/ 3 | 4 | # IntelliJ 5 | .idea/ 6 | 7 | # Compiled Object files 8 | *.slo 9 | *.lo 10 | *.o 11 | *.obj 12 | 13 | # Precompiled Headers 14 | *.gch 15 | *.pch 16 | 17 | # Compiled Dynamic libraries 18 | *.so 19 | *.dylib 20 | *.dll 21 | 22 | # Fortran module files 23 | *.mod 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.ipa 36 | 37 | # These project files can be generated by the engine 38 | *.xcodeproj 39 | *.xcworkspace 40 | *.sln 41 | *.suo 42 | *.opensdf 43 | *.sdf 44 | *.VC.db 45 | *.VC.opendb 46 | 47 | # Precompiled Assets 48 | SourceArt/**/*.png 49 | SourceArt/**/*.tga 50 | 51 | # Binary Files 52 | Binaries/* 53 | Plugins/*/Binaries/* 54 | 55 | # Builds 56 | Build/* 57 | out/* 58 | 59 | # Whitelist PakBlacklist-.txt files 60 | !Build/*/ 61 | Build/*/** 62 | !Build/*/PakBlacklist*.txt 63 | 64 | # Don't ignore icon files in Build 65 | !Build/**/*.ico 66 | 67 | # Built data for maps 68 | *_BuiltData.uasset 69 | 70 | # Configuration files generated by the Editor 71 | Saved/* 72 | 73 | # Compiled source files for the engine to use 74 | Intermediate/* 75 | Plugins/*/Intermediate/* 76 | 77 | # Cache files for the editor to use 78 | DerivedDataCache/* 79 | 80 | # Gradle 81 | .gradle 82 | **/build/ 83 | !src/**/build/ 84 | local.properties 85 | -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | [EditoronlyBP] 2 | bAllowClassAndBlueprintPinMatching=true 3 | bReplaceBlueprintWithClass=true 4 | bDontLoadBlueprintOutsideEditor=false 5 | bBlueprintIsNotBlueprintType=true 6 | 7 | [/Script/Localization.LocalizationSettings] 8 | -EngineTargetsSettings=(Name="Engine",Guid=33482D004789784C9DA695A682ACCA1B,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((Path="Source/Runtime/"),(Path="Source/Developer/"),(Path="Config/")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*"),(Pattern="Source/Developer/NoRedist/UnrealEngineLauncherServices/*"),(Pattern="Source/Developer/NoRedist/BuildPatchServices/*")),FileExtensions=((Pattern="cpp"),(Pattern="h"),(Pattern="c"),(Pattern="inl"),(Pattern="mm"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/*")),ExcludePathWildcards=((Pattern="Content/Editor/*"),(Pattern="Content/Tutorial/*"),(Pattern="Content/Developers/*"),(Pattern="Content/TestPackages/*"),(Pattern="Content/QA_Assets/*"),(Pattern="Content/Maps/Automation/*"),(Pattern="Content/EngineSounds/*")),FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 9 | -EngineTargetsSettings=(Name="Editor",Guid=AC8BFD2A41A2FB2893BB8EA0AF903E6D,TargetDependencies=(33482D004789784C9DA695A682ACCA1B),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((Path="Source/Editor/")),ExcludePathWildcards=,FileExtensions=((Pattern="cpp"),(Pattern="h"),(Pattern="c"),(Pattern="inl"),(Pattern="mm"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/Editor/*"),(Pattern="Content/Editor*")),ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 10 | -EngineTargetsSettings=(Name="EditorTutorials",Guid=00F8E3AD47F0A73D50D46881C14DF28F,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=("IntroTutorials"),GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/Tutorial/*")),ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 11 | -EngineTargetsSettings=(Name="PropertyNames",Guid=E391A8B149980E8154E056AF2DA49479,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="DisplayName"),TextNamespace="UObjectDisplayNames",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 12 | -EngineTargetsSettings=(Name="ToolTips",Guid=0F116534468918AEA432DD8C77703BA8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="ToolTip"),TextNamespace="UObjectToolTips",TextKeyPattern=(Pattern="{FieldPath}")),(MetaDataKey=(Name="ShortToolTip"),TextNamespace="UObjectShortToolTips",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 13 | -EngineTargetsSettings=(Name="Keywords",Guid=AE89AECB47475F420D0D69A5547515DC,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="Keywords"),TextNamespace="UObjectKeywords",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 14 | -EngineTargetsSettings=(Name="Category",Guid=14B8DEE642A6A7AFEB5A28B959EC373A,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="Category"),TextNamespace="UObjectCategory",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 15 | +EngineTargetsSettings=(Name="Engine",Guid=33482D004789784C9DA695A682ACCA1B,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((Path="Source/Runtime/"),(Path="Source/Developer/"),(Path="Config/")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*"),(Pattern="Source/Developer/NoRedist/UnrealEngineLauncherServices/*"),(Pattern="Source/Developer/NoRedist/BuildPatchServices/*")),FileExtensions=((Pattern="cpp"),(Pattern="h"),(Pattern="c"),(Pattern="inl"),(Pattern="mm"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/*")),ExcludePathWildcards=((Pattern="Content/Editor/*"),(Pattern="Content/Tutorial/*"),(Pattern="Content/Developers/*"),(Pattern="Content/TestPackages/*"),(Pattern="Content/QA_Assets/*"),(Pattern="Content/Maps/Automation/*"),(Pattern="Content/EngineSounds/*")),FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 16 | +EngineTargetsSettings=(Name="Editor",Guid=AC8BFD2A41A2FB2893BB8EA0AF903E6D,TargetDependencies=(33482D004789784C9DA695A682ACCA1B),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((Path="Source/Editor/")),ExcludePathWildcards=,FileExtensions=((Pattern="cpp"),(Pattern="h"),(Pattern="c"),(Pattern="inl"),(Pattern="mm"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/Editor/*"),(Pattern="Content/Editor*")),ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 17 | +EngineTargetsSettings=(Name="EditorTutorials",Guid=00F8E3AD47F0A73D50D46881C14DF28F,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=("IntroTutorials"),GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/Tutorial/*")),ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 18 | +EngineTargetsSettings=(Name="PropertyNames",Guid=E391A8B149980E8154E056AF2DA49479,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="DisplayName"),TextNamespace="UObjectDisplayNames",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 19 | +EngineTargetsSettings=(Name="ToolTips",Guid=0F116534468918AEA432DD8C77703BA8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="ToolTip"),TextNamespace="UObjectToolTips",TextKeyPattern=(Pattern="{FieldPath}")),(MetaDataKey=(Name="ShortToolTip"),TextNamespace="UObjectShortToolTips",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 20 | +EngineTargetsSettings=(Name="Keywords",Guid=AE89AECB47475F420D0D69A5547515DC,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=True),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="Keywords"),TextNamespace="UObjectKeywords",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 21 | +EngineTargetsSettings=(Name="Category",Guid=14B8DEE642A6A7AFEB5A28B959EC373A,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=True,IncludePathWildcards=((Pattern="Source/Editor/*"),(Pattern="Source/Runtime/*"),(Pattern="Source/Developer/*")),ExcludePathWildcards=((Pattern="Source/Developer/NoRedist/CommunityPortalServices/*")),KeySpecifications=((MetaDataKey=(Name="Category"),TextNamespace="UObjectCategory",TextKeyPattern=(Pattern="{FieldPath}"))),ShouldGatherFromEditorOnlyData=True),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="es"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="zh-CN"))) 22 | -GameTargetsSettings=(Name="Game",Guid=AE0EA34A45461A25BA65A391026F19F8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=-1,SupportedCulturesStatistics=((CultureName="en"))) 23 | -GameTargetsSettings=(Name=,Guid=4FDC3D4847696028C05CADAB8D272007,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=-1,SupportedCulturesStatistics=) 24 | +GameTargetsSettings=(Name="Game",Guid=AE0EA34A45461A25BA65A391026F19F8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=-1,SupportedCulturesStatistics=((CultureName="en"))) 25 | +GameTargetsSettings=(Name="NewTarget",Guid=C2E59CDF4A9AFC05C4755F8E61FBFA0D,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="ko-KR"))) 26 | 27 | -------------------------------------------------------------------------------- /Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | [URL] 2 | 3 | [/Script/Engine.UserInterfaceSettings] 4 | RenderFocusRule=NavigationOnly 5 | DefaultCursor=None 6 | TextEditBeamCursor=None 7 | CrosshairsCursor=None 8 | GrabHandCursor=None 9 | GrabHandClosedCursor=None 10 | SlashedCircleCursor=None 11 | ApplicationScale=1.000000 12 | UIScaleRule=ShortestSide 13 | CustomScalingRuleClass=None 14 | UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000))),ExternalCurve=None) 15 | 16 | [/Script/Engine.RendererSettings] 17 | r.MobileHDR=True 18 | r.MobileNumDynamicPointLights=4 19 | r.MobileDynamicPointLightsUseStaticBranch=True 20 | r.AllowOcclusionQueries=True 21 | r.MinScreenRadiusForLights=0.030000 22 | r.MinScreenRadiusForDepthPrepass=0.030000 23 | r.PrecomputedVisibilityWarning=False 24 | r.TextureStreaming=True 25 | Compat.UseDXT5NormalMaps=False 26 | r.AllowStaticLighting=True 27 | r.NormalMapsForStaticLighting=False 28 | r.GenerateMeshDistanceFields=False 29 | r.GenerateLandscapeGIData=True 30 | r.TessellationAdaptivePixelsPerTriangle=48.000000 31 | r.SeparateTranslucency=True 32 | r.TranslucentSortPolicy=0 33 | TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000) 34 | r.CustomDepth=1 35 | r.DefaultFeature.Bloom=True 36 | r.DefaultFeature.AmbientOcclusion=True 37 | r.DefaultFeature.AmbientOcclusionStaticFraction=True 38 | r.DefaultFeature.AutoExposure=True 39 | r.DefaultFeature.MotionBlur=True 40 | r.DefaultFeature.LensFlare=True 41 | r.DefaultFeature.AntiAliasing=2 42 | r.EarlyZPass=3 43 | r.EarlyZPassMovable=False 44 | r.DBuffer=False 45 | r.ClearSceneMethod=1 46 | r.BasePassOutputsVelocity=False 47 | r.WireframeCullThreshold=5.000000 48 | UIScaleRule=ShortestSide 49 | UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=),ExternalCurve=None) 50 | 51 | [/Script/HardwareTargeting.HardwareTargetingSettings] 52 | TargetedHardwareClass=Desktop 53 | AppliedTargetedHardwareClass=Desktop 54 | DefaultGraphicsPerformance=Maximum 55 | AppliedDefaultGraphicsPerformance=Maximum 56 | 57 | 58 | 59 | 60 | [/Script/EngineSettings.GameMapsSettings] 61 | EditorStartupMap=/Engine/Maps/Templates/Template_Default.Template_Default 62 | LocalMapOptions= 63 | TransitionMap=None 64 | bUseSplitscreen=True 65 | TwoPlayerSplitscreenLayout=Horizontal 66 | ThreePlayerSplitscreenLayout=FavorTop 67 | FourPlayerSplitscreenLayout=Grid 68 | bOffsetPlayerGamepadIds=False 69 | GameInstanceClass=/Script/KotlinUnreal.KotlinGameInstance 70 | GameDefaultMap=/Game/Maps/FirstPersonGame.FirstPersonGame 71 | ServerDefaultMap=/Engine/Maps/Entry.Entry 72 | GlobalDefaultGameMode=/Script/Engine.GameModeBase 73 | GlobalDefaultServerGameMode=None 74 | 75 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | [/Script/EngineSettings.GeneralProjectSettings] 2 | ProjectID=6DA75D494D56C84033F23EAA7E92881B 3 | 4 | [/Script/UnrealEd.ProjectPackagingSettings] 5 | Build=IfProjectHasCode 6 | BuildConfiguration=PPBC_Development 7 | BuildTarget= 8 | StagingDirectory=(Path="C:/dani/programacion/unreal/unrealjs/kotlin-unreal-master/out") 9 | FullRebuild=False 10 | ForDistribution=False 11 | IncludeDebugFiles=False 12 | BlueprintNativizationMethod=Disabled 13 | bIncludeNativizedAssetsInProjectGeneration=False 14 | bExcludeMonolithicEngineHeadersInNativizedCode=False 15 | UsePakFile=True 16 | bUseIoStore=False 17 | bGenerateChunks=False 18 | bGenerateNoChunks=False 19 | bChunkHardReferencesOnly=False 20 | bForceOneChunkPerFile=False 21 | MaxChunkSize=0 22 | bBuildHttpChunkInstallData=False 23 | HttpChunkInstallDataDirectory=(Path="") 24 | PakFileCompressionFormats= 25 | PakFileAdditionalCompressionOptions= 26 | HttpChunkInstallDataVersion= 27 | IncludePrerequisites=True 28 | IncludeAppLocalPrerequisites=False 29 | bShareMaterialShaderCode=True 30 | bDeterministicShaderCodeOrder=False 31 | bSharedMaterialNativeLibraries=True 32 | ApplocalPrerequisitesDirectory=(Path="") 33 | IncludeCrashReporter=False 34 | InternationalizationPreset=English 35 | -CulturesToStage=en 36 | +CulturesToStage=en 37 | LocalizationTargetCatchAllChunkId=0 38 | bCookAll=False 39 | bCookMapsOnly=False 40 | bCompressed=False 41 | bSkipEditorContent=False 42 | bSkipMovies=False 43 | -IniKeyBlacklist=KeyStorePassword 44 | -IniKeyBlacklist=KeyPassword 45 | -IniKeyBlacklist=rsa.privateexp 46 | -IniKeyBlacklist=rsa.modulus 47 | -IniKeyBlacklist=rsa.publicexp 48 | -IniKeyBlacklist=aes.key 49 | -IniKeyBlacklist=SigningPublicExponent 50 | -IniKeyBlacklist=SigningModulus 51 | -IniKeyBlacklist=SigningPrivateExponent 52 | -IniKeyBlacklist=EncryptionKey 53 | -IniKeyBlacklist=IniKeyBlacklist 54 | -IniKeyBlacklist=IniSectionBlacklist 55 | +IniKeyBlacklist=KeyStorePassword 56 | +IniKeyBlacklist=KeyPassword 57 | +IniKeyBlacklist=rsa.privateexp 58 | +IniKeyBlacklist=rsa.modulus 59 | +IniKeyBlacklist=rsa.publicexp 60 | +IniKeyBlacklist=aes.key 61 | +IniKeyBlacklist=SigningPublicExponent 62 | +IniKeyBlacklist=SigningModulus 63 | +IniKeyBlacklist=SigningPrivateExponent 64 | +IniKeyBlacklist=EncryptionKey 65 | +IniKeyBlacklist=IniKeyBlacklist 66 | +IniKeyBlacklist=IniSectionBlacklist 67 | +DirectoriesToAlwaysStageAsNonUFS=(Path="Scripts") 68 | 69 | -------------------------------------------------------------------------------- /Config/DefaultInput.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Config/DefaultInput.ini -------------------------------------------------------------------------------- /Content/AICubeController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/AICubeController.uasset -------------------------------------------------------------------------------- /Content/AIKubeController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/AIKubeController.uasset -------------------------------------------------------------------------------- /Content/Adventure/AdventureCharBlueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/AdventureCharBlueprint.uasset -------------------------------------------------------------------------------- /Content/Adventure/ChestBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/ChestBP.uasset -------------------------------------------------------------------------------- /Content/Adventure/ChestBase.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/ChestBase.uasset -------------------------------------------------------------------------------- /Content/Adventure/ChestLevelSequence.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/ChestLevelSequence.uasset -------------------------------------------------------------------------------- /Content/Adventure/ChestTop.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/ChestTop.uasset -------------------------------------------------------------------------------- /Content/Adventure/InteractiveCube_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/InteractiveCube_Blueprint.uasset -------------------------------------------------------------------------------- /Content/Adventure/SubtitlesWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Adventure/SubtitlesWidget.uasset -------------------------------------------------------------------------------- /Content/BaseCylinder.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BaseCylinder.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/BunnyBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/BunnyBP.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/BunnyBlueprintBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/BunnyBlueprintBP.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/BunnyMark_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/BunnyMark_Blueprint.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/BunnyOptimizedBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/BunnyOptimizedBP.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/bunny.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/bunny.uasset -------------------------------------------------------------------------------- /Content/BunnyMark/bunnyMat.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/BunnyMark/bunnyMat.uasset -------------------------------------------------------------------------------- /Content/Color.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Color.uasset -------------------------------------------------------------------------------- /Content/ColorBlue.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ColorBlue.uasset -------------------------------------------------------------------------------- /Content/ColorOrange.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ColorOrange.uasset -------------------------------------------------------------------------------- /Content/CubeAI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/CubeAI.uasset -------------------------------------------------------------------------------- /Content/CubeBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/CubeBP.uasset -------------------------------------------------------------------------------- /Content/CubeJS_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/CubeJS_Blueprint.uasset -------------------------------------------------------------------------------- /Content/ExampleBlueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ExampleBlueprint.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPersonFire_Montage.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPersonFire_Montage.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_AnimBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_AnimBP.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Fire.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_Fire.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Idle.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_Idle.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpEnd.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_JumpEnd.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpLoop.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_JumpLoop.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpStart.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_JumpStart.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Run.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Animations/FirstPerson_Run.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/M_UE4Man_Body.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/M_UE4Man_Body.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/FirstPersonAnimBlueprint_Copy.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Mesh/FirstPersonAnimBlueprint_Copy.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_LOGO_CARD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Textures/UE4_LOGO_CARD.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_Mannequin__normals.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Character/Textures/UE4_Mannequin__normals.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/M_FPGun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/M_FPGun.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Screen.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Screen.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_FineRubber.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_FineRubber.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Textures/T_FPGun_M.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Textures/T_FPGun_M.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Textures/T_FPGun_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/FPWeapon/Textures/T_FPGun_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Textures/FirstPersonCrosshair.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPerson/Textures/FirstPersonCrosshair.uasset -------------------------------------------------------------------------------- /Content/FirstPersonBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/FirstPersonBP.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/TemplateFloor.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Geometry/Meshes/TemplateFloor.uasset -------------------------------------------------------------------------------- /Content/HelloBlueprintActor_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/HelloBlueprintActor_Blueprint.uasset -------------------------------------------------------------------------------- /Content/KotlinBlueprintLibrary.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/KotlinBlueprintLibrary.uasset -------------------------------------------------------------------------------- /Content/KotlinLogo.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/KotlinLogo.uasset -------------------------------------------------------------------------------- /Content/KotlinLogo_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/KotlinLogo_Blueprint.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonIdle.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPersonIdle.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonJump_Loop.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPersonJump_Loop.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonJump_Start.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPersonJump_Start.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonRun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPersonRun.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonWalk.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPersonWalk.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_AnimBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPerson_AnimBP.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_IdleRun_2D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPerson_IdleRun_2D.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_Jump.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Animations/ThirdPerson_Jump.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/M_UE4Man_Body.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/M_UE4Man_Body.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/M_UE4Man_ChestLogo.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/M_UE4Man_ChestLogo.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/SK_Mannequin.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Mesh/SK_Mannequin.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/SK_Mannequin_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Mesh/SK_Mannequin_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/UE4_Mannequin_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Mesh/UE4_Mannequin_Skeleton.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4Man_Logo_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Textures/UE4Man_Logo_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_LOGO_CARD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Textures/UE4_LOGO_CARD.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_Mannequin__normals.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Mannequin/Character/Textures/UE4_Mannequin__normals.uasset -------------------------------------------------------------------------------- /Content/Maps/AdventureGame.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/AdventureGame.umap -------------------------------------------------------------------------------- /Content/Maps/BunnyMark.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/BunnyMark.umap -------------------------------------------------------------------------------- /Content/Maps/FirstPerson.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/FirstPerson.umap -------------------------------------------------------------------------------- /Content/Maps/FirstPersonGame.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/FirstPersonGame.umap -------------------------------------------------------------------------------- /Content/Maps/FirstPersonGame_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/FirstPersonGame_Blueprint.uasset -------------------------------------------------------------------------------- /Content/Maps/FirstPersonGame_BuiltData.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/FirstPersonGame_BuiltData.uasset -------------------------------------------------------------------------------- /Content/Maps/FirstPerson_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/FirstPerson_Blueprint.uasset -------------------------------------------------------------------------------- /Content/Maps/HelloBlueprint.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/HelloBlueprint.umap -------------------------------------------------------------------------------- /Content/Maps/HelloBlueprints.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/HelloBlueprints.umap -------------------------------------------------------------------------------- /Content/Maps/HelloBlueprints_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/HelloBlueprints_Blueprint.uasset -------------------------------------------------------------------------------- /Content/Maps/HelloKotlin.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/HelloKotlin.umap -------------------------------------------------------------------------------- /Content/Maps/Inheritance.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/Inheritance.umap -------------------------------------------------------------------------------- /Content/Maps/KeyboardInput.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/KeyboardInput.umap -------------------------------------------------------------------------------- /Content/Maps/RotatingCubes.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/RotatingCubes.umap -------------------------------------------------------------------------------- /Content/Maps/SceneLights.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/SceneLights.umap -------------------------------------------------------------------------------- /Content/Maps/ThirdPerson.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Maps/ThirdPerson.umap -------------------------------------------------------------------------------- /Content/Materials/PP_OutlineCustomDepthOcclusionInverse.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Materials/PP_OutlineCustomDepthOcclusionInverse.uasset -------------------------------------------------------------------------------- /Content/Materials/PP_OutlineCustomDepthOcclusionInverse_Inst.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Materials/PP_OutlineCustomDepthOcclusionInverse_Inst.uasset -------------------------------------------------------------------------------- /Content/Pickup_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Pickup_Blueprint.uasset -------------------------------------------------------------------------------- /Content/ProxyGameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ProxyGameMode.uasset -------------------------------------------------------------------------------- /Content/RotatingCube.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/RotatingCube.uasset -------------------------------------------------------------------------------- /Content/Scripts/KotlinCodeMain.js: -------------------------------------------------------------------------------- 1 | /*(function (global) { 2 | global.kotlinUnreal = {} 3 | global.kotlinUnreal.code = require('kotlin-examples') 4 | console.log("loaded Kotlin code") 5 | })(this)*/ 6 | 7 | try { 8 | module.exports = () => { 9 | console.log("--- LOADING kotlin code ---") 10 | 11 | global.kotlinUnreal = {}; 12 | global.kotlinUnreal.code = require('kotlin-examples'); 13 | console.log("loaded Kotlin code"); 14 | 15 | let cleanup = null; 16 | //process.nextTick(() => { 17 | cleanup = global.kotlinUnreal.code.init(); 18 | //}); 19 | return () => { if(cleanup) cleanup() } 20 | } 21 | } 22 | catch (e) { 23 | console.log("--- TRY TO LOAD KOTLIN.JS ---"); 24 | require('bootstrap')('KotlinCodeMain'); 25 | } 26 | -------------------------------------------------------------------------------- /Content/Scripts/KotlinMain.js: -------------------------------------------------------------------------------- 1 | try { 2 | module.exports = () => { 3 | console.log("--- LOADING kotlin-examples.JS ---") 4 | let examples = require('kotlin-examples') 5 | let cleanup = null 6 | process.nextTick(() => { 7 | cleanup = examples.init() 8 | }); 9 | return () => { if(cleanup) cleanup() } 10 | } 11 | } 12 | catch (e) { 13 | console.log("--- TRY TO LOAD KOTLIN.JS ---") 14 | require('bootstrap')('KotlinMain') 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Content/Scripts/KotlinUnreal.js: -------------------------------------------------------------------------------- 1 | if (typeof kotlin === 'undefined') { 2 | throw new Error("Error loading module 'KotlinUnreal'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'KotlinUnreal'."); 3 | }var KotlinUnreal = function (_, Kotlin) { 4 | 'use strict'; 5 | Kotlin.defineModule('KotlinUnreal', _); 6 | return _; 7 | }(typeof KotlinUnreal === 'undefined' ? {} : KotlinUnreal, kotlin); 8 | -------------------------------------------------------------------------------- /Content/Scripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | "use strict" 3 | 4 | module.exports = function (filename) { 5 | // Context.WriteDTS(Context.Paths[0] + 'typings/ue.d.ts') 6 | // Context.WriteAliases(Context.Paths[0] + 'aliases.js') 7 | 8 | Context.RunFile('aliases.js') 9 | Context.RunFile('polyfill/unrealengine.js') 10 | Context.RunFile('polyfill/timers.js') 11 | 12 | require('devrequire')(filename); 13 | } 14 | })(this) 15 | -------------------------------------------------------------------------------- /Content/Scripts/devjade.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | "use strict"; 3 | 4 | let UMG = require('UMG'); 5 | let devrequire = require('devrequire'); 6 | 7 | function devjade(path,setup) { 8 | function test() { 9 | let design = require('jade-umg')(UMG,path) 10 | return setup(design) 11 | } 12 | 13 | function livereload(path,test) { 14 | let files = [path] 15 | let fullpath = Context.GetScriptFileFullPath(path) 16 | let cleanup = null 17 | 18 | let cleanup_devrequire = devrequire({ 19 | get_change : function (watcher) { 20 | let full_files = files.map(function (x) { return Context.GetScriptFileFullPath(x)}) 21 | return full_files.filter(function (x) {return watcher.Contains(x)}) 22 | }, 23 | exec : function () { 24 | var design = test() 25 | files = design.$files 26 | cleanup = function() { 27 | cleanup = null 28 | design() 29 | } 30 | return cleanup 31 | }, 32 | notify : true, 33 | message : "Live reload (jade)" 34 | }) 35 | 36 | return function () { 37 | cleanup_devrequire() 38 | if (cleanup) { 39 | cleanup() 40 | } 41 | } 42 | } 43 | 44 | var live_jade = livereload(path,function () { 45 | return test() 46 | }) 47 | 48 | return live_jade 49 | } 50 | 51 | module.exports = devjade; 52 | })() 53 | -------------------------------------------------------------------------------- /Content/Scripts/polyfill/timers.js: -------------------------------------------------------------------------------- 1 | (function (target) { 2 | var makeWindowTimer = require('./windowTimers') 3 | if (Root == undefined || Root.OnTick == undefined) return 4 | 5 | var timerLoop = makeWindowTimer(target); 6 | 7 | var current_time = 0 8 | target.$time = 0 9 | 10 | var nextTicks = [] 11 | 12 | var elapsedTime = 0 13 | function invoke_next(fn) { 14 | fn(elapsedTime) 15 | } 16 | 17 | var root = function (_elapsedTime) { 18 | elapsedTime = _elapsedTime 19 | 20 | target.process.flushTicks() 21 | 22 | current_time += elapsedTime 23 | target.$time = current_time 24 | 25 | // non blocking 26 | timerLoop(true); 27 | } 28 | 29 | target.process = { 30 | nextTick: function (fn) { 31 | nextTicks.push(fn) 32 | }, 33 | flushTicks : function () { 34 | var prev = nextTicks 35 | nextTicks = [] 36 | prev.forEach(invoke_next) 37 | }, 38 | argv: [], 39 | argc: 0, 40 | platform: 'UnrealJS', 41 | env: { 42 | NODE_ENV: 'production' 43 | }, 44 | cwd: $cwd 45 | } 46 | 47 | Root.OnTick.Add(root) 48 | })(this) -------------------------------------------------------------------------------- /Content/Scripts/polyfill/unrealengine.js: -------------------------------------------------------------------------------- 1 | (function (target) { 2 | var lib = JavascriptLibrary.prototype 3 | })(this) 4 | -------------------------------------------------------------------------------- /Content/Scripts/polyfill/windowTimers.js: -------------------------------------------------------------------------------- 1 | /* Implementation of HTML Timers (setInterval/setTimeout) based on sleep. 2 | * 3 | * This file is provided under the following terms (MIT License): 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | * Copyright 2012 Kevin Locke 23 | */ 24 | /*jslint bitwise: true, evil: true */ 25 | 26 | /** 27 | * Adds methods to implement the HTML5 WindowTimers interface on a given 28 | * object. 29 | * 30 | * Adds the following methods: 31 | * 37 | * 38 | * See http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html 39 | * for the complete specification of these methods. 40 | * 41 | * Example Usage 42 | * Browser compatibility in Rhino: 43 | *
// Note:  "this" refers to the global object in this example
 44 |  * var timerLoop = makeWindowTimer(this, java.lang.Thread.sleep);
 45 |  *
 46 |  * // Run code which may add intervals/timeouts
 47 |  *
 48 |  * timerLoop();
 49 |  * 
50 | * 51 | * Browser compatibility in SpiderMonkey (smjs): 52 | *
// Note:  "this" refers to the global object in this example
 53 |  * var timerLoop = makeWindowTimer(this, function (ms) { sleep(ms / 1000); });
 54 |  *
 55 |  * // Run code which may add intervals/timeouts
 56 |  *
 57 |  * timerLoop();
 58 |  * 
59 | * 60 | * For more esoteric uses, timerLoop will return instead of sleeping if passed 61 | * true which will run only events which are pending at the moment 62 | * timerLoop is called: 63 | *
// Note:  "this" refers to the global object in this example
 64 |  * var timerLoop = makeWindowTimer(this, java.lang.Thread.sleep);
 65 |  *
 66 |  * // Run code which may add intervals/timeouts
 67 |  *
 68 |  * while (timerLoop(true)) {
 69 |  *     print("Still waiting...");
 70 |  *     // Do other work here, possibly adding more intervals/timeouts
 71 |  * }
 72 |  * 
73 | * 74 | * @param {Object} target Object to which the methods should be added. 75 | * @param {Function} sleep A function which sleeps for a specified number of 76 | * milliseconds. 77 | * @return {Function} The function which runs the scheduled timers. 78 | */ 79 | function makeWindowTimer(target, sleep) { 80 | "use strict"; 81 | 82 | var counter = 1, 83 | inCallback = false, 84 | // Map handle -> timer 85 | timersByHandle = {}, 86 | // Min-heap of timers by time then handle, index 0 unused 87 | timersByTime = [ null ]; 88 | 89 | /** Compares timers based on scheduled time and handle. */ 90 | function timerCompare(t1, t2) { 91 | // Note: Only need less-than for our uses 92 | return t1.time < t2.time ? -1 : 93 | (t1.time === t2.time && t1.handle < t2.handle ? -1 : 0); 94 | } 95 | 96 | /** Fix the heap invariant which may be violated at a given index */ 97 | function heapFixDown(heap, i, lesscmp) { 98 | var j, tmp; 99 | 100 | j = i * 2; 101 | while (j < heap.length) { 102 | if (j + 1 < heap.length && 103 | lesscmp(heap[j + 1], heap[j]) < 0) { 104 | j = j + 1; 105 | } 106 | 107 | if (lesscmp(heap[i], heap[j]) < 0) { 108 | break; 109 | } 110 | 111 | tmp = heap[j]; 112 | heap[j] = heap[i]; 113 | heap[i] = tmp; 114 | i = j; 115 | j = i * 2; 116 | } 117 | } 118 | 119 | /** Fix the heap invariant which may be violated at a given index */ 120 | function heapFixUp(heap, i, lesscmp) { 121 | var j, tmp; 122 | while (i > 1) { 123 | j = i >> 1; // Integer div by 2 124 | 125 | if (lesscmp(heap[j], heap[i]) < 0) { 126 | break; 127 | } 128 | 129 | tmp = heap[j]; 130 | heap[j] = heap[i]; 131 | heap[i] = tmp; 132 | i = j; 133 | } 134 | } 135 | 136 | /** Remove the minimum element from the heap */ 137 | function heapPop(heap, lesscmp) { 138 | heap[1] = heap[heap.length - 1]; 139 | heap.pop(); 140 | heapFixDown(heap, 1, lesscmp); 141 | } 142 | 143 | /** Create a timer and schedule code to run at a given time */ 144 | function addTimer(code, delay, repeat, argsIfFn) { 145 | var handle, timer; 146 | 147 | if (typeof code !== "function") { 148 | code = String(code); 149 | argsIfFn = null; 150 | } 151 | delay = Number(delay) || 0; 152 | if (inCallback) { 153 | delay = Math.max(delay, 4); 154 | } 155 | // Note: Must set handle after argument conversion to properly 156 | // handle conformance test in HTML5 spec. 157 | handle = counter; 158 | counter += 1; 159 | 160 | timer = { 161 | args: argsIfFn, 162 | cancel: false, 163 | code: code, 164 | handle: handle, 165 | repeat: repeat ? Math.max(delay, 4) : 0, 166 | time: $time * 1000 + delay 167 | }; 168 | 169 | timersByHandle[handle] = timer; 170 | timersByTime.push(timer); 171 | heapFixUp(timersByTime, timersByTime.length - 1, timerCompare); 172 | 173 | return handle; 174 | } 175 | 176 | /** Cancel an existing timer */ 177 | function cancelTimer(handle, repeat) { 178 | var timer; 179 | 180 | if (timersByHandle.hasOwnProperty(handle)) { 181 | timer = timersByHandle[handle]; 182 | if (repeat === (timer.repeat > 0)) { 183 | timer.cancel = true; 184 | } 185 | } 186 | } 187 | 188 | function clearInterval(handle) { 189 | cancelTimer(handle, true); 190 | } 191 | target.clearInterval = clearInterval; 192 | 193 | function clearTimeout(handle) { 194 | cancelTimer(handle, false); 195 | } 196 | target.clearTimeout = clearTimeout; 197 | 198 | function setInterval(code, delay) { 199 | return addTimer( 200 | code, 201 | delay, 202 | true, 203 | Array.prototype.slice.call(arguments, 2) 204 | ); 205 | } 206 | target.setInterval = setInterval; 207 | 208 | function setTimeout(code, delay) { 209 | return addTimer( 210 | code, 211 | delay, 212 | false, 213 | Array.prototype.slice.call(arguments, 2) 214 | ); 215 | } 216 | target.setTimeout = setTimeout; 217 | 218 | return function timerLoop(nonblocking) { 219 | var now, timer; 220 | 221 | // Note: index 0 unused in timersByTime 222 | while (timersByTime.length > 1) { 223 | timer = timersByTime[1]; 224 | 225 | if (timer.cancel) { 226 | delete timersByHandle[timer.handle]; 227 | heapPop(timersByTime, timerCompare); 228 | } else { 229 | now = $time * 1000; 230 | if (timer.time <= now) { 231 | inCallback = true; 232 | try { 233 | if (typeof timer.code === "function") { 234 | timer.code.apply(undefined, timer.args); 235 | } else { 236 | eval(timer.code); 237 | } 238 | } finally { 239 | inCallback = false; 240 | } 241 | 242 | if (timer.repeat > 0 && !timer.cancel) { 243 | timer.time += timer.repeat; 244 | heapFixDown(timersByTime, 1, timerCompare); 245 | } else { 246 | delete timersByHandle[timer.handle]; 247 | heapPop(timersByTime, timerCompare); 248 | } 249 | } else if (!nonblocking) { 250 | sleep(timer.time - now); 251 | } else { 252 | return true; 253 | } 254 | } 255 | } 256 | 257 | return false; 258 | }; 259 | } 260 | 261 | module.exports = makeWindowTimer; 262 | // vi: set sts=4 sw=4 et : 263 | -------------------------------------------------------------------------------- /Content/Scripts/uklass.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | "use strict"; 3 | 4 | let _ = require('lodash') 5 | let inputBinding = require('input-binding') 6 | function isClass (thing) { 7 | return typeof thing === 'function' && !thing.hasOwnProperty('arguments') 8 | } 9 | 10 | function getOwnPropertyNames (proto, stop) { 11 | let props = new Set(); 12 | while (proto && proto !== stop) { 13 | Object.getOwnPropertyNames(proto).filter(name => { 14 | let c = Object.getOwnPropertyDescriptor(proto, name); 15 | return (c.get || c.set) == undefined; 16 | }).forEach(name => { 17 | props.add(name); 18 | }); 19 | 20 | let parentClass = Object.getPrototypeOf(proto).constructor; 21 | if (!isClass(parentClass) || parentClass == Object) { 22 | break; 23 | } 24 | proto = Object.getPrototypeOf (proto); 25 | } 26 | return [...props]; 27 | } 28 | 29 | module.exports = function () { 30 | let mod_patterns = { 31 | bCtrl: /^ctrl$/i, 32 | bAlt: /^alt$/i, 33 | bCmd: /^cmd$/i, 34 | bShift: /^shift$/i 35 | } 36 | 37 | let inputbinding_patterns = { 38 | Action: (a) => ({ InputActionName: a[1], InputKeyEvent: a[2] || 'IE_Pressed' }), 39 | Axis: (a) => ({ InputAxisName: a[1] }), 40 | AxisKey: (a) => ({ InputAxisKey: a[1] }), 41 | Key: (a) => ({ InputChord: ParseInputChord(a[1]), InputKeyEvent: a[2] || 'IE_Pressed' }), 42 | Touch: (a) => ({ InputKeyEvent: a[1] || 'IE_Pressed' }), 43 | VectorAxis: (a) => ({}) 44 | } 45 | 46 | function ParseInputChord(string) { 47 | let a = (string || '').split('+') 48 | let key = a.pop() 49 | 50 | key = { 51 | '1': 'One', 52 | '2': 'Two', 53 | '3': 'Three', 54 | '4': 'Four', 55 | '5': 'Five', 56 | '6': 'Six', 57 | '7': 'Seven', 58 | '8': 'Eight', 59 | '9': 'Nine', 60 | '0': 'Zero', 61 | 'NumPad1': 'NumPadOne', 62 | 'NumPad2': 'NumPadTwo', 63 | 'NumPad3': 'NumPadThree', 64 | 'NumPad4': 'NumPadFour', 65 | 'NumPad5': 'NumPadFive', 66 | 'NumPad6': 'NumPadSix', 67 | 'NumPad7': 'NumPadSeven', 68 | 'NumPad8': 'NumPadEight', 69 | 'NumPad9': 'NumPadNine', 70 | 'NumPad0': 'NumPadZero', 71 | '*': 'Multiply', 72 | '+': 'Add', 73 | '-': 'Subtract', 74 | '/': 'Divide' 75 | }[key] || key; 76 | 77 | let out = { 78 | Key : { KeyName : key } 79 | } 80 | 81 | a.forEach((mod) => { 82 | _.each(mod_patterns,(v,k) => { 83 | if (v.test(mod)) { 84 | out[k] = true 85 | } 86 | }) 87 | }) 88 | 89 | return out 90 | } 91 | 92 | function ParseType(type) { 93 | let key = { 94 | 'boolean': 'bool', 95 | 'integer': 'int' 96 | } 97 | 98 | return key[type] || type; 99 | } 100 | 101 | let RE_class = /\s*class\s+(\w+)(\s+\/\*([^\*]*)\*\/)?(\s+extends\s+([^\s\{]+))?/ 102 | let RE_func = /(\w+)\s*(\/\*([^\*]*)\*\/)?\s*\(([^.)]*)\)\s*(\/\*([^\*]*)\*\/)?\s*.*/ 103 | function register(target, template, includeProperty=true, archetype=null) { 104 | target = target || {} 105 | let bindings = [] 106 | 107 | let splits = RE_class.exec(template) || (isClass(template) ? [null, template.name] : null) 108 | if (!splits) throw "Invalid class definition" 109 | 110 | let orgClassName = splits[1] 111 | 112 | // get a classname 113 | let className 114 | for (let index=0;;++index) { 115 | className = `${orgClassName}_C${index}` 116 | if (!UObject.Find(null,className)) break 117 | } 118 | let parentClass = Object.getPrototypeOf(template.prototype).constructor 119 | if (parentClass == Object) { 120 | parentClass = null 121 | } 122 | let properties = [] 123 | let classFlags = (splits[3] || "").split('+').map((x) => x.trim()) 124 | 125 | function refactored(x) { 126 | let m = /\s*(\w+)\s*(\/\*([^\*]*)\*\/)?\s*/.exec(x) 127 | if (m) { 128 | let arr = (m[3] || '').split('+').map((x) => x.trim()) 129 | let type = arr.pop() 130 | let is_array = false 131 | let is_subclass = false 132 | let is_map = false 133 | if (/\[\]$/.test(type)) { 134 | is_array = true 135 | type = type.substr(0, type.length - 2) 136 | } 137 | if (/\<\>$/.test(type)) { 138 | is_subclass = true 139 | type = type.substr(0, type.length - 2) 140 | } 141 | if(/\{\}$/.test(type)) { 142 | is_map = true 143 | let kv = (m[3] || '').split('::').map(x => x.trim()); 144 | let tv = _.map(kv, t => t.split('+').map(x => x.trim())); 145 | type = tv[0].pop() + '::' + tv[1].pop(); 146 | type = type.substr(0, type.length - 2) 147 | arr = _.concat(tv[0], tv[1]); 148 | 149 | } 150 | if (_.isFunction(target[type])) { 151 | let src = String(target[type]) 152 | let e = /function (\w+)\(/.exec(src) 153 | if (e) { 154 | type = e[1] 155 | } 156 | } 157 | 158 | if (type) { 159 | return { 160 | Name: m[1], 161 | Type: ParseType(type), 162 | Decorators: arr, 163 | IsSubclass: is_subclass, 164 | IsArray: is_array, 165 | IsMap: is_map 166 | } 167 | } else { 168 | return null 169 | } 170 | } else { 171 | return null 172 | } 173 | } 174 | 175 | let proxy = {} 176 | _(getOwnPropertyNames(template.prototype)).forEach((k) => { 177 | if (k == "properties") { 178 | let func = String(template.prototype[k]) 179 | func = func.substr(func.indexOf('{')+1) 180 | func = func.substr(0, func.lastIndexOf('}')) 181 | func = _.compact(func.split('\n').map((l) => l.trim())).map((l) => { 182 | if (l.indexOf("this.") != 0) return 183 | l = l.substr(5) 184 | return refactored(l) 185 | }) 186 | properties = func 187 | } else { 188 | let kproxy = k 189 | let koriginal = k 190 | if (k == 'constructor'){ 191 | kproxy = 'konstructor' 192 | } 193 | let F = proxy[kproxy] = template.prototype[koriginal] 194 | 195 | let s = String(F) 196 | 197 | let matches = RE_func.exec(s) 198 | if(!matches) throw "invalid function: " + s 199 | 200 | let functionName = matches[1] 201 | s = matches[matches[3] ? 3 : 6] 202 | let a = (s || '').split(/[\[\],]/).map((x) => x.trim()) 203 | a = _.compact(a) 204 | let flags = _.filter(a, (a) => /^[\-\+]/.test(a)) 205 | a = _.filter(a, (a) => !/^[\-\+]/.test(a)) 206 | let args = ((matches[4] || '').split(',').map((x) => refactored(x.trim()))) 207 | F.IsUFUNCTION = false 208 | if (_.every(args, (x) => !!x)) { 209 | F.Signature = args 210 | F.IsUFUNCTION = true 211 | } 212 | 213 | F.Decorators = a 214 | if (a.length > 0) { 215 | F.IsUFUNCTION = true 216 | } 217 | if (/Binding$/i.test(a[0])) { 218 | F.IsUFUNCTION = true 219 | let prefix = a[0].substr(0, a[0].length - 7) 220 | let pattern = inputbinding_patterns[prefix] 221 | if (!pattern) throw "Invalid binding pattern" 222 | 223 | let binding = { 224 | type: prefix, 225 | FunctionNameToBind: functionName 226 | } 227 | flags.forEach((flag) => { 228 | binding[flag.substr(1)] = (flag[0] == '+') 229 | }) 230 | bindings.push(_.extend(binding, pattern(a))) 231 | } 232 | } 233 | }) 234 | 235 | let thePackage = JavascriptLibrary.CreatePackage(null,'/Script/Javascript') 236 | 237 | //Kotlin hack 238 | //properties = template.prototype.getProperties() 239 | //console.log("Kotlin properties") 240 | console.log(properties) 241 | 242 | let klass = null 243 | if (_.includes(classFlags, "Struct")) { 244 | klass = CreateStruct(className, { 245 | Parent: parentClass, 246 | Functions: proxy, 247 | StructFlags: classFlags, 248 | Outer: thePackage, 249 | Archetype: archetype, 250 | Properties: includeProperty ? properties : [] 251 | }); 252 | } 253 | else { 254 | let nonNative = _.includes(classFlags, "NonNative"); 255 | _.remove(classFlags, "NonNative"); 256 | klass = CreateClass(className, { 257 | Parent: KotlinObject,//parentClass, 258 | Functions: proxy, 259 | ClassFlags: classFlags, 260 | Outer: thePackage, 261 | Archetype: archetype, 262 | NonNative: nonNative, 263 | Properties: includeProperty ? properties : [] 264 | }); 265 | } 266 | 267 | if (target != undefined) { 268 | target[orgClassName] = klass; 269 | } 270 | 271 | bindings.forEach((binding) => inputBinding(klass,binding)) 272 | return klass; 273 | } 274 | 275 | return register; 276 | } 277 | }(this)) 278 | -------------------------------------------------------------------------------- /Content/Switch_Blueprint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/Switch_Blueprint.uasset -------------------------------------------------------------------------------- /Content/ThirdPerson/Meshes/CubeMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ThirdPerson/Meshes/CubeMaterial.uasset -------------------------------------------------------------------------------- /Content/ThirdPersonBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Content/ThirdPersonBP.uasset -------------------------------------------------------------------------------- /KotlinUnreal.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28315.86 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{233774A8-CC9D-3FA9-86D1-90573E92B704}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KotlinUnreal", "Intermediate\ProjectFiles\KotlinUnreal.vcxproj", "{431817E4-A931-39A2-8A7A-FF9930522C1E}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE5", "Intermediate\ProjectFiles\UE5.vcxproj", "{45866BD9-B529-33B4-A618-00560236E625}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1CCEC849-CC72-4C59-8C36-2F7C38706D4C}" 15 | ProjectSection(SolutionItems) = preProject 16 | ..\..\..\..\..\Program Files\Epic Games\UE_5.0\Engine\Extras\VisualStudioDebugging\Unreal.natvis = ..\..\..\..\..\Program Files\Epic Games\UE_5.0\Engine\Extras\VisualStudioDebugging\Unreal.natvis 17 | EndProjectSection 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | DebugGame Editor|Win64 = DebugGame Editor|Win64 22 | DebugGame|Win64 = DebugGame|Win64 23 | Development Editor|Win64 = Development Editor|Win64 24 | Development|Win64 = Development|Win64 25 | Shipping|Win64 = Shipping|Win64 26 | EndGlobalSection 27 | # UnrealVS Section 28 | GlobalSection(ddbf523f-7eb6-4887-bd51-85a714ff87eb) = preSolution 29 | AvailablePlatforms=Win64 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64 33 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64 34 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.DebugGame|Win64.ActiveCfg = DebugGame|x64 35 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.DebugGame|Win64.Build.0 = DebugGame|x64 36 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Development Editor|Win64.ActiveCfg = Development_Editor|x64 37 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Development Editor|Win64.Build.0 = Development_Editor|x64 38 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Development|Win64.ActiveCfg = Development|x64 39 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Development|Win64.Build.0 = Development|x64 40 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Shipping|Win64.ActiveCfg = Shipping|x64 41 | {431817E4-A931-39A2-8A7A-FF9930522C1E}.Shipping|Win64.Build.0 = Shipping|x64 42 | {45866BD9-B529-33B4-A618-00560236E625}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 43 | {45866BD9-B529-33B4-A618-00560236E625}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 44 | {45866BD9-B529-33B4-A618-00560236E625}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 45 | {45866BD9-B529-33B4-A618-00560236E625}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 46 | {45866BD9-B529-33B4-A618-00560236E625}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 47 | EndGlobalSection 48 | GlobalSection(SolutionProperties) = preSolution 49 | HideSolutionNode = FALSE 50 | EndGlobalSection 51 | GlobalSection(NestedProjects) = preSolution 52 | {45866BD9-B529-33B4-A618-00560236E625} = {233774A8-CC9D-3FA9-86D1-90573E92B704} 53 | {431817E4-A931-39A2-8A7A-FF9930522C1E} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6} 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /KotlinUnreal.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "5.0", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "KotlinUnreal", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default" 11 | } 12 | ], 13 | "Plugins": [ 14 | { 15 | "Name": "UnrealJS", 16 | "Enabled": true, 17 | "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/be751eedc4a14cc09e39945bc5a531c4" 18 | }, 19 | { 20 | "Name": "ModelingToolsEditorMode", 21 | "Enabled": true, 22 | "TargetAllowList": [ 23 | "Editor" 24 | ] 25 | }, 26 | { 27 | "Name": "Bridge", 28 | "Enabled": true, 29 | "SupportedTargetPlatforms": [ 30 | "Win64", 31 | "Mac", 32 | "Linux" 33 | ] 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 hiperbou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kotlin-unreal 2 | kotlin-unreal: Use the amazing [Kotlin](https://kotlinlang.org/) language with UnrealEngine 4 and UnrealEngine 5 3 | 4 | Uses Unreal.js wich is a Javascript runtime built for **UE4** and **UE5** 5 | 6 | ## Features 7 | - Access to all Blueprint functions and classes 8 | - A KotlinComponent attachable to an actor to control its behavior 9 | - Interoperation between variables and functions defined at the Blueprint level 10 | - Customizable Hot Reload: Apply code updates to everything or to the actors you're interested in, while in play mode. 11 | 12 | ## Prerequisites 13 | Unreal 4.26.1 - 4.27.2 or **Unreal 5.0.0 - 5.0.1**, but may work with other versions too. 14 | 15 | Being able to build and run a Unreal C++ project and having all its dependencies installed. 16 | 17 | IntelliJ IDEA Community: https://www.jetbrains.com/idea/download/ 18 | 19 | ## Installation 20 | 21 | - Install Unreal.js plugin in your engine. The easiest way is finding it on the Unreal Marketplace: 22 | https://www.unrealengine.com/marketplace/en-US/product/unrealjs 23 | 24 | If you can't find it in the Unreal Marketplace, you can install it manually following this instructions: 25 | https://github.com/ncsoft/Unreal.js/ 26 | 27 | - Clone or download this repository. 28 | 29 | Optionally change to a branch matching your engine version: 30 | 31 | [master](https://github.com/hiperbou/kotlin-unreal) branch will always be updated with the latest Unreal Engine version 32 | 33 | **Unreal Engine 5** 34 | 35 | [UE5.0.1](https://github.com/hiperbou/kotlin-unreal/tree/UE5.0.1-Kotlin1.4.31) 36 | 37 | **Unreal Engine 4** 38 | 39 | [UE4.27.2](https://github.com/hiperbou/kotlin-unreal/tree/UE4.27.2-Kotlin1.4.31), 40 | [UE4.27.1](https://github.com/hiperbou/kotlin-unreal/tree/UE4.27.1-Kotlin1.4.31), 41 | [UE4.26.1](https://github.com/hiperbou/kotlin-unreal/tree/UE4.26.1-Kotlin1.4.31) 42 | 43 | - You should be able to right click the file "KotlinUnreal.uproject" and select "Launch Game" 44 | - You might be asked to recompile or update the project to your engine version and after that you should be seeing the First Person Game example. 45 | 46 | ## Check out the map examples 47 | Open the project with the Unreal Editor and open and play the maps located on the Maps directory inside the Content folder. 48 | Some of them might look empty at first, but the Kotlin magic will fill them with surprises when you get into the Play mode. 49 | 50 | ## WIKI 51 | Check out the wiki for details, tutorials and guides: 52 | 53 | https://github.com/hiperbou/kotlin-unreal/wiki 54 | 55 | ## VIDEOS 56 | Playlist on Youtube 57 | 58 | https://youtube.com/playlist?list=PLJm5YzQnui1RfCue2NJtEKDSAJf-Kh0WG 59 | 60 | ## Code examples 61 | 62 | First Person Game example (watch on [Youtube](https://youtu.be/Pcb3cdpAFFA?t=9)): 63 | 64 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/game/Game.kt 65 | [![First Person Shooter example video](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/game.jpg)](https://youtu.be/Pcb3cdpAFFA?t=9) 66 | 67 | Hello World example: 68 | 69 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/hello/HelloKotlin.kt 70 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/helloworld.jpg) 71 | 72 | Rotating cubes example: 73 | 74 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/cubes/WhiteRotatingCube.kt 75 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/cubes.jpg) 76 | 77 | Adventure example (Kotlin Coroutines): 78 | 79 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/adventure/InteractiveCube.kt 80 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/adventure.jpg) 81 | 82 | First Person example: 83 | 84 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/firstperson/FirstPerson.kt 85 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/firstperson.jpg) 86 | 87 | Third Person example: 88 | 89 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/thirdperson/ThirdPerson.kt 90 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/thirdperson.jpg) 91 | 92 | Scene Lights example: 93 | 94 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/scenelights/SceneLights.kt 95 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/scenelights.jpg) 96 | 97 | Hello Blueprints example: 98 | 99 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/blueprint/HelloBlueprints.kt 100 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/helloblueprints.jpeg) 101 | 102 | Hello Blueprint example: 103 | 104 | https://github.com/hiperbou/kotlin-unreal/blob/master/kotlin-examples/src/examples/blueprint/HelloBlueprint.kt 105 | ![](https://github.com/hiperbou/kotlin-unreal/blob/master/Screenshots/helloblueprint.jpg) 106 | -------------------------------------------------------------------------------- /Screenshots/adventure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/adventure.jpg -------------------------------------------------------------------------------- /Screenshots/cubes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/cubes.jpg -------------------------------------------------------------------------------- /Screenshots/firstperson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/firstperson.jpg -------------------------------------------------------------------------------- /Screenshots/game.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/game.jpg -------------------------------------------------------------------------------- /Screenshots/helloblueprint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/helloblueprint.jpg -------------------------------------------------------------------------------- /Screenshots/helloblueprints.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/helloblueprints.jpeg -------------------------------------------------------------------------------- /Screenshots/helloworld.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/helloworld.jpg -------------------------------------------------------------------------------- /Screenshots/scenelights.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/scenelights.jpg -------------------------------------------------------------------------------- /Screenshots/thirdperson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/Screenshots/thirdperson.jpg -------------------------------------------------------------------------------- /Source/KotlinUnreal.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class KotlinUnrealTarget : TargetRules 7 | { 8 | public KotlinUnrealTarget( TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Game; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | ExtraModuleNames.AddRange( new string[] { "KotlinUnreal" } ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "KotlinComponent.h" 2 | #include "JavascriptContext.h" 3 | #include "Engine/World.h" 4 | #include "Engine/Engine.h" 5 | #include "IV8.h" 6 | #include "KotlinGameInstance.h" 7 | #include "Kismet/BlueprintFunctionLibrary.h" 8 | //#include "Regex.h" 9 | #include "KotlinObject.h" 10 | 11 | UKotlinComponent::UKotlinComponent() 12 | : JavascriptContext(nullptr) 13 | { 14 | PrimaryComponentTick.bCanEverTick = true; 15 | //PrimaryComponentTick.TickInterval = 0.03f; 16 | bTickInEditor = false; 17 | bAutoActivate = true; 18 | bWantsInitializeComponent = true; 19 | } 20 | 21 | 22 | void UKotlinComponent::BeginPlay() 23 | { 24 | Super::BeginPlay(); 25 | 26 | LoadKotlinObject(); 27 | } 28 | 29 | /*void UKotlinComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) 30 | { 31 | if (KotlinObject != nullptr) 32 | { 33 | return KotlinObject->Tick(DeltaTime); 34 | } 35 | }*/ 36 | void UKotlinComponent::OnTick(float DeltaTime) 37 | { 38 | if (KotlinObject != nullptr) 39 | { 40 | return KotlinObject->Tick(DeltaTime); 41 | } 42 | } 43 | 44 | void UKotlinComponent::OnDestroyed() 45 | { 46 | UE_LOG(LogTemp, Warning, TEXT("Begin destroy %s"), *(GetOwner()->GetName())); 47 | if (KotlinObject != nullptr) { 48 | KotlinObject->OnDestroyed(); 49 | } 50 | } 51 | 52 | void UKotlinComponent::OnRegister() 53 | { 54 | const auto ContextOwner = GetOuter(); 55 | if (ContextOwner && !HasAnyFlags(RF_ClassDefaultObject) && !ContextOwner->HasAnyFlags(RF_ClassDefaultObject)) 56 | { 57 | if (GetWorld() && ((GetWorld()->IsGameWorld() && !GetWorld()->IsPreviewWorld()))) 58 | { 59 | JavascriptContext = Cast(GetWorld()->GetGameInstance())->GetContext(); 60 | } 61 | } 62 | 63 | Super::OnRegister(); 64 | } 65 | 66 | void UKotlinComponent::SetKotlinObject(UKotlinObject* kotlinObject) 67 | { 68 | KotlinObject = kotlinObject; 69 | } 70 | 71 | UKotlinObject* UKotlinComponent::GetKotlinObject() 72 | { 73 | return KotlinObject; 74 | } 75 | 76 | void UKotlinComponent::LoadKotlinObject() 77 | { 78 | if (JavascriptContext == nullptr) return; 79 | if (KotlinClass.IsEmpty()) 80 | { 81 | UE_LOG(LogTemp, Warning, TEXT("Error loading Empty Kotlin Class %s"), *(GetOwner()->GetName())); 82 | GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Error loading Kotlin Class. See console for details")); 83 | return; 84 | } 85 | 86 | FString script = TEXT("this.kotlinUnreal.code.unrealProxyClass(this, this.kotlinUnreal.code.") + KotlinClass + TEXT(", \"") + KotlinClass + TEXT("\")\r\n"); 87 | //UE_LOG(LogTemp, Warning, TEXT("Running script: %s"), *script); 88 | 89 | JavascriptContext->Expose("ComponentRoot", this); 90 | JavascriptContext->RunScript(script); 91 | } 92 | 93 | FString UKotlinComponent::BeginOverlap(AActor* other) 94 | { 95 | if (KotlinObject != nullptr) 96 | { 97 | return KotlinObject->BeginOverlap(other); 98 | } 99 | 100 | return FString(); 101 | } 102 | 103 | void UKotlinComponent::EndOverlap(AActor* other) 104 | { 105 | if (KotlinObject != nullptr) 106 | { 107 | KotlinObject->EndOverlap(other); 108 | } 109 | } 110 | 111 | UObject* UKotlinComponent::ResolveAsset(FName Name, bool bTryLoad) 112 | { 113 | UE_LOG(LogTemp, Warning, TEXT("ResolveAsset")); 114 | for (const auto& Item : Assets) 115 | { 116 | UE_LOG(LogTemp, Warning, TEXT("ResolveAsset: %s"), *Item.Name.ToString()); 117 | if (Item.Name == Name) 118 | { 119 | 120 | if(bTryLoad) 121 | { 122 | FString BPRef = "Blueprint '" + Item.Asset.GetAssetPathString() + "'"; 123 | UE_LOG(LogTemp, Warning, TEXT("ResolveAsset.TryLoad: %s"), *BPRef); 124 | 125 | UClass* ThisBPClass = LoadObject(NULL, *BPRef); 126 | return ThisBPClass; 127 | } 128 | //return bTryLoad ? Item.Asset.TryLoad() : Item.Asset.ResolveObject(); 129 | return Item.Asset.ResolveObject(); 130 | } 131 | } 132 | 133 | return nullptr; 134 | } 135 | UClass* UKotlinComponent::ResolveClass(FName Name) 136 | { 137 | UE_LOG(LogTemp, Warning, TEXT("ResolveClass:")); 138 | 139 | for (const auto& Item : ClassAssets) 140 | { 141 | UE_LOG(LogTemp, Warning, TEXT("ResolveClass: %s"), *Item.Name.ToString()); 142 | if (Item.Name == Name) 143 | { 144 | return Item.Class; 145 | } 146 | } 147 | 148 | return nullptr; 149 | } 150 | 151 | AActor* UKotlinComponent::Spawn(UClass* ClassF, FVector const Location, FRotator const Rotation) 152 | { 153 | return GetWorld()->SpawnActor(ClassF, &Location, &Rotation); 154 | } 155 | 156 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Components/ActorComponent.h" 5 | #include "Templates/SubclassOf.h" 6 | #include "Components/ActorComponent.h" 7 | #include "JavascriptContext.h" 8 | 9 | 10 | 11 | #include "KotlinComponent.generated.h" 12 | 13 | class UKotlinObject; 14 | 15 | USTRUCT() 16 | struct KOTLINUNREAL_API FKotlinAsset 17 | { 18 | GENERATED_BODY() 19 | 20 | UPROPERTY(EditAnywhere, Category = "Kotlin") 21 | FName Name; 22 | 23 | UPROPERTY(EditAnywhere, Category = "Kotlin") 24 | FStringAssetReference Asset; 25 | }; 26 | 27 | USTRUCT() 28 | struct KOTLINUNREAL_API FKotlinClassAsset 29 | { 30 | GENERATED_BODY() 31 | 32 | UPROPERTY(EditAnywhere, Category = "Kotlin") 33 | FName Name; 34 | 35 | UPROPERTY(EditAnywhere, Category = "Kotlin") 36 | TSubclassOf Class; 37 | }; 38 | 39 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 40 | class KOTLINUNREAL_API UKotlinComponent : public UActorComponent 41 | { 42 | GENERATED_BODY() 43 | 44 | public: 45 | UKotlinComponent(); 46 | 47 | protected: 48 | virtual void BeginPlay() override; 49 | 50 | public: 51 | virtual void OnRegister() override; 52 | 53 | //virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; 54 | 55 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Kotlin") 56 | FString KotlinClass; 57 | 58 | UPROPERTY(EditAnywhere, Category = "Kotlin") 59 | TArray Assets; 60 | 61 | UPROPERTY(EditAnywhere, Category = "Kotlin") 62 | TArray ClassAssets; 63 | 64 | UPROPERTY(transient) 65 | UJavascriptContext* JavascriptContext; 66 | 67 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 68 | void LoadKotlinObject(); 69 | 70 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 71 | void SetKotlinObject(UKotlinObject* kotlinObject); 72 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 73 | UKotlinObject* GetKotlinObject(); 74 | 75 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 76 | void OnTick(float DeltaTime); 77 | 78 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 79 | FString BeginOverlap(AActor* other); 80 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 81 | void EndOverlap(AActor* other); 82 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 83 | void OnDestroyed(); 84 | 85 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 86 | UObject* ResolveAsset(FName Name, bool bTryLoad = true); 87 | 88 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 89 | UClass* ResolveClass(FName Name); 90 | 91 | UFUNCTION(BlueprintCallable, Category = "Kotlin") 92 | AActor* Spawn(UClass* ClassF, FVector const Location, FRotator const Rotation); 93 | private: 94 | UPROPERTY() 95 | UKotlinObject* KotlinObject; 96 | }; 97 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinGameInstance.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "KotlinGameInstance.h" 4 | #include "JavascriptIsolate.h" 5 | #include "JavascriptContext.h" 6 | #include "Engine/World.h" 7 | #include "Engine/Engine.h" 8 | 9 | void UKotlinGameInstance::Init() 10 | { 11 | Super::Init(); 12 | 13 | //LoadJSFile(); 14 | Isolate = NewObject(); 15 | Isolate->Init(false); 16 | Isolate->AddToRoot(); 17 | 18 | auto* Context = Isolate->CreateContext(); 19 | JavascriptContext = Context; 20 | 21 | Context->Expose("Root", this); 22 | Context->Expose("GWorld", GetWorld()); 23 | Context->Expose("GEngine", GEngine); 24 | 25 | LoadJSFile(); 26 | } 27 | 28 | void UKotlinGameInstance::Tick( float DeltaTime ) 29 | { 30 | OnTick.ExecuteIfBound(DeltaTime); 31 | } 32 | 33 | TStatId UKotlinGameInstance::GetStatId() const 34 | { 35 | return GetStatID(); 36 | } 37 | 38 | void UKotlinGameInstance::OnWorldChanged(UWorld* OldWorld, UWorld* NewWorld) 39 | { 40 | if (JavascriptContext == nullptr) return; 41 | JavascriptContext->Expose("GWorld", NewWorld); 42 | } 43 | 44 | void UKotlinGameInstance::LoadJSFile() 45 | { 46 | if (JavascriptContext == nullptr) return; 47 | 48 | FString ScriptSourceFile = TEXT("Scripts/KotlinCodeMain.js"); 49 | auto scriptSourceFilePath = FPaths::Combine(FPaths::ProjectContentDir(), ScriptSourceFile); 50 | 51 | scriptSourceFilePath = FPaths::ConvertRelativePathToFull(scriptSourceFilePath); 52 | 53 | FString script; 54 | FFileHelper::LoadFileToString(script, *scriptSourceFilePath); 55 | 56 | //JavascriptContext->Expose("Root", this); 57 | JavascriptContext->RunScript(script); 58 | } 59 | 60 | void UKotlinGameInstance::Shutdown() 61 | { 62 | Isolate->RemoveFromRoot(); 63 | } 64 | 65 | UJavascriptIsolate* UKotlinGameInstance::GetIsolate() 66 | { 67 | return Isolate; 68 | } 69 | 70 | UJavascriptContext* UKotlinGameInstance::GetContext() 71 | { 72 | return JavascriptContext; 73 | } -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinGameInstance.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "JavascriptIsolate.h" 8 | #include "Engine/GameInstance.h" 9 | #include "KotlinGameInstance.generated.h" 10 | 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class KOTLINUNREAL_API UKotlinGameInstance : public UGameInstance, public FTickableGameObject 16 | { 17 | GENERATED_BODY() 18 | 19 | protected: 20 | virtual void Init() override; 21 | 22 | public: 23 | DECLARE_DYNAMIC_DELEGATE_OneParam(FJavascriptTickSignature, float, DeltaSeconds); 24 | 25 | virtual void Shutdown() override; 26 | virtual void OnWorldChanged(UWorld* OldWorld, UWorld* NewWorld) override; 27 | 28 | UJavascriptIsolate* GetIsolate(); 29 | UJavascriptContext* GetContext(); 30 | 31 | void LoadJSFile(); 32 | 33 | UPROPERTY() 34 | FJavascriptTickSignature OnTick; 35 | 36 | virtual void Tick( float DeltaTime ) override; 37 | virtual TStatId GetStatId() const override; 38 | 39 | private: 40 | UPROPERTY(transient) 41 | UJavascriptIsolate* Isolate; 42 | UPROPERTY(transient) 43 | UJavascriptContext* JavascriptContext; 44 | 45 | }; 46 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinObject.cpp: -------------------------------------------------------------------------------- 1 | #include "KotlinObject.h" 2 | 3 | UKotlinObject::UKotlinObject() 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "KotlinObject.generated.h" 5 | 6 | 7 | UCLASS(BlueprintType) 8 | class KOTLINUNREAL_API UKotlinObject : public UObject 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | UKotlinObject(); 14 | 15 | UFUNCTION(BlueprintImplementableEvent) 16 | FString BeginOverlap(AActor* other); 17 | UFUNCTION(BlueprintImplementableEvent) 18 | FString EndOverlap(AActor* other); 19 | UFUNCTION(BlueprintImplementableEvent) 20 | void Tick(float DeltaTime); 21 | UFUNCTION(BlueprintImplementableEvent) 22 | void OnDestroyed(); 23 | 24 | UPROPERTY() 25 | UActorComponent* Root; 26 | }; 27 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinUnreal.Build.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class KotlinUnreal : ModuleRules 6 | { 7 | public KotlinUnreal(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "V8" }); 12 | 13 | PrivateDependencyModuleNames.AddRange(new string[] { }); 14 | 15 | // Uncomment if you are using Slate UI 16 | // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 17 | 18 | // Uncomment if you are using online features 19 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 20 | 21 | // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinUnreal.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "KotlinUnreal.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, KotlinUnreal, "KotlinUnreal" ); 7 | -------------------------------------------------------------------------------- /Source/KotlinUnreal/KotlinUnreal.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | -------------------------------------------------------------------------------- /Source/KotlinUnrealEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class KotlinUnrealEditorTarget : TargetRules 7 | { 8 | public KotlinUnrealEditorTarget( TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Editor; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | ExtraModuleNames.AddRange( new string[] { "KotlinUnreal" } ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /kotlin-examples/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("js") version "1.7.10" 3 | } 4 | 5 | group = "org.example" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | //mavenLocal() 10 | mavenCentral() 11 | } 12 | 13 | dependencies { 14 | implementation("io.github.hiperbou.ue:kotlin-unreal-definitions:5.0.1") 15 | //implementation("io.github.hiperbou.ue:kotlin-unreal-definitions:5.0.1-SNAPSHOT") 16 | 17 | implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") 18 | 19 | testImplementation(kotlin("test")) 20 | } 21 | 22 | kotlin { 23 | js(LEGACY) { 24 | binaries.executable() 25 | useCommonJs() 26 | /*browser { 27 | //webpackTask { 28 | // output.libraryTarget = "commonjs" 29 | // } 30 | dceTask { 31 | dceOptions.devMode = true 32 | } 33 | 34 | }*/ 35 | } 36 | } 37 | 38 | tasks { 39 | build { 40 | doLast { 41 | copy { 42 | from("build/classes/kotlin/main") { 43 | include("kotlin-examples.js") 44 | } 45 | into("../Content/Scripts") 46 | } 47 | } 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /kotlin-examples/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | kotlin.js.compiler=legacy 3 | -------------------------------------------------------------------------------- /kotlin-examples/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/kotlin-examples/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlin-examples/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /kotlin-examples/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /kotlin-examples/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /kotlin-examples/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | 2 | rootProject.name = "kotlin-examples" 3 | 4 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/KotlinObject.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | //external fun require(r:String):dynamic 4 | 5 | external interface KotlinUnrealObject { 6 | fun Tick(deltaTime:Float) 7 | fun BeginOverlap(other: Actor):String 8 | fun EndOverlap(other: Actor) 9 | fun OnDestroyed() 10 | } 11 | 12 | external class KotlinActorComponent:ActorComponent { 13 | fun Spawn(actorClass:UClass, position:Vector, rotation: Rotator):T 14 | } 15 | 16 | external open class KotlinObject: KotlinUnrealObject { 17 | val Root:KotlinActorComponent 18 | override fun Tick(deltaTime: Float):Unit = definedExternally 19 | override fun BeginOverlap(other: Actor):String = definedExternally 20 | override fun EndOverlap(other: Actor) 21 | override fun OnDestroyed():Unit = definedExternally 22 | } 23 | 24 | fun KotlinObject.GetOwner():T { 25 | return Root.GetOwner().asDynamic() 26 | } 27 | 28 | external var global:dynamic 29 | external var ComponentRoot:dynamic 30 | 31 | private object KotlinUnrealClassCache{ 32 | val cache = mutableMapOf() 33 | } 34 | 35 | @JsName("unrealProxyClass") 36 | fun unrealProxyClass(global:dynamic, klass:dynamic, className:String) { 37 | val GeneratedClassDefinition = if(KotlinUnrealClassCache.cache.containsKey(className)) { 38 | KotlinUnrealClassCache.cache.get(className) 39 | } else { 40 | val r = js("require('uklass')()(global, klass)") 41 | KotlinUnrealClassCache.cache.put(className, r) 42 | r 43 | } 44 | val instance = js("new GeneratedClassDefinition()") 45 | instance.Root = ComponentRoot 46 | instance.Root.SetKotlinObject(instance) 47 | instance.konstructor() 48 | if(!global.precious) global.precious = js("[]"); global.precious.push(instance) 49 | } 50 | 51 | /* 52 | //companion object{ 53 | fun getProperties():Array{ 54 | return arrayOf() 55 | return arrayOf(toProperties("touched", touched::class.simpleName!!), 56 | toProperties("acumulatedDeltaTime", acumulatedDeltaTime::class.simpleName!!)) 57 | } 58 | //} 59 | 60 | fun parseType(type:String): String { 61 | println("ParseType $type") 62 | val key = mapOf( 63 | "boolean" to "bool", 64 | "integer" to "int", 65 | "number" to "float", 66 | "double" to "float", 67 | ) 68 | 69 | return key.getOrElse(type.toLowerCase()) { type } 70 | } 71 | 72 | fun toProperties(name:String, type:String):dynamic { 73 | println("toPropertiess: $name $type") 74 | return object { 75 | val Name:String = name 76 | val Type:String = parseType(type) 77 | val Decorators:Array = arrayOf("EditAnywhere") 78 | val IsSubclass:Boolean = false 79 | val IsArray:Boolean = false 80 | val IsMap:Boolean = false 81 | } 82 | }*/ -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/adventure/AdventureCharacter.kt: -------------------------------------------------------------------------------- 1 | import examples.adventure.InteractionManager 2 | import ue.* 3 | 4 | class AdventureCharacter: KotlinObject() { 5 | 6 | val keyLeft = KeyListener("A") 7 | val keyRight = KeyListener("D") 8 | val keyUp = KeyListener("W") 9 | val keyDown = KeyListener("S") 10 | val keyInteract = KeyListener("E") 11 | 12 | var actor = GetOwner() 13 | val movementComponent = actor.GetMovementComponent() 14 | 15 | init { 16 | //Set size for collision capsule 17 | actor.CapsuleComponent.CapsuleRadius = 42.0 18 | actor.CapsuleComponent.CapsuleHalfHeight = 96.0 19 | //this.CapsuleComponent.bVisible = true 20 | //this.CapsuleComponent.bHiddenInGame = false 21 | 22 | // Don't rotate when the controller rotates. Let that just affect the camera. 23 | actor.bUseControllerRotationPitch = false 24 | actor.bUseControllerRotationRoll = false 25 | actor.bUseControllerRotationYaw = false 26 | 27 | // Configure character movement 28 | actor.CharacterMovement.bOrientRotationToMovement = true // Character moves in the direction of input... 29 | actor.CharacterMovement.RotationRate = Rotator.MakeRotator(0, 0, 540) 30 | 31 | val ANI_AnimationBP = AnimBlueprint.Load("/Game/Mannequin/Animations/ThirdPerson_AnimBP.ThirdPerson_AnimBP").GeneratedClass 32 | 33 | actor.Mesh.SetAnimInstanceClass(ANI_AnimationBP) 34 | 35 | actor.Mesh.RelativeRotation = Rotator.MakeRotator(0, 0, 270) 36 | 37 | actor.Mesh.RelativeLocation = Vector.MakeVector(0, 0, -96) 38 | 39 | val myPlayerController = GWorld.GetPlayerController(0) 40 | 41 | myPlayerController.Possess(actor) 42 | } 43 | 44 | 45 | override fun Tick(deltaTime:Float) { 46 | if(keyLeft.down()) { 47 | MoveRight(-1.0) 48 | } 49 | if(keyRight.down()) { 50 | MoveRight(1.0) 51 | } 52 | if(keyUp.down()) { 53 | MoveForward(1.0) 54 | } 55 | if(keyDown.down()) { 56 | MoveForward(-1.0) 57 | } 58 | if(keyInteract.pressed()) { 59 | InteractionManager.interact() 60 | } 61 | 62 | Turn(axisTurn()) 63 | LookUp(axisLookUp()) 64 | } 65 | 66 | fun Turn(value:Double) 67 | { 68 | //add Turn value to controller yaw input 69 | actor.AddControllerYawInput(value) 70 | } 71 | 72 | fun LookUp(value:Double) 73 | { 74 | //add LookUp value to controller pitch input 75 | actor.AddControllerPitchInput(value) 76 | } 77 | fun MoveForward(value:Double ) 78 | { 79 | //get pawn control rotation 80 | val tPawnRotator = actor.GetControlRotation() 81 | 82 | //zero out roll and pitch, leaving yaw untouched 83 | tPawnRotator.Pitch = 0 84 | tPawnRotator.Roll = 0 85 | 86 | //find forward vector from rotation 87 | val tForwardVector = tPawnRotator.GetForwardVector() 88 | 89 | //move pawn forward (value > 0) or backward(value < 0) 90 | actor.AddMovementInput(tForwardVector, value, false) 91 | } 92 | 93 | fun MoveRight(value:Double) 94 | { 95 | //get pawn control rotation 96 | val tPawnRotator = actor.GetControlRotation() 97 | 98 | //zero out roll and pitch, leaving yaw untouched 99 | tPawnRotator.Pitch = 0 100 | tPawnRotator.Roll = 0 101 | 102 | //find right vector from rotation 103 | val tRightVector = tPawnRotator.GetRightVector() 104 | 105 | //move pawn right (value > 0) or left (value < 0) 106 | actor.AddMovementInput(tRightVector, value, false) 107 | } 108 | 109 | fun cleanup() { 110 | console.log("<<>>") 111 | actor.DestroyActor() 112 | } 113 | 114 | fun axisTurn():Double { 115 | //return GWorld.GetPlayerController(0).GetInputAxisValue("Turn").toDouble() 116 | return GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaX.toDouble() 117 | } 118 | fun axisLookUp():Double { 119 | //return GWorld.GetPlayerController(0).GetInputAxisValue("LookUp").toDouble() 120 | return -GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaY.toDouble() 121 | } 122 | 123 | } 124 | 125 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/adventure/InteractionManager.kt: -------------------------------------------------------------------------------- 1 | package examples.adventure 2 | 3 | import kotlinx.coroutines.CoroutineScope 4 | import kotlinx.coroutines.Dispatchers 5 | import kotlinx.coroutines.Job 6 | import kotlinx.coroutines.launch 7 | 8 | 9 | object InteractionManager: CoroutineScope { 10 | private val nullInteractiveObject = object:InteractiveObject{} 11 | 12 | var selected:InteractiveObject = nullInteractiveObject 13 | 14 | fun select(interactiveObject: InteractiveObject) { 15 | launch { 16 | job.join() 17 | selected.highlight(false) 18 | selected = interactiveObject.apply { highlight(true) } 19 | } 20 | } 21 | 22 | fun release(interactiveObject: InteractiveObject) { 23 | launch { 24 | job.join() 25 | interactiveObject.highlight(false) 26 | if (selected == interactiveObject) selected = nullInteractiveObject 27 | } 28 | } 29 | 30 | private var job: Job = Job().apply { complete() } 31 | fun interact() { 32 | if(job.isActive || selected == nullInteractiveObject) return 33 | job = launch { 34 | selected.doAction() 35 | } 36 | } 37 | override val coroutineContext = Dispatchers.Default 38 | } 39 | 40 | interface InteractiveObject { 41 | fun highlight(enable:Boolean) {} 42 | suspend fun doAction() {} 43 | } 44 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/adventure/InteractiveChest.kt: -------------------------------------------------------------------------------- 1 | import kotlinx.coroutines.delay 2 | import ue.* 3 | 4 | external class InteractiveChestBlueprint:Actor{ 5 | val Top:SceneComponent 6 | val Sequence:LevelSequence 7 | } 8 | 9 | class InteractiveChest: InteractiveObjectBase() { 10 | val actor = GetOwner() 11 | var opened = false 12 | var sequencePlayed = false 13 | override suspend fun doAction() { 14 | if(!sequencePlayed) { 15 | sequencePlayed = true 16 | playSequence(actor.Sequence) 17 | } 18 | (if(opened) (-110..0) else (0 downTo -110)).forEach { 19 | actor.Top.SetRelativeRotation(Rotator(0, it,0), false) 20 | delay(16) 21 | } 22 | opened = !opened 23 | } 24 | 25 | private fun playSequence(sequence:LevelSequence){ 26 | val settings = MovieSceneSequencePlaybackSettings().apply { 27 | bDisableMovementInput = true 28 | bDisableLookAtInput = true 29 | } 30 | LevelSequencePlayer.CreateLevelSequencePlayer(GWorld, sequence, settings).OutActor.apply { 31 | SequencePlayer.Play() 32 | SequencePlayer.OnFinished.Add { DestroyActor() } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/adventure/InteractiveCube.kt: -------------------------------------------------------------------------------- 1 | import kotlinx.coroutines.delay 2 | import ue.* 3 | 4 | external class InteractiveCubeBlueprint:Actor{ 5 | val Texts:Array 6 | val Widget:UserWidget 7 | } 8 | 9 | external class SubtitlesWidget:UserWidget{ 10 | fun SetText(text:String) 11 | } 12 | 13 | class InteractiveCube:InteractiveObjectBase() { 14 | val actor = GetOwner() 15 | 16 | override suspend fun doAction() { 17 | val widget:SubtitlesWidget = GWorld.CreateWidget(actor.Widget, GWorld.GetPlayerController(0)).asDynamic() 18 | with(widget) { 19 | AddToViewport(0) 20 | actor.Texts.forEach { 21 | SetText(it) 22 | delay(2000) 23 | } 24 | RemoveFromViewport() 25 | DestroyUObject() 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/adventure/InteractiveObjectBase.kt: -------------------------------------------------------------------------------- 1 | import examples.adventure.InteractionManager 2 | import examples.adventure.InteractiveObject 3 | import ue.* 4 | 5 | abstract class InteractiveObjectBase: KotlinObject(), InteractiveObject { 6 | private val meshes = GetOwner().GetComponentsByClass(StaticMeshComponent) 7 | 8 | override fun highlight(enable:Boolean) = meshes.forEach { it.SetRenderCustomDepth(enable) } 9 | 10 | override fun BeginOverlap(other: Actor): String { 11 | InteractionManager.select(this) 12 | return "" 13 | } 14 | 15 | override fun EndOverlap(other: Actor) { 16 | InteractionManager.release(this) 17 | } 18 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/blueprint/HelloBlueprint.kt: -------------------------------------------------------------------------------- 1 | import KotlinObject 2 | import ue.* 3 | 4 | external class HelloBlueprintBlueprint:Actor { 5 | val ActorToSpawn:UClass 6 | } 7 | 8 | class HelloBlueprint:KotlinObject() { 9 | var actor: Actor 10 | var yaw = 0.0 11 | 12 | init { 13 | val owner = GetOwner() 14 | actor = Root.Spawn(owner.ActorToSpawn,Vector( X=1 ),Rotator( Yaw=yaw )) 15 | } 16 | 17 | override fun Tick(deltaTime:Float) { 18 | yaw += 100.0 * deltaTime 19 | actor.SetActorRotation(Rotator(Yaw = yaw), false) 20 | } 21 | 22 | override fun BeginOverlap(other:Actor):String { 23 | return "" 24 | } 25 | 26 | override fun OnDestroyed() { 27 | println("OnDestroyed") 28 | } 29 | 30 | fun cleanup() { 31 | console.log("<<>>") 32 | actor.DestroyActor() 33 | } 34 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/blueprint/HelloBlueprints.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | import kotlin.random.Random 3 | 4 | class HelloBlueprints:KotlinObject() { 5 | val WIDTH = 400.0 6 | val actorList = arrayListOf() 7 | val owner = GetOwner() 8 | 9 | init { 10 | for (i in 0..10) 11 | actorList.add(createActor(rnd(-WIDTH, WIDTH),rnd(-WIDTH, WIDTH),rnd(0.0,360.0))) 12 | } 13 | 14 | fun rnd(min:Double, max:Double):Double{ 15 | return min+ Random.nextDouble()*(max-min) 16 | } 17 | 18 | fun createActor(x:Double, y:Double, yaw:Number):Actor { 19 | return Root.Spawn(owner.ActorToSpawn, Vector( X=x, Y=y ),Rotator( Yaw=yaw )).apply { 20 | //AddActorLocalRotation doesn't work without setting local rotation first 21 | SetActorRotation(Rotator(Yaw = yaw), false) 22 | } 23 | } 24 | 25 | override fun Tick(deltaTime:Float) { 26 | actorList.forEach { 27 | it.AddActorLocalRotation(Rotator(Yaw = 1),false) 28 | } 29 | } 30 | 31 | fun cleanup() { 32 | console.log("<<>>") 33 | actorList.forEach { it.DestroyActor() } 34 | } 35 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/bunnymark/BunnyMark.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | import kotlin.random.Random.Default.nextFloat 3 | import kotlin.random.Random.Default.nextInt 4 | 5 | class Bunny: KotlinObject() { 6 | companion object 7 | { 8 | val maxX = 800f 9 | val minX = 0f 10 | val maxY = 668f 11 | val minY = 0f 12 | val gravity = 0.5f // 1.5f 13 | } 14 | 15 | val actor = GetOwner() 16 | 17 | var speedXf: Float = 0f 18 | var speedYf: Float = 0f 19 | 20 | var xf: Float = 0f 21 | var yf: Float = 0f 22 | var zf: Float = 0f 23 | 24 | val pos = Vector(xf, yf, zf) 25 | 26 | init { 27 | yf = nextInt(20) * 40f 28 | speedXf = nextFloat() * 10 29 | speedYf = (nextFloat() * 10) - 5 30 | } 31 | 32 | override fun Tick(deltaTime:Float) { 33 | xf += speedXf 34 | zf -= speedYf 35 | speedYf += gravity 36 | 37 | if (xf > maxX) { 38 | speedXf *= -1 39 | xf = maxX 40 | } else if (xf < minX) { 41 | speedXf *= -1 42 | xf = minX 43 | } 44 | 45 | if (zf < minY) { 46 | speedYf *= -0.85f 47 | zf = minY 48 | if (nextFloat() > 0.5) { 49 | speedYf -= nextFloat() * 6 50 | } 51 | } else if (zf > maxY) { 52 | speedYf = 0f 53 | zf = maxY 54 | } 55 | 56 | pos.X = xf 57 | pos.Y = yf 58 | pos.Z = zf 59 | actor.SetActorLocation(pos, false) 60 | } 61 | } 62 | 63 | external class BunnyMarkBlueprint:Actor{ 64 | val KotlinBunny:UClass 65 | val BlueprintBunny:UClass 66 | val KotlinOptimizedBunny:UClass 67 | } 68 | 69 | class BunnyMark: KotlinObject() { 70 | val actorList = arrayListOf() 71 | val owner = GetOwner() 72 | 73 | val keySpawnKoltinBunny = KeyListener("K") 74 | val keySpawnBlueprintBunny = KeyListener("B") 75 | val keySpawnKotlinOptimizedBunny = KeyListener("O") 76 | 77 | var spawnedBunnies = 0 78 | 79 | fun spawnBunnies(type:UClass) { 80 | for (i in 1..10) 81 | createActor(type) 82 | spawnedBunnies += 10 83 | println("Bunnies: ${spawnedBunnies}") 84 | } 85 | 86 | fun spawnOptimizedBunnies(type:UClass) { 87 | for (i in 1..10) 88 | actorList.add(OptimizedBunny(createActor(type))) 89 | println("Bunnies: ${actorList.size}") 90 | } 91 | 92 | fun createActor(type:UClass):Actor { 93 | return Root.Spawn(type, Vector(),Rotator()) 94 | } 95 | 96 | override fun Tick(deltaTime:Float) { 97 | if(keySpawnKoltinBunny.pressed()){ 98 | spawnBunnies(owner.KotlinBunny) 99 | } 100 | if(keySpawnBlueprintBunny.pressed()){ 101 | spawnBunnies(owner.BlueprintBunny) 102 | } 103 | if(keySpawnKotlinOptimizedBunny.pressed()){ 104 | spawnOptimizedBunnies(owner.KotlinOptimizedBunny) 105 | } 106 | 107 | actorList.forEach { 108 | it.Tick(deltaTime) 109 | } 110 | } 111 | } 112 | 113 | 114 | class OptimizedBunny(val actor: Actor) { 115 | companion object 116 | { 117 | val maxX = 800f 118 | val minX = 0f 119 | val maxY = 668f 120 | val minY = 0f 121 | val gravity = 0.5f // 1.5f 122 | } 123 | 124 | var speedXf: Float = 0f 125 | var speedYf: Float = 0f 126 | 127 | var xf: Float = 0f 128 | var yf: Float = 0f 129 | var zf: Float = 0f 130 | 131 | val pos = Vector(xf, yf, zf) 132 | 133 | init { 134 | yf = nextInt(20) * 40f 135 | speedXf = nextFloat() * 10 136 | speedYf = (nextFloat() * 10) - 5 137 | } 138 | 139 | fun Tick(deltaTime: Float) { 140 | xf += speedXf 141 | zf -= speedYf 142 | speedYf += gravity 143 | 144 | if (xf > maxX) { 145 | speedXf *= -1 146 | xf = maxX 147 | } else if (xf < minX) { 148 | speedXf *= -1 149 | xf = minX 150 | } 151 | 152 | if (zf < minY) { 153 | speedYf *= -0.85f 154 | zf = minY 155 | if (nextFloat() > 0.5) { 156 | speedYf -= nextFloat() * 6 157 | } 158 | } else if (zf > maxY) { 159 | speedYf = 0f 160 | zf = maxY 161 | } 162 | 163 | pos.X = xf 164 | pos.Y = yf 165 | pos.Z = zf 166 | actor.SetActorLocation(pos, false) 167 | } 168 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/cubes/RedRotatingCube.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class RedRotatingCube: KotlinObject() { 4 | 5 | var touched = 0 6 | 7 | override fun Tick(deltaTime: Float) { 8 | val actor = GetOwner() 9 | with(actor){ 10 | if (actorToCopy != null) { 11 | SetActorRotation(Rotator(Yaw = actorToCopy!!.Yaw), false) 12 | } 13 | } 14 | } 15 | 16 | override fun BeginOverlap(other:Actor): String { 17 | touched++ 18 | 19 | if(touched>30) { 20 | return "die" 21 | } 22 | return "touched $touched times by ${other.GetName()}" 23 | } 24 | 25 | override fun OnDestroyed() { 26 | println("OnDestroyed") 27 | } 28 | 29 | fun cleanup(): Unit { 30 | console.log("<<>>") 31 | } 32 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/cubes/RotatingCubeActor.kt: -------------------------------------------------------------------------------- 1 | import ue.Actor 2 | 3 | external class RotatingCubeActor: Actor { 4 | var Yaw:Float 5 | var Speed:Float 6 | var actorToCopy: RotatingCubeActor? 7 | } 8 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/cubes/WhiteRotatingCube.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class WhiteRotatingCube: KotlinObject() { 4 | 5 | var touched = 0 6 | var acumulatedDeltaTime = 0.0 7 | 8 | override fun Tick(deltaTime:Float) { 9 | acumulatedDeltaTime += deltaTime 10 | val actor = GetOwner() 11 | actor.Yaw += actor.Speed * deltaTime * 4 12 | actor.SetActorRotation(Rotator(Yaw = actor.Yaw), false) 13 | } 14 | 15 | override fun BeginOverlap(other:Actor):String { 16 | touched++ 17 | return "touched $touched times" 18 | } 19 | 20 | override fun OnDestroyed() { 21 | println("OnDestroyed") 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/firstperson/FirstPerson.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | external class FirstPersonBlueprint:Actor { 4 | val FirstPerson_BP:UClass 5 | val SK_Mannequin_Arms:SkeletalMesh 6 | val SK_FPGun:SkeletalMesh 7 | val FirstPerson_AnimBP:AnimBlueprint 8 | val FirstPersonFire_Montage:AnimMontage 9 | val FirstPersonTemplateWeaponFire02:SoundBase 10 | } 11 | 12 | class FirstPerson:KotlinObject() { 13 | val actor:Character 14 | 15 | val myCamera:CameraComponent /*EditAnywhere+CameraComponent*/ 16 | val myFPMesh:SkeletalMeshComponent /*EditAnywhere+SkeletalMeshComponent*/ 17 | val myFPGunMesh:SkeletalMeshComponent /*EditAnywhere+SkeletalMeshComponent*/ 18 | 19 | val fireSound:SoundBase /*EditAnywhere+SoundBase*/ 20 | val fireAnimation:AnimMontage /*EditAnywhere+AnimMontage*/ 21 | 22 | val gunOffset:Vector /*EditAnywhere+Vector*/ 23 | var weaponRange:Double = 0.0 /*EditAnywhere+float*/ 24 | var weaponDamage:Double = 0.0 /*EditAnywhere+float*/ 25 | 26 | var yaw = 180.0 27 | 28 | val keyLeft = KeyListener("A") 29 | val keyRight = KeyListener("D") 30 | val keyUp = KeyListener("W") 31 | val keyDown = KeyListener("S") 32 | val keyJump = KeyListener("SpaceBar") 33 | val keyFire = KeyListener("LeftMouseButton") 34 | 35 | init { 36 | val owner = GetOwner() 37 | 38 | actor = Root.Spawn(owner.FirstPerson_BP,Vector(), Rotator()) 39 | //Set size for collision capsule 40 | actor.CapsuleComponent.CapsuleRadius = 42.0 41 | actor.CapsuleComponent.CapsuleHalfHeight = 96.0 42 | //this.CapsuleComponent.bVisible = true 43 | //this.CapsuleComponent.bHiddenInGame = false 44 | 45 | // Create a CameraComponent named 'FP_Camera' 46 | //val tempCamera = CameraComponent.CreateDefaultSubobject("FP_Camera") 47 | myCamera = actor.GetComponentByClass(CameraComponent) as CameraComponent 48 | //attach 'FP_Camera' to capsule 49 | myCamera.AttachParent = actor.CapsuleComponent 50 | //change relative location 51 | myCamera.RelativeLocation = Vector(0, 0, 64) 52 | // Camera rotate the myFirstPerson character? 53 | myCamera.bUsePawnControlRotation = true 54 | 55 | //create first person mesh 56 | //val tempFPMesh = SkeletalMeshComponent.CreateDefaultSubobject("FP_Mesh") 57 | myFPMesh = actor.GetComponentByName(SkeletalMeshComponent, "Mesh2P") 58 | 59 | //make only owner can see first person arms, turn off shadows 60 | myFPMesh.bOnlyOwnerSee = true 61 | myFPMesh.AttachParent = myCamera 62 | myFPMesh.bCastDynamicShadow = false 63 | myFPMesh.CastShadow = false 64 | //initialize first person position and rotation to look right 65 | myFPMesh.RelativeLocation = Vector(0, -4, -156) 66 | myFPMesh.RelativeRotation = Rotator(5, 2, -20) 67 | 68 | //create gun mesh component 69 | //val tempFPGunMesh = SkeletalMeshComponent.CreateDefaultSubobject("FPGun_Mesh") 70 | myFPGunMesh = actor.GetComponentByName(SkeletalMeshComponent, "FP_Gun") 71 | //make only owner can see first person gun, turn off shadows 72 | //in first person shooter game there is another mesh usually called 3rd person mesh 73 | //the 3rd person mesh is what is shown in game to other players 74 | myFPGunMesh.bOnlyOwnerSee = true 75 | myFPGunMesh.bCastDynamicShadow = false 76 | myFPGunMesh.CastShadow = false 77 | myFPGunMesh.AttachParent = myFPMesh 78 | myFPGunMesh.AttachSocketName = "GripPoint" 79 | 80 | //load assets from editor. REQUIRE assets from FirstPerson Blueprint template 81 | val FP_mesh = owner.SK_Mannequin_Arms //SkeletalMesh.Load("/Game/FirstPerson/Character/Mesh/SK_Mannequin_Arms.SK_Mannequin_Arms") 82 | val FPGun_mesh = owner.SK_FPGun //SkeletalMesh.Load("/Game/FirstPerson/FPWeapon/Mesh/SK_FPGun.SK_FPGun") 83 | val ANI_AnimationBP = owner.FirstPerson_AnimBP.GeneratedClass //AnimBlueprint.Load("/Game/FirstPerson/Animations/FirstPerson_animBP.FirstPerson_AnimBP").GeneratedClass 84 | fireSound = owner.FirstPersonTemplateWeaponFire02 //SoundBase.Load("/Game/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.FirstPersonTemplateWeaponFire02") 85 | fireAnimation = owner.FirstPersonFire_Montage //AnimMontage.Load("/Game/FirstPerson/Animations/FirstPersonFire_Montage.FirstPersonFire_Montage") 86 | 87 | //set loaded assets into class mesh 88 | myFPMesh.SetSkeletalMesh(FP_mesh, false) 89 | myFPGunMesh.SetSkeletalMesh(FPGun_mesh, false) 90 | 91 | //set loaded animation blueprint into class 92 | myFPMesh.SetAnimInstanceClass(ANI_AnimationBP) 93 | 94 | //initialize weapon properties data 95 | weaponRange = 5000.0 96 | weaponDamage = 500000.0 97 | gunOffset = Vector(100, 30, 10) 98 | 99 | //Create a wall of cubes just for fun 100 | createWall() 101 | 102 | val myPlayerController = GWorld.GetPlayerController(0) 103 | //possess the MyThirdPerson character that just spawned 104 | myPlayerController.Possess(actor) 105 | } 106 | 107 | override fun Tick(deltaTime:Float) { 108 | if(keyLeft.down()) { 109 | MoveRight(-1.0) 110 | } 111 | if(keyRight.down()) { 112 | MoveRight(1.0) 113 | } 114 | if(keyUp.down()) { 115 | MoveForward(1.0) 116 | } 117 | if(keyDown.down()) { 118 | MoveForward(-1.0) 119 | } 120 | if(keyJump.pressed()) { 121 | startJump() 122 | } 123 | if(keyJump.released()) { 124 | stopJump() 125 | } 126 | if(keyFire.pressed()) { 127 | onFire() 128 | } 129 | Turn(axisTurn()) 130 | LookUp(axisLookUp()) 131 | } 132 | 133 | fun Turn(value:Double) 134 | { 135 | //add Turn value to controller yaw input 136 | actor.AddControllerYawInput(value) 137 | } 138 | 139 | fun LookUp(value:Double) 140 | { 141 | //add LookUp value to controller pitch input 142 | actor.AddControllerPitchInput(value) 143 | } 144 | fun MoveForward(value:Double ) 145 | { 146 | //get pawn control rotation 147 | val tPawnRotator = actor.GetControlRotation() 148 | 149 | //zero out roll and pitch, leaving yaw untouched 150 | tPawnRotator.Pitch = 0 151 | tPawnRotator.Roll = 0 152 | 153 | //find forward vector from rotation 154 | val tForwardVector = tPawnRotator.GetForwardVector() 155 | 156 | //move pawn forward (value > 0) or backward(value < 0) 157 | actor.AddMovementInput(tForwardVector, value, false) 158 | } 159 | 160 | fun MoveRight(value:Double) 161 | { 162 | //get pawn control rotation 163 | val tPawnRotator = actor.GetControlRotation() 164 | 165 | //zero out roll and pitch, leaving yaw untouched 166 | tPawnRotator.Pitch = 0 167 | tPawnRotator.Roll = 0 168 | 169 | //find right vector from rotation 170 | val tRightVector = tPawnRotator.GetRightVector() 171 | 172 | //move pawn right (value > 0) or left (value < 0) 173 | actor.AddMovementInput(tRightVector, value, false) 174 | } 175 | 176 | fun startJump() 177 | { 178 | //execute Jump function from base Character class 179 | actor.Jump() 180 | } 181 | 182 | fun stopJump() 183 | { 184 | //execute StopJumping function from base Character class 185 | actor.StopJumping() 186 | } 187 | 188 | fun onFire() /*ActionBinding[Fire, IE_Pressed]*/ 189 | { 190 | console.log("shooting projectile") 191 | 192 | // Play a sound if there is one 193 | GWorld.PlaySoundAtLocation(fireSound, actor.GetActorLocation(), Rotator(0,0,0), 1, 1, 0, fireSound.AttenuationSettings, fireSound.SoundConcurrencySettings, actor) 194 | 195 | 196 | // try and play a firing animation if specified 197 | val tempAnimInstance = this.myFPMesh.GetAnimInstance(); 198 | tempAnimInstance.Montage_Play(this.fireAnimation, 1, "MontageLength", 0, true) 199 | 200 | 201 | //simplified raytrace, trace from player camera straight forward by weaponRange (5000 cm) 202 | //cast this.myCamera into CameraComponent for autocomplete features in Visual Studio Code 203 | val tempCamera = CameraComponent.C(this.myCamera) 204 | 205 | //get camera world location 206 | val tempStartTrace = tempCamera.GetWorldLocation() 207 | 208 | //end location is start location + weaponrange(5000 cm) unit forward 209 | val tempForwardDirection = tempCamera.GetWorldRotation().GetForwardVector() 210 | val tempOffset = tempForwardDirection.Multiply_VectorFloat(this.weaponRange) 211 | val tempEndTrace = Vector.Add_VectorVector(tempStartTrace, tempOffset) 212 | 213 | //console.log(tempStartTrace.ToString(), " + ", tempOffset.ToString(), " = ", tempEndTrace.ToString()) 214 | 215 | //create a HitResult to store trace result 216 | val tempHitResult = HitResult() 217 | 218 | //line trace and return result into tempHitResult 219 | //'TraceTypeQuery1' is the 'Visibility' channel 220 | //'TraceTypeQuery2' is the 'Camera' channel 221 | GWorld.LineTraceByChannel(tempStartTrace, tempEndTrace, "TraceTypeQuery2", false, arrayOf(actor), "ForDuration", tempHitResult, true, LinearColor(1, 0, 0), LinearColor(1, 0, 0), 3) 222 | 223 | //console.log("hitresult = ", tempHitResult.bBlockingHit) 224 | 225 | //store hit actor and component from HitResult 226 | //val damageActor = tempHitResult.Actor //Actor is null in Unreal 5.0.0? 227 | val damageActor = tempHitResult.HitObjectHandle.Actor 228 | 229 | val damageComponent:PrimitiveComponent? = tempHitResult.Component.asDynamic() 230 | 231 | //if actor&component is valid while simulating physic then apply physic impulse 232 | if (damageActor != null && damageComponent != null && damageComponent.IsSimulatingPhysics("")) 233 | { 234 | //console.log("Hitting a physic enabled actor = ", damageActor, ", of component = ", damageComponent.ToString(), "at location =>", tempHitResult.ImpactPoint.ToString()) 235 | 236 | //calculate physic impulse from this.weaponDamage 237 | val tempImpulseVector = tempForwardDirection.Multiply_VectorFloat(this.weaponDamage) 238 | 239 | //apply physic impulse 240 | damageComponent.AddImpulseAtLocation(tempImpulseVector, tempHitResult.ImpactPoint, "") 241 | } 242 | //in a real game, a gun trace would require 2 traces, 243 | //1st trace start from the camera and extend x distance forward. The goal is to check if player can hit anything, 244 | //the 2nd trace is from the muzzle of the gun to the hit location, just to make sure nothing is between the gun muzzle to hit location 245 | 246 | } 247 | 248 | fun cleanup() { 249 | console.log("<<>>") 250 | actor.DestroyActor() 251 | } 252 | 253 | fun axisTurn():Double { 254 | //return GWorld.GetPlayerController(0).GetInputAxisValue("Turn").toDouble() 255 | return GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaX.toDouble() 256 | } 257 | fun axisLookUp():Double { 258 | //return GWorld.GetPlayerController(0).GetInputAxisValue("LookUp").toDouble() 259 | return -GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaY.toDouble() 260 | } 261 | 262 | fun createWall(){ 263 | for(y in 0..9){ 264 | for (z in 0..3){ 265 | createCube(Vector(450.0, -450.0 + y *100, 70 + z * 100)) 266 | } 267 | } 268 | } 269 | 270 | fun createCube(position:Vector):Actor { 271 | val bp = Blueprint.Load("/Game/CubeBP") 272 | bp.GeneratedClass 273 | return bp.GenerateClass(GWorld, position, Rotator()) 274 | } 275 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/game/Game.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | external class FirstPersonGameBlueprint:Actor { 4 | val FirstPerson_BP:UClass 5 | val SK_Mannequin_Arms:SkeletalMesh 6 | val SK_FPGun:SkeletalMesh 7 | val FirstPerson_AnimBP:AnimBlueprint 8 | val FirstPersonFire_Montage:AnimMontage 9 | val FirstPersonTemplateWeaponFire02:SoundBase 10 | val CubeBP:UClass 11 | val AIKubeController:UClass 12 | val CubeAI:UClass 13 | } 14 | 15 | class Game:KotlinObject() { 16 | val actor:Character 17 | 18 | val myCamera:CameraComponent /*EditAnywhere+CameraComponent*/ 19 | val myFPMesh:SkeletalMeshComponent /*EditAnywhere+SkeletalMeshComponent*/ 20 | val myFPGunMesh:SkeletalMeshComponent /*EditAnywhere+SkeletalMeshComponent*/ 21 | 22 | val fireSound:SoundBase /*EditAnywhere+SoundBase*/ 23 | val fireAnimation:AnimMontage /*EditAnywhere+AnimMontage*/ 24 | 25 | val gunOffset:Vector /*EditAnywhere+Vector*/ 26 | var weaponRange:Double = 0.0 /*EditAnywhere+float*/ 27 | var weaponDamage:Double = 0.0 /*EditAnywhere+float*/ 28 | 29 | var yaw = 180.0 30 | 31 | val keyLeft = KeyListener("A") 32 | val keyRight = KeyListener("D") 33 | val keyUp = KeyListener("W") 34 | val keyDown = KeyListener("S") 35 | val keyJump = KeyListener("SpaceBar") 36 | val keyFire = KeyListener("LeftMouseButton") 37 | 38 | val owner = GetOwner() 39 | init { 40 | actor = Root.Spawn(owner.FirstPerson_BP,Vector(), Rotator()) 41 | //Set size for collision capsule 42 | actor.CapsuleComponent.CapsuleRadius = 42.0 43 | actor.CapsuleComponent.CapsuleHalfHeight = 96.0 44 | //this.CapsuleComponent.bVisible = true 45 | //this.CapsuleComponent.bHiddenInGame = false 46 | 47 | // Create a CameraComponent named 'FP_Camera' 48 | //val tempCamera = CameraComponent.CreateDefaultSubobject("FP_Camera") 49 | myCamera = actor.GetComponentByClass(CameraComponent) as CameraComponent 50 | //attach 'FP_Camera' to capsule 51 | myCamera.AttachParent = actor.CapsuleComponent 52 | //change relative location 53 | myCamera.RelativeLocation = Vector(0, 0, 64) 54 | // Camera rotate the myFirstPerson character? 55 | myCamera.bUsePawnControlRotation = true 56 | 57 | //create first person mesh 58 | //val tempFPMesh = SkeletalMeshComponent.CreateDefaultSubobject("FP_Mesh") 59 | myFPMesh = actor.GetComponentByName(SkeletalMeshComponent, "Mesh2P") 60 | 61 | //make only owner can see first person arms, turn off shadows 62 | myFPMesh.bOnlyOwnerSee = true 63 | myFPMesh.AttachParent = myCamera 64 | myFPMesh.bCastDynamicShadow = false 65 | myFPMesh.CastShadow = false 66 | //initialize first person position and rotation to look right 67 | myFPMesh.RelativeLocation = Vector(0, -4, -156) 68 | myFPMesh.RelativeRotation = Rotator(5, 2, -20) 69 | 70 | //create gun mesh component 71 | //val tempFPGunMesh = SkeletalMeshComponent.CreateDefaultSubobject("FPGun_Mesh") 72 | myFPGunMesh = actor.GetComponentByName(SkeletalMeshComponent, "FP_Gun") 73 | //make only owner can see first person gun, turn off shadows 74 | //in first person shooter game there is another mesh usually called 3rd person mesh 75 | //the 3rd person mesh is what is shown in game to other players 76 | myFPGunMesh.bOnlyOwnerSee = true 77 | myFPGunMesh.bCastDynamicShadow = false 78 | myFPGunMesh.CastShadow = false 79 | myFPGunMesh.AttachParent = myFPMesh 80 | myFPGunMesh.AttachSocketName = "GripPoint" 81 | 82 | //load assets from editor. REQUIRE assets from FirstPerson Blueprint template 83 | val FP_mesh = owner.SK_Mannequin_Arms //SkeletalMesh.Load("/Game/FirstPerson/Character/Mesh/SK_Mannequin_Arms.SK_Mannequin_Arms") 84 | val FPGun_mesh = owner.SK_FPGun //SkeletalMesh.Load("/Game/FirstPerson/FPWeapon/Mesh/SK_FPGun.SK_FPGun") 85 | val ANI_AnimationBP = owner.FirstPerson_AnimBP //AnimBlueprint.Load("/Game/FirstPerson/Animations/FirstPerson_animBP.FirstPerson_AnimBP").GeneratedClass 86 | fireSound = owner.FirstPersonTemplateWeaponFire02 //SoundBase.Load("/Game/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.FirstPersonTemplateWeaponFire02") 87 | fireAnimation = owner.FirstPersonFire_Montage //AnimMontage.Load("/Game/FirstPerson/Animations/FirstPersonFire_Montage.FirstPersonFire_Montage") 88 | 89 | //set loaded assets into class mesh 90 | myFPMesh.SetSkeletalMesh(FP_mesh, false) 91 | myFPGunMesh.SetSkeletalMesh(FPGun_mesh, false) 92 | 93 | //set loaded animation blueprint into class 94 | myFPMesh.SetAnimInstanceClass(ANI_AnimationBP) 95 | 96 | //initialize weapon properties data 97 | weaponRange = 5000.0 98 | weaponDamage = 500000.0 99 | gunOffset = Vector(100, 30, 10) 100 | 101 | //Create a wall of cubes just for fun 102 | //createWall() 103 | 104 | val myPlayerController = GWorld.GetPlayerController(0) 105 | //possess the MyThirdPerson character that just spawned 106 | myPlayerController.Possess(actor) 107 | } 108 | 109 | override fun Tick(deltaTime:Float) { 110 | if(keyLeft.down()) { 111 | MoveRight(-1.0) 112 | } 113 | if(keyRight.down()) { 114 | MoveRight(1.0) 115 | } 116 | if(keyUp.down()) { 117 | MoveForward(1.0) 118 | } 119 | if(keyDown.down()) { 120 | MoveForward(-1.0) 121 | } 122 | if(keyJump.pressed()) { 123 | startJump() 124 | } 125 | if(keyJump.released()) { 126 | stopJump() 127 | } 128 | if(keyFire.pressed()) { 129 | onFire() 130 | } 131 | Turn(axisTurn()) 132 | LookUp(axisLookUp()) 133 | } 134 | 135 | fun Turn(value:Double) 136 | { 137 | //add Turn value to controller yaw input 138 | actor.AddControllerYawInput(value) 139 | } 140 | 141 | fun LookUp(value:Double) 142 | { 143 | //add LookUp value to controller pitch input 144 | actor.AddControllerPitchInput(value) 145 | } 146 | fun MoveForward(value:Double ) 147 | { 148 | //get pawn control rotation 149 | val tPawnRotator = actor.GetControlRotation() 150 | 151 | //zero out roll and pitch, leaving yaw untouched 152 | tPawnRotator.Pitch = 0 153 | tPawnRotator.Roll = 0 154 | 155 | //find forward vector from rotation 156 | val tForwardVector = tPawnRotator.GetForwardVector() 157 | 158 | //move pawn forward (value > 0) or backward(value < 0) 159 | actor.AddMovementInput(tForwardVector, value, false) 160 | } 161 | 162 | fun MoveRight(value:Double) 163 | { 164 | //get pawn control rotation 165 | val tPawnRotator = actor.GetControlRotation() 166 | 167 | //zero out roll and pitch, leaving yaw untouched 168 | tPawnRotator.Pitch = 0 169 | tPawnRotator.Roll = 0 170 | 171 | //find right vector from rotation 172 | val tRightVector = tPawnRotator.GetRightVector() 173 | 174 | //move pawn right (value > 0) or left (value < 0) 175 | actor.AddMovementInput(tRightVector, value, false) 176 | } 177 | 178 | fun startJump() 179 | { 180 | //execute Jump function from base Character class 181 | actor.Jump() 182 | } 183 | 184 | fun stopJump() 185 | { 186 | //execute StopJumping function from base Character class 187 | actor.StopJumping() 188 | } 189 | 190 | fun onFire() /*ActionBinding[Fire, IE_Pressed]*/ 191 | { 192 | console.log("shooting projectile") 193 | 194 | // Play a sound if there is one 195 | GWorld.PlaySoundAtLocation(fireSound, actor.GetActorLocation(), Rotator(0,0,0), 1, 1, 0, fireSound.AttenuationSettings, fireSound.SoundConcurrencySettings, actor) 196 | 197 | 198 | // try and play a firing animation if specified 199 | val tempAnimInstance = this.myFPMesh.GetAnimInstance(); 200 | tempAnimInstance.Montage_Play(this.fireAnimation, 1, "MontageLength", 0, true) 201 | 202 | 203 | //simplified raytrace, trace from player camera straight forward by weaponRange (5000 cm) 204 | //cast this.myCamera into CameraComponent for autocomplete features in Visual Studio Code 205 | val tempCamera = CameraComponent.C(this.myCamera) 206 | 207 | //get camera world location 208 | val tempStartTrace = tempCamera.GetWorldLocation() 209 | 210 | //end location is start location + weaponrange(5000 cm) unit forward 211 | val tempForwardDirection = tempCamera.GetWorldRotation().GetForwardVector() 212 | val tempOffset = tempForwardDirection.Multiply_VectorFloat(this.weaponRange) 213 | val tempEndTrace = Vector.Add_VectorVector(tempStartTrace, tempOffset) 214 | 215 | //console.log(tempStartTrace.ToString(), " + ", tempOffset.ToString(), " = ", tempEndTrace.ToString()) 216 | 217 | //create a HitResult to store trace result 218 | val tempHitResult = HitResult() 219 | 220 | //line trace and return result into tempHitResult 221 | //'TraceTypeQuery1' is the 'Visibility' channel 222 | //'TraceTypeQuery2' is the 'Camera' channel 223 | GWorld.LineTraceByChannel(tempStartTrace, tempEndTrace, "TraceTypeQuery2", false, arrayOf(actor), "ForDuration", tempHitResult, true, LinearColor(1, 0, 0), LinearColor(1, 0, 0), 3) 224 | 225 | //console.log("hitresult = ", tempHitResult.bBlockingHit) 226 | 227 | //store hit actor and component from HitResult 228 | //val damageActor:Actor = tempHitResult.Actor.asDynamic() //Actor is null on Unreal 5? 229 | val damageActor = tempHitResult.HitObjectHandle.Actor 230 | val damageComponent:PrimitiveComponent? = tempHitResult.Component.asDynamic() 231 | 232 | if(damageActor != null && damageActor.GetName().contains("AI")){ 233 | val aiActor:Character = damageActor.asDynamic() 234 | if(!damageComponent!!.IsAnySimulatingPhysics()) { 235 | damageActor.asDynamic().Kill() 236 | val aiController = aiActor.GetAIController() 237 | val actorController = aiActor.GetController() 238 | val movementController = aiActor.GetMovementComponent() 239 | movementController.StopMovementImmediately() 240 | //actorController.UnPossess() 241 | damageComponent.SetSimulatePhysics(true) 242 | //movementController.StopMovementImmediately() 243 | //movementController.Deactivate() 244 | //aiController.K2_DestroyActor() 245 | } 246 | } 247 | 248 | //if actor&component is valid while simulating physic then apply physic impulse 249 | if (damageActor != null && damageComponent != null && damageComponent.IsSimulatingPhysics("")) 250 | { 251 | //console.log("Hitting a physic enabled actor = ", damageActor, ", of component = ", damageComponent.ToString(), "at location =>", tempHitResult.ImpactPoint.ToString()) 252 | 253 | //calculate physic impulse from this.weaponDamage 254 | val tempImpulseVector = tempForwardDirection.Multiply_VectorFloat(this.weaponDamage) 255 | 256 | //apply physic impulse 257 | damageComponent.AddImpulseAtLocation(tempImpulseVector, tempHitResult.ImpactPoint, "") 258 | } 259 | //in a real game, a gun trace would require 2 traces, 260 | //1st trace start from the camera and extend x distance forward. The goal is to check if player can hit anything, 261 | //the 2nd trace is from the muzzle of the gun to the hit location, just to make sure nothing is between the gun muzzle to hit location 262 | 263 | } 264 | 265 | fun cleanup() { 266 | console.log("<<>>") 267 | actor.DestroyActor() 268 | } 269 | 270 | fun axisTurn():Double { 271 | //return GWorld.GetPlayerController(0).GetInputAxisValue("Turn").toDouble() 272 | return GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaX.toDouble() 273 | } 274 | fun axisLookUp():Double { 275 | //return GWorld.GetPlayerController(0).GetInputAxisValue("LookUp").toDouble() 276 | return -GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaY.toDouble() 277 | } 278 | 279 | fun createWall(){ 280 | for(y in 0..9){ 281 | for (z in 0..3){ 282 | createCube(Vector(450.0, -450.0 + y *100, 70 + z * 100)) 283 | } 284 | } 285 | } 286 | 287 | fun createCube(position:Vector):Actor { 288 | return Root.Spawn(owner.CubeBP, Vector(), Rotator()) 289 | } 290 | 291 | 292 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/game/KotlinLogo.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class KotlinLogo: KotlinObject() { 4 | 5 | var yaw = 0.0f 6 | 7 | override fun Tick(deltaTime:Float) { 8 | val actor = GetOwner() 9 | yaw += 100 * deltaTime 10 | actor.SetActorRotation(Rotator(Roll = 90.0, Yaw = yaw), false) 11 | } 12 | 13 | override fun BeginOverlap(other:Actor):String { 14 | spawnAICubes() 15 | GetOwner().DestroyActor() 16 | return "touched" 17 | 18 | } 19 | 20 | val owner = GetOwner() 21 | 22 | fun createAIKube(position: Vector):Character { 23 | return Root.Spawn(owner.AIKubeController, position, Rotator()) 24 | } 25 | 26 | fun createAIController():AIController { 27 | return Root.Spawn(owner.CubeAI, Vector(), Rotator()) 28 | } 29 | 30 | fun spawnAICubes(){ 31 | for(y in 0..7){ 32 | for (z in 0..3){ 33 | createAIKube(Vector(2500.0 + z * 150, -450.0 + y *150, 100)).apply { 34 | createAIController().Possess(this) 35 | } 36 | } 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/game/Pickup.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class Pickup:KotlinObject() { 4 | override fun BeginOverlap(other:Actor): String { 5 | armor++ 6 | GetOwner().DestroyActor() 7 | return "armor +1 -> $armor" 8 | } 9 | 10 | companion object 11 | { 12 | var armor = 0 13 | } 14 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/game/Switch.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | external class SwitchActor: Actor { 4 | var Lock: Actor? 5 | } 6 | 7 | class Switch:KotlinObject() { 8 | override fun BeginOverlap(other: Actor): String { 9 | val actor = GetOwner() 10 | actor.Lock?.DestroyActor() 11 | 12 | val plate = actor.GetComponentByClass(StaticMeshComponent) 13 | val button = actor.GetComponentByName(StaticMeshComponent,"Button") 14 | button.SetRelativeLocation(Vector(X = 0, Y = 20, Z = 0), false) 15 | 16 | plate.SetMaterial(0, button.GetMaterial(0)) 17 | 18 | return "Lock opened" 19 | } 20 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/hello/HelloKotlin.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class HelloKotlin:KotlinObject() { 4 | var yaw = 0.0 5 | var actor: TextRenderActor 6 | 7 | init { 8 | val pos = Vector(X = 100, Z = 100) 9 | val rotator = Rotator(Yaw = yaw) 10 | 11 | actor = TextRenderActor(GWorld, pos, rotator) 12 | 13 | // initialie its text render component 14 | actor.TextRender.SetHorizontalAlignment("EHTA_Center") 15 | actor.TextRender.SetText("Hello Kotlin") 16 | } 17 | 18 | override fun Tick(deltaTime:Float) { 19 | yaw += 100.0 * deltaTime 20 | actor.SetActorRotation(Rotator(Yaw = yaw), false) 21 | } 22 | 23 | override fun BeginOverlap(other:Actor):String { 24 | return "" 25 | } 26 | 27 | override fun OnDestroyed() { 28 | println("OnDestroyed") 29 | } 30 | 31 | fun cleanup() { 32 | console.log("<<>>") 33 | actor.DestroyActor() 34 | } 35 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/inheritance/BaseCylinder.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | open class BaseCylinder: KotlinObject(), ICylinder { 4 | 5 | var deltaTimeAccum = 0.0f 6 | var yaw = 0.0f 7 | 8 | override fun Tick(deltaTime:Float) { 9 | deltaTimeAccum += deltaTime 10 | val actor = GetOwner() 11 | yaw += 100 * deltaTime 12 | actor.SetActorRotation(Rotator(Pitch = yaw), false) 13 | } 14 | 15 | override fun BeginOverlap(other:Actor):String { 16 | return getName() 17 | } 18 | 19 | override fun getName(): String { 20 | return "Base Cylinder" 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/inheritance/CustomCylinder.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class CustomCylinder: BaseCylinder() { 4 | override fun getName(): String { 5 | return "Custom Cylinder" 6 | } 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/inheritance/DelegatedCylinder.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | //Doesn't work :( 4 | class DelegatedCylinder(baseCylinder: BaseCylinder = BaseCylinder()) 5 | : KotlinUnrealObject by baseCylinder, ICylinder by baseCylinder 6 | { 7 | override fun getName(): String { 8 | return "Delegated Cylinder" 9 | } 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/inheritance/ICylinder.kt: -------------------------------------------------------------------------------- 1 | 2 | interface ICylinder { 3 | fun getName():String 4 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/keyboardinput/KeyboardInput.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class KeyboardInput:KotlinObject() { 4 | var actor:Actor 5 | var yaw = 180.0 6 | 7 | val keyLeft = KeyListener("F") 8 | val keyRight = KeyListener("H") 9 | val keyUp = KeyListener("T") 10 | val keyDown = KeyListener("G") 11 | 12 | init { 13 | val bp = Blueprint.Load("/Game/ExampleBlueprint") 14 | actor = bp.GenerateClass(GWorld, 15 | Vector( X=1 ), 16 | Rotator( Yaw=180 )) 17 | } 18 | 19 | override fun Tick(deltaTime:Float) { 20 | yaw += 1.0 21 | actor.SetActorRotation(Rotator(Yaw = yaw), false) 22 | 23 | if(keyLeft.down()) { 24 | actor.AddActorWorldOffset(Vector(Y = -1),false) 25 | } 26 | if(keyRight.down()) { 27 | actor.AddActorWorldOffset(Vector(Y = 1),false) 28 | } 29 | if(keyUp.down()) { 30 | actor.AddActorWorldOffset(Vector(X = 1),false) 31 | } 32 | if(keyDown.down()) { 33 | actor.AddActorWorldOffset(Vector(X = -1),false) 34 | } 35 | } 36 | 37 | fun cleanup() { 38 | console.log("<<>>") 39 | actor.DestroyActor() 40 | } 41 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/scenelights/SceneLights.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | import kotlin.math.cos 3 | import kotlin.math.sin 4 | import kotlin.random.Random 5 | 6 | class SceneLights:KotlinObject() { 7 | var tickable:List<()->Unit> 8 | 9 | init { 10 | 11 | GWorld.GetAllActorsOfClass(Light).OutActors.forEach { it.DestroyActor() } 12 | 13 | tickable = listOf( 14 | rotate(light(LinearColor(R=1)),object{val k=1.8; val r=150;val p = Vector(X=400,Y=-100,Z=100)}), 15 | rotate(light(LinearColor(G=1)),object{val k=1.5; val r=30;val p = Vector(X=400,Z=150)}), 16 | rotate(light(LinearColor(B=1)),object{val k=0.1; val r=230;val p = Vector( X=400, Z=250)}) 17 | ) 18 | bg(Vector(X=400,Z=-150,Y=-100)) 19 | skel(Vector(X=400, Z=0, Y=-150)) 20 | } 21 | 22 | fun light(color:LinearColor):Actor { 23 | val actor = PointLight(GWorld) 24 | actor.LightComponent.SetMobility("Movable") 25 | actor.LightComponent.Intensity = 10000 26 | actor.LightComponent.SetLightColor(color, false) 27 | return actor 28 | } 29 | 30 | fun box(p:Vector, size:Vector, color:LinearColor):Actor { 31 | val actor = StaticMeshActor(GWorld, p) 32 | val smc = actor.StaticMeshComponent 33 | smc.SetMobility("Movable") 34 | smc.SetStaticMesh(StaticMesh.Load("/Engine/BasicShapes/Cube")) 35 | val mtrl = Material.Load("/Game/Color") 36 | val mi = KismetMaterialLibrary.CreateDynamicMaterialInstance(GWorld, mtrl, "", "") 37 | mi.SetVectorParameterValue("color", color) 38 | smc.SetMaterial(0, mi) 39 | actor.SetActorScale3D(size) 40 | return actor 41 | } 42 | 43 | fun bg(p:Vector) { 44 | val size = 1000 45 | val boxsize = 100 46 | val scale = size / boxsize 47 | // back 48 | box(p.Add_VectorVector(Vector(X=size / 2, Z=size / 2 )), Vector(X= 1, Y= scale, Z= scale ), LinearColor( R= 0.5, G= 0.7)) 49 | // left 50 | box(p.Add_VectorVector(Vector(Y=-size / 2, Z=size / 2 )), Vector( X= scale, Y= 1, Z= scale ), LinearColor( B= 1 )) 51 | // floor 52 | box(p, Vector(X= scale, Y= scale, Z= 1 ), LinearColor(R= 1)) 53 | 54 | val N = 10 55 | val s = 0.04 56 | for(y in 0..N){ 57 | for(x in 0..N){ 58 | val a = box(p.Add_VectorVector(Vector(Y=(y.toDouble()-N/2) * 50, Z= x.toDouble() * 50 )), Vector( X= s, Y= s, Z= s ), LinearColor( R= 1, G= 1, B= 1 )) 59 | a.SetActorRotation(Rotator( Yaw= Random.nextDouble() * 360, Pitch=Random.nextDouble() * 180 ), false) 60 | } 61 | } 62 | } 63 | 64 | fun skel(p:Vector) { 65 | val resource = SkeletalMesh.Load("/Game/Mannequin/Character/Mesh/SK_Mannequin") 66 | val actor = SkeletalMeshActor(GWorld, p.Add_VectorVector(Vector( Z= 50 ))) 67 | actor.SkeletalMeshComponent.SetSkeletalMesh(resource, false) 68 | actor.SetActorRotation(Rotator( Yaw = 90 ),false) 69 | } 70 | 71 | fun rotate(actor:Actor, opts:dynamic):()->Unit { 72 | fun tick() { 73 | if (actor.IsValid()) { 74 | val time = GWorld.GetTimeSeconds().toDouble() 75 | val rad: Double = time * opts.k as Double 76 | val r: Double = opts.r 77 | val p = Vector(Y = cos(rad) * r, Z = sin(rad) * r) 78 | .Add_VectorVector(opts.p) 79 | actor.SetActorLocation(p, false) 80 | } 81 | } 82 | return ::tick 83 | } 84 | 85 | override fun Tick(deltaTime:Float) { 86 | tickable.forEach { it() } 87 | } 88 | 89 | fun cleanup() { 90 | GWorld.GetAllActorsOfClass(Light).OutActors.forEach { it.DestroyActor() } 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/examples/thirdperson/ThirdPerson.kt: -------------------------------------------------------------------------------- 1 | import ue.* 2 | 3 | class ThirdPerson:KotlinObject() { 4 | var actor:Character 5 | //var myArm:SpringArmComponent /*EditAnywhere+SpringArmComponent*/ 6 | //var myCamera:CameraComponent /*EditAnywhere+CameraComponent*/ 7 | var yaw = 180.0 8 | 9 | val keyLeft = KeyListener("A") 10 | val keyRight = KeyListener("D") 11 | val keyUp = KeyListener("W") 12 | val keyDown = KeyListener("S") 13 | val keyJump = KeyListener("SpaceBar") 14 | 15 | init { 16 | //actor = Character(GWorld, Vector(), Rotator()) 17 | val bp = Blueprint.Load("/Game/ThirdPersonBP") 18 | actor = bp.GenerateClass(GWorld, 19 | Vector( X=1 ), 20 | Rotator( Yaw=180 )) 21 | //Set size for collision capsule 22 | actor.CapsuleComponent.CapsuleRadius = 42.0 23 | actor.CapsuleComponent.CapsuleHalfHeight = 96.0 24 | //this.CapsuleComponent.bVisible = true 25 | //this.CapsuleComponent.bHiddenInGame = false 26 | 27 | // Don't rotate when the controller rotates. Let that just affect the camera. 28 | actor.bUseControllerRotationPitch = false 29 | actor.bUseControllerRotationRoll = false 30 | actor.bUseControllerRotationYaw = false 31 | 32 | // Configure character movement 33 | actor.CharacterMovement.bOrientRotationToMovement = true // Character moves in the direction of input... 34 | actor.CharacterMovement.RotationRate = Rotator.MakeRotator(0, 0, 540) 35 | actor.CharacterMovement.JumpZVelocity = 600 36 | actor.CharacterMovement.AirControl = 0.2 37 | 38 | // Create a camera boom (pulls in towards the player if there is a collision) 39 | //val tempArm = SpringArmComponent.CreateDefaultSubobject("SpringArm") 40 | /*val tempArm = SpringArmComponent(actor) 41 | //attach spring arm to character capsule. Replace SetupAttachment() 42 | tempArm.AttachParent = actor.CapsuleComponent 43 | // The camera follows at this distance behind the character 44 | tempArm.TargetArmLength = 300.0 45 | // Rotate the arm based on the controller 46 | tempArm.bUsePawnControlRotation = true 47 | //assign spring arm to properties variable 'myArm' for use at runtime 48 | this.myArm = tempArm*/ 49 | 50 | //// Create a follow camera named 'TP_Camera' 51 | //val tempCamera = CameraComponent.CreateDefaultSubobject("TP_Camera") 52 | /*val tempCamera = CameraComponent() 53 | //attach 'TP_Camera' to spring arm 54 | tempCamera.AttachParent = this.myArm 55 | // Camera does not rotate relative to arm 56 | tempCamera.bUsePawnControlRotation = false 57 | //assign camera to properties variable 'myCamera' 58 | this.myCamera = tempCamera*/ 59 | 60 | //We can load asset directly into Java. Can be positive or negative depend on your style 61 | //Load skeletal mesh and animation blueprint from ThirdPerson sample into java 62 | //Require assets from ThirdPerson template either Blueprint or C++ will do 63 | //val SK_mesh = SkeletalMesh.Load("/Game/Mannequin/Character/Mesh/SK_Mannequin.SK_Mannequin") 64 | val ANI_AnimationBP = AnimBlueprint.Load("/Game/Mannequin/Animations/ThirdPerson_AnimBP.ThirdPerson_AnimBP").GeneratedClass 65 | 66 | //set character mesh to the SK_Mannequin 67 | //actor.Mesh.SetSkeletalMesh(SK_mesh, false) 68 | 69 | //set animation class to ThirdPerson_AnimBP 70 | actor.Mesh.SetAnimInstanceClass(ANI_AnimationBP) 71 | 72 | //rotate the skeletal mesh so it is facing front 73 | actor.Mesh.RelativeRotation = Rotator.MakeRotator(0, 0, 270) 74 | 75 | //lower the skeletal mesh to the ground 76 | actor.Mesh.RelativeLocation = Vector.MakeVector(0, 0, -96) 77 | 78 | val myPlayerController = GWorld.GetPlayerController(0) 79 | //possess the MyThirdPerson character that just spawned 80 | myPlayerController.Possess(actor) 81 | } 82 | 83 | override fun Tick(deltaTime:Float) { 84 | if(keyLeft.down()) { 85 | MoveRight(-1.0) 86 | } 87 | if(keyRight.down()) { 88 | MoveRight(1.0) 89 | } 90 | if(keyUp.down()) { 91 | MoveForward(1.0) 92 | } 93 | if(keyDown.down()) { 94 | MoveForward(-1.0) 95 | } 96 | if(keyJump.pressed()) { 97 | startJump() 98 | } 99 | if(keyJump.released()) { 100 | stopJump() 101 | } 102 | Turn(axisTurn()) 103 | LookUp(axisLookUp()) 104 | } 105 | 106 | fun Turn(value:Double) 107 | { 108 | //add Turn value to controller yaw input 109 | actor.AddControllerYawInput(value) 110 | } 111 | 112 | fun LookUp(value:Double) 113 | { 114 | //add LookUp value to controller pitch input 115 | actor.AddControllerPitchInput(value) 116 | } 117 | fun MoveForward(value:Double ) 118 | { 119 | //get pawn control rotation 120 | val tPawnRotator = actor.GetControlRotation() 121 | 122 | //zero out roll and pitch, leaving yaw untouched 123 | tPawnRotator.Pitch = 0 124 | tPawnRotator.Roll = 0 125 | 126 | //find forward vector from rotation 127 | val tForwardVector = tPawnRotator.GetForwardVector() 128 | 129 | //move pawn forward (value > 0) or backward(value < 0) 130 | actor.AddMovementInput(tForwardVector, value, false) 131 | } 132 | 133 | fun MoveRight(value:Double) 134 | { 135 | //get pawn control rotation 136 | val tPawnRotator = actor.GetControlRotation() 137 | 138 | //zero out roll and pitch, leaving yaw untouched 139 | tPawnRotator.Pitch = 0 140 | tPawnRotator.Roll = 0 141 | 142 | //find right vector from rotation 143 | val tRightVector = tPawnRotator.GetRightVector() 144 | 145 | //move pawn right (value > 0) or left (value < 0) 146 | actor.AddMovementInput(tRightVector, value, false) 147 | } 148 | 149 | fun startJump() 150 | { 151 | //execute Jump function from base Character class 152 | actor.Jump() 153 | } 154 | 155 | fun stopJump() 156 | { 157 | //execute StopJumping function from base Character class 158 | actor.StopJumping() 159 | } 160 | 161 | fun cleanup() { 162 | console.log("<<>>") 163 | actor.DestroyActor() 164 | } 165 | 166 | fun axisTurn():Double { 167 | //return GWorld.GetPlayerController(0).GetInputAxisValue("Turn").toDouble() 168 | return GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaX.toDouble() 169 | } 170 | fun axisLookUp():Double { 171 | //return GWorld.GetPlayerController(0).GetInputAxisValue("LookUp").toDouble() 172 | return -GWorld.GetPlayerController(0).GetInputMouseDelta().DeltaY.toDouble() 173 | } 174 | 175 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/init.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by hiperbou on 29/01/2017. 3 | */ 4 | 5 | fun init():Function{ 6 | println("<<>>") 7 | return ::cleanup 8 | } 9 | 10 | fun cleanup() { 11 | println("<<>>") 12 | } -------------------------------------------------------------------------------- /kotlin-examples/src/main/kotlin/ueExtensions.kt: -------------------------------------------------------------------------------- 1 | package ue 2 | 3 | /** 4 | * Created by hiperbou on 29/01/2017. 5 | */ 6 | fun Blueprint.GenerateClass(world: World, position: Vector, rotation: Rotator):T{ 7 | //return GeneratedClass(world,position,rotation) as T 8 | //return js("new \$receiver_0.GeneratedClass(world, position, rotation)") 9 | val receiver = this 10 | return js("new receiver.GeneratedClass(world, position, rotation)") 11 | } 12 | 13 | fun MovieSceneSpawnable.GenerateClass(world: World, position: Vector, rotation: Rotator):T{ 14 | //return GeneratedClass(world,position,rotation) as T 15 | val receiver = this 16 | return js("new receiver.GeneratedClass(world, position, rotation)") 17 | } 18 | 19 | 20 | fun Vector(X:Number=0.0,Y:Number=0.0,Z:Number=0.0):Vector { 21 | return ue.Vector().apply { this.X=X.toDouble(); this.Y=Y.toDouble(); this.Z=Z.toDouble() } 22 | } 23 | 24 | inline fun Vector.withX(X:Number = 0.0) = Vector(X, Y, Z) 25 | inline fun Vector.withY(Y:Number = 0.0) = Vector(X, Y, Z) 26 | inline fun Vector.withZ(Z:Number = 0.0) = Vector(X, Y, Z) 27 | 28 | fun LinearColor(R:Number=0.0, G:Number=0.0, B:Number=0.0, A:Number=1.0):LinearColor { 29 | return ue.LinearColor().apply { this.R=R; this.G=G; this.B=B ; this.A=A } 30 | } 31 | 32 | inline fun LinearColor.withR(R:Number = 0.0) = LinearColor(R, G, B, A) 33 | inline fun LinearColor.withG(G:Number = 0.0) = LinearColor(R, G, B, A) 34 | inline fun LinearColor.withB(B:Number = 0.0) = LinearColor(R, G, B, A) 35 | inline fun LinearColor.withA(A:Number = 0.0) = LinearColor(R, G, B, A) 36 | 37 | fun Rotator(Roll:Number=0.0,Pitch:Number=0.0,Yaw:Number=0.0):Rotator { 38 | return ue.Rotator().apply { this.Pitch=Pitch; this.Roll=Roll; this.Yaw=Yaw } 39 | } 40 | 41 | inline fun Rotator.withRoll(Roll:Number = 0.0) = Rotator(Roll, Pitch, Yaw) 42 | inline fun Rotator.withPitch(Pitch:Number = 0.0) = Rotator(Roll, Pitch, Yaw) 43 | inline fun Rotator.withYaw(Yaw:Number = 0.0) = Rotator(Roll, Pitch, Yaw) 44 | 45 | fun SpawnSound2D(WorldContextObject:UObject, Sound:SoundBase)= GameplayStatics.SpawnSound2D( 46 | WorldContextObject, Sound, 47 | 1, 1, 0, undefined.asDynamic(), 48 | false, true) 49 | 50 | 51 | 52 | fun Actor.GetComponentByName(ComponentClass:Any, Name:String):T 53 | { 54 | val nameToCheck = Name.toLowerCase() 55 | val components = GetComponentsByClass(ComponentClass).filter { it.GetName().toLowerCase()==nameToCheck } 56 | if (components.isEmpty()) return null as T 57 | return components.first().asDynamic() 58 | } 59 | 60 | fun Actor.GetComponentByClass(ComponentClass: Any):T{ 61 | return GetComponentByClass(ComponentClass).asDynamic() 62 | } 63 | 64 | fun Actor.GetComponentsByClass(ComponentClass: Any):Array{ 65 | return GetComponentsByClass(ComponentClass).asDynamic() 66 | } 67 | 68 | fun Key(keyName:String):Key = Key().apply { KeyName=keyName } 69 | 70 | class KeyListener(keyName:String, private val playerControllerIndex:Int = 0) { 71 | private val k = Key(keyName) 72 | fun down(): Boolean { 73 | return GWorld.GetPlayerController(playerControllerIndex).IsInputKeyDown(k) 74 | } 75 | 76 | fun pressed(): Boolean { 77 | return GWorld.GetPlayerController(playerControllerIndex).WasInputKeyJustPressed(k) 78 | } 79 | 80 | fun released(): Boolean { 81 | return GWorld.GetPlayerController(playerControllerIndex).WasInputKeyJustReleased(k) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("multiplatform") version "1.7.10" 3 | id("convention.publication") 4 | } 5 | 6 | group = "io.github.hiperbou.ue" 7 | version = "5.0.1" 8 | 9 | repositories { 10 | mavenCentral() 11 | } 12 | 13 | kotlin { 14 | js(LEGACY) { 15 | browser { 16 | } 17 | } 18 | sourceSets { 19 | val jsMain by getting 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/convention-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` // Is needed to turn our build logic written in Kotlin into the Gradle Plugin 3 | } 4 | 5 | repositories { 6 | gradlePluginPortal() // To use 'maven-publish' and 'signing' plugins in our own plugin 7 | } 8 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/convention-plugins/src/main/kotlin/convention.publication.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.gradle.api.publish.maven.MavenPublication 2 | import org.gradle.api.tasks.bundling.Jar 3 | import org.gradle.kotlin.dsl.`maven-publish` 4 | import org.gradle.kotlin.dsl.signing 5 | import java.util.* 6 | 7 | plugins { 8 | `maven-publish` 9 | signing 10 | } 11 | 12 | // Stub secrets to let the project sync and build without the publication values set up 13 | ext["signing.keyId"] = null 14 | ext["signing.password"] = null 15 | ext["signing.secretKeyRingFile"] = null 16 | ext["ossrhUsername"] = null 17 | ext["ossrhPassword"] = null 18 | ext["developer.id"] = null 19 | ext["developer.name"] = null 20 | ext["developer.email"] = null 21 | 22 | // Grabbing secrets from local.properties file or from environment variables, which could be used on CI 23 | val secretPropsFile = project.rootProject.file("local.properties") 24 | if (secretPropsFile.exists()) { 25 | secretPropsFile.reader().use { 26 | Properties().apply { 27 | load(it) 28 | } 29 | }.onEach { (name, value) -> 30 | ext[name.toString()] = value 31 | } 32 | } else { 33 | ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID") 34 | ext["signing.password"] = System.getenv("SIGNING_PASSWORD") 35 | ext["signing.secretKeyRingFile"] = System.getenv("SIGNING_SECRET_KEY_RING_FILE") 36 | ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME") 37 | ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD") 38 | ext["developer.id"] = System.getenv("DEVELOPER_ID") 39 | ext["developer.name"] = System.getenv("DEVELOPER_NAME") 40 | ext["developer.email"] = System.getenv("DEVELOPER_EMAIL") 41 | } 42 | 43 | val javadocJar by tasks.registering(Jar::class) { 44 | archiveClassifier.set("javadoc") 45 | } 46 | 47 | fun getExtraString(name: String) = ext[name]?.toString() 48 | 49 | publishing { 50 | // Configure maven central repository 51 | repositories { 52 | maven { 53 | name = "sonatype" 54 | setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") 55 | //setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/") 56 | credentials { 57 | username = getExtraString("ossrhUsername") 58 | password = getExtraString("ossrhPassword") 59 | } 60 | } 61 | } 62 | 63 | // Configure all publications 64 | publications.withType { 65 | // Stub javadoc.jar artifact 66 | artifact(javadocJar.get()) 67 | 68 | // Provide artifacts information requited by Maven Central 69 | pom { 70 | name.set("kotlin-unreal") 71 | description.set("Kotlin definitions for kotlin-unreal") 72 | url.set("https://github.com/hiperbou/kotlin-unreal") 73 | 74 | licenses { 75 | license { 76 | name.set("MIT") 77 | url.set("https://opensource.org/licenses/MIT") 78 | } 79 | } 80 | developers { 81 | developer { 82 | id.set(getExtraString("developer.id")) 83 | name.set(getExtraString("developer.name")) 84 | email.set(getExtraString("developer.email")) 85 | } 86 | } 87 | scm { 88 | url.set("https://github.com/hiperbou/kotlin-unreal") 89 | } 90 | } 91 | } 92 | } 93 | 94 | // Signing artifacts. Signing.* extra properties values will be used 95 | signing { 96 | sign(publishing.publications) 97 | } -------------------------------------------------------------------------------- /kotlin-unreal-definitions/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | kotlin.js.compiler=ir 3 | kotlin.daemon.jvmargs=-Xmx4g 4 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiperbou/kotlin-unreal/8431df80321c61b76766e38fa7196284407abcaa/kotlin-unreal-definitions/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlin-unreal-definitions/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "kotlin-unreal-definitions" 2 | includeBuild("convention-plugins") 3 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/src/jsMain/kotlin/ue/ue.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") 2 | package ue 3 | 4 | 5 | import kotlin.js.* 6 | import org.khronos.webgl.* 7 | import org.w3c.dom.* 8 | import org.w3c.dom.events.* 9 | import org.w3c.dom.parsing.* 10 | import org.w3c.dom.svg.* 11 | import org.w3c.dom.url.* 12 | import org.w3c.fetch.* 13 | import org.w3c.files.* 14 | import org.w3c.notifications.* 15 | import org.w3c.performance.* 16 | import org.w3c.workers.* 17 | import org.w3c.xhr.* 18 | 19 | external var Context: JavascriptContext 20 | 21 | external var Root: JavascriptEditorTick 22 | -------------------------------------------------------------------------------- /kotlin-unreal-definitions/src/jsMain/kotlin/ue/ueExtensions.kt: -------------------------------------------------------------------------------- 1 | package ue 2 | 3 | import org.w3c.dom.events.Event 4 | 5 | /** 6 | * Created by hiperbou on 27/01/2017. 7 | */ 8 | external class UClass{} 9 | 10 | 11 | external interface EventListenerObject { 12 | fun handleEvent(evt: Event) 13 | } --------------------------------------------------------------------------------