-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deficuet
authored and
Deficuet
committed
Dec 25, 2022
1 parent
a72adcc
commit 9b1e4a9
Showing
7 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.github.deficuet.unitykt.data | ||
|
||
import io.github.deficuet.unitykt.dataImpl.CanvasImpl | ||
import io.github.deficuet.unitykt.file.ObjectInfo | ||
import io.github.deficuet.unitykt.file.SerializedFile | ||
import io.github.deficuet.unitykt.util.ObjectReader | ||
|
||
/** | ||
* Errors may occur for bundles with version before `2018.4.34f1` | ||
*/ | ||
class Canvas private constructor( | ||
private val container: ImplementationContainer<CanvasImpl> | ||
): Behaviour(container) { | ||
internal constructor(assetFile: SerializedFile, info: ObjectInfo): | ||
this(ImplementationContainer(assetFile, info) { CanvasImpl(ObjectReader(assetFile, info)) }) | ||
|
||
val mRenderMode: Int get() = container.impl.mRenderMode | ||
val mCamera: PPtr<Object> get() = container.impl.mCamera | ||
val mPlaneDistance: Float get() = container.impl.mPlaneDistance | ||
val mPixelPerfect: Boolean get() = container.impl.mPixelPerfect | ||
val mReceivesEvent: Boolean get() = container.impl.mReceivesEvent | ||
val mOverrideSorting: Boolean get() = container.impl.mOverrideSorting | ||
val mOverridePixelPerfect: Boolean get() = container.impl.mOverridePixelPerfect | ||
val mSortingBucketNormalizedSize: Float get() = container.impl.mSortingBucketNormalizedSize | ||
val mAdditionalShaderChannelsFlag: Int get() = container.impl.mAdditionalShaderChannelsFlag | ||
val mSortingLayerID: Int get() = container.impl.mSortingLayerID | ||
val mSortingOrder: Short get() = container.impl.mSortingOrder | ||
val mTargetDisplay: Byte get() = container.impl.mTargetDisplay | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/kotlin/io/github/deficuet/unitykt/dataImpl/CanvasImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.github.deficuet.unitykt.dataImpl | ||
|
||
import io.github.deficuet.unitykt.data.* | ||
import io.github.deficuet.unitykt.util.ObjectReader | ||
|
||
/** | ||
* Errors may occur for bundles with version before `2018.4.34f1` | ||
*/ | ||
class CanvasImpl internal constructor(reader: ObjectReader): BehaviourImpl(reader) { | ||
val mRenderMode = reader.readInt() | ||
val mCamera = PPtr<Object>(reader) //PPtr<Camera> | ||
val mPlaneDistance = reader.readFloat() | ||
val mPixelPerfect = reader.readBool() | ||
val mReceivesEvent = reader.readBool() | ||
val mOverrideSorting = reader.readBool() | ||
val mOverridePixelPerfect = reader.readBool() | ||
val mSortingBucketNormalizedSize = reader.readFloat() | ||
val mAdditionalShaderChannelsFlag = reader.readInt() | ||
val mSortingLayerID: Int | ||
val mSortingOrder: Short | ||
val mTargetDisplay: Byte | ||
|
||
init { | ||
reader.alignStream() | ||
mSortingLayerID = reader.readInt() | ||
mSortingOrder = reader.readShort() | ||
mTargetDisplay = reader.readSByte() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters