Skip to content

Commit

Permalink
update GameObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Deficuet authored and Deficuet committed Jan 6, 2024
1 parent 6f39047 commit 7581e13
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import kotlin.UInt;
import kotlin.UShort;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

abstract class GameObjectFields extends EditorExtensionImpl {
GameObjectFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
Expand All @@ -17,10 +18,11 @@ abstract class GameObjectFields extends EditorExtensionImpl {
String fmName;
UShort fmTag;
Boolean fmIsActive;
Transform fmTransform;
MeshRenderer fmMeshRenderer;
MeshFilter fmMeshFilter;
SkinnedMeshRenderer fmSkinnedMeshRenderer;
Animator fmAnimator;
Animation fmAnimation;

@Nullable Transform fmTransform = null;
@Nullable MeshRenderer fmMeshRenderer = null;
@Nullable MeshFilter fmMeshFilter = null;
@Nullable SkinnedMeshRenderer fmSkinnedMeshRenderer = null;
@Nullable Animator fmAnimator = null;
@Nullable Animation fmAnimation = null;
}
13 changes: 7 additions & 6 deletions src/main/kotlin/io/github/deficuet/unitykt/classes/GameObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ interface GameObject: EditorExtension {
val mName: String
val mTag: UShort
val mIsActive: Boolean
val mTransform: Transform
val mMeshRenderer: MeshRenderer
val mMeshFilter: MeshFilter
val mSkinnedMeshRenderer: SkinnedMeshRenderer
val mAnimator: Animator
val mAnimation: Animation

val mTransform: Transform?
val mMeshRenderer: MeshRenderer?
val mMeshFilter: MeshFilter?
val mSkinnedMeshRenderer: SkinnedMeshRenderer?
val mAnimator: Animator?
val mAnimation: Animation?
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ internal class GameObjectImpl(
checkInitialize()
return fmIsActive
}
override val mTransform: Transform get() {
override val mTransform: Transform? get() {
checkInitialize()
return fmTransform
}
override val mMeshRenderer: MeshRenderer get() {
override val mMeshRenderer: MeshRenderer? get() {
checkInitialize()
return fmMeshRenderer
}
override val mMeshFilter: MeshFilter get() {
override val mMeshFilter: MeshFilter? get() {
checkInitialize()
return fmMeshFilter
}
override val mSkinnedMeshRenderer: SkinnedMeshRenderer get() {
override val mSkinnedMeshRenderer: SkinnedMeshRenderer? get() {
checkInitialize()
return fmSkinnedMeshRenderer
}
override val mAnimator: Animator get() {
override val mAnimator: Animator? get() {
checkInitialize()
return fmAnimator
}
override val mAnimation: Animation get() {
override val mAnimation: Animation? get() {
checkInitialize()
return fmAnimation
}
Expand Down

0 comments on commit 7581e13

Please sign in to comment.