Compare commits

...

6 Commits

Author SHA1 Message Date
BlackMATov
f2e7968853 Merge branch 'dev' 2025-03-08 04:18:57 +07:00
BlackMATov
ba0b96f7e5 update changelog 2025-03-08 04:16:00 +07:00
BlackMATov
e6735fd526 fix Unity deprecation warnings 2025-03-08 04:04:41 +07:00
f945d7dddb Merge pull request #2 from BlackMATov/feature/deferred-rendering-camera
Feature/deferred-rendering-camera
2023-02-11 16:53:32 +07:00
BlackMATov
e8f5414de0 setup cameras for the builtin deferred rendering
Co-Authored-By: leonardozimbres <3225893+leonardozimbres@users.noreply.github.com>
2023-02-11 02:12:48 +07:00
BlackMATov
3e24f79892 remove some default dependencies 2023-02-10 23:38:05 +07:00
11 changed files with 64 additions and 65 deletions

View File

@@ -1,3 +1,9 @@
### Version 1.4.1
* Fix camera settings for the builtin deferred rendering
* Fix Unity deprecation warnings
### Version 1.4.0
* It's free and Open Source now!

View File

@@ -98,7 +98,7 @@ namespace FTEditor.Editors {
void OnEnable() {
_manager = target as SwfManager;
_controllers = FindObjectsOfType<SwfClipController>().ToList();
_controllers = SwfEditorUtils.FindObjectsOfType<SwfClipController>().ToList();
}
public override void OnInspectorGUI() {

View File

@@ -507,7 +507,7 @@ namespace FTEditor.Postprocessors {
static void UpdateAssetClips(SwfAsset asset) {
var asset_guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset));
var scene_clips = GameObject.FindObjectsOfType<SwfClip>()
var scene_clips = SwfEditorUtils.FindObjectsOfType<SwfClip>()
.Where (p => p && p.clip && p.clip.AssetGUID == asset_guid)
.ToList();
for ( var i = 0; i < scene_clips.Count; ++i ) {

View File

@@ -15,6 +15,28 @@ using FTRuntime;
namespace FTEditor {
static class SwfEditorUtils {
// ---------------------------------------------------------------------
//
// Compatibility
//
// ---------------------------------------------------------------------
public static T FindObjectOfType<T>() where T : Object {
#if UNITY_2021_3_OR_NEWER
return Object.FindAnyObjectByType<T>();
#else
return Object.FindObjectOfType<T>();
#endif
}
public static T[] FindObjectsOfType<T>() where T : Object {
#if UNITY_2021_3_OR_NEWER
return Object.FindObjectsByType<T>(FindObjectsSortMode.None);
#else
return Object.FindObjectsOfType<T>();
#endif
}
// ---------------------------------------------------------------------
//
// Packing

View File

@@ -71,6 +71,30 @@ namespace FTRuntime.Internal {
return comp;
}
//
// FindObjectOfType<T>
//
public static T FindObjectOfType<T>() where T : Object {
#if UNITY_2021_3_OR_NEWER
return Object.FindAnyObjectByType<T>();
#else
return Object.FindObjectOfType<T>();
#endif
}
//
// FindObjectsOfType<T>
//
public static T[] FindObjectsOfType<T>() where T : Object {
#if UNITY_2021_3_OR_NEWER
return Object.FindObjectsByType<T>(FindObjectsSortMode.None);
#else
return Object.FindObjectsOfType<T>();
#endif
}
//
// FillGeneratedMesh
//

View File

@@ -32,7 +32,7 @@ namespace FTRuntime {
/// <param name="allow_create">If set to <c>true</c> allow create</param>
public static SwfManager GetInstance(bool allow_create) {
if ( !_instance ) {
_instance = FindObjectOfType<SwfManager>();
_instance = SwfUtils.FindObjectOfType<SwfManager>();
if ( allow_create && !_instance ) {
var go = new GameObject("[SwfManager]");
_instance = go.AddComponent<SwfManager>();
@@ -231,8 +231,14 @@ namespace FTRuntime {
_controllers.Remove(controller);
}
void SetupCameras() {
foreach ( var camera in Camera.allCameras ) {
camera.clearStencilAfterLightingPass = true;
}
}
void GrabEnabledClips() {
var clips = FindObjectsOfType<SwfClip>();
var clips = SwfUtils.FindObjectsOfType<SwfClip>();
for ( int i = 0, e = clips.Length; i < e; ++i ) {
var clip = clips[i];
if ( clip.enabled ) {
@@ -242,7 +248,7 @@ namespace FTRuntime {
}
void GrabEnabledControllers() {
var controllers = FindObjectsOfType<SwfClipController>();
var controllers = SwfUtils.FindObjectsOfType<SwfClipController>();
for ( int i = 0, e = controllers.Length; i < e; ++i ) {
var controller = controllers[i];
if ( controller.enabled ) {
@@ -294,6 +300,7 @@ namespace FTRuntime {
// ---------------------------------------------------------------------
void OnEnable() {
SetupCameras();
GrabEnabledClips();
GrabEnabledControllers();
}

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e7aa1ef0de3d0447a985016d4af45a84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1 +0,0 @@
{"androidStore":"GooglePlay"}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 64cb5b554b36b481aa7384aecdbd398a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2,14 +2,11 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "3.7.5",
"com.unity.analytics": "3.6.12",
"com.unity.collab-proxy": "1.14.18",
"com.unity.ide.rider": "1.2.1",
"com.unity.ide.visualstudio": "2.0.15",
"com.unity.ide.vscode": "1.2.5",
"com.unity.multiplayer-hlapi": "1.0.8",
"com.unity.purchasing": "4.1.5",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "2.1.4",
"com.unity.timeline": "1.2.18",

View File

@@ -12,24 +12,6 @@
"source": "builtin",
"dependencies": {}
},
"com.unity.ads": {
"version": "3.7.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.analytics": {
"version": "3.6.12",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.14.18",
"depth": 0,
@@ -78,29 +60,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "4.1.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.31",
"depth": 0,