Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed error when both HDRP and URP rendering pipelines are added to a project.\
- Fixed outdated warning on RotationComposerComponent.

### Changed
- Converted code using InstanceID references and API to EntityID.

## [3.1.5] - 2025-10-21

### Bugfixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ public static ScriptableObject CreateAt(Type assetType, string assetPath)
return asset;
}

#if UNITY_6000_4_OR_NEWER
class CreateAssetAction : UnityEditor.ProjectWindowCallback.AssetCreationEndAction
{
public Type TypeToCreate;
public override void Action(EntityId entityId, string pathName, string resourceFile)
{
var asset = CreateAt(TypeToCreate, pathName);
if (asset != null)
ProjectWindowUtil.ShowCreatedAsset(asset);
}
}
#else
class CreateAssetAction : UnityEditor.ProjectWindowCallback.EndNameEditAction
{
public Type TypeToCreate;
Expand All @@ -35,6 +47,7 @@ public override void Action(int instanceId, string pathName, string resourceFile
ProjectWindowUtil.ShowCreatedAsset(asset);
}
}
#endif

/// <summary>
/// Creates a new asset of the specified type in the Unity project.
Expand All @@ -52,7 +65,13 @@ public static void Create<T>(string defaultName = null) where T : ScriptableObje
var action = ScriptableObject.CreateInstance<CreateAssetAction>();
action.TypeToCreate = typeof(T);
var icon = EditorGUIUtility.IconContent("ScriptableObject Icon").image as Texture2D;
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, action, $"{defaultName}.asset", icon , null);

#if UNITY_6000_3_OR_NEWER
var entityId = EntityId.None;
#else
var entityId = 0;
#endif
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(entityId, action, $"{defaultName}.asset", icon , null);
}
}
}
4 changes: 4 additions & 0 deletions com.unity.cinemachine/Editor/Windows/CinemachineSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ static void OnPostprocessAllAssets(
string[] movedFromAssetPaths, bool didDomainReload)
{
if (didDomainReload)
#if UNITY_6000_4_OR_NEWER
EditorApplication.hierarchyWindowItemByEntityIdOnGUI += (instanceID, r) =>
#else
EditorApplication.hierarchyWindowItemOnGUI += (instanceID, r) =>
#endif
{
#if UNITY_6000_3_OR_NEWER
var instance = EditorUtility.EntityIdToObject(instanceID) as GameObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ protected override void ConnectToVcam(bool connect)
DestroyCanvas();
}

#if UNITY_6000_3_OR_NEWER
string CanvasName => "_CM_canvas" + gameObject.GetEntityId();
#else
string CanvasName => "_CM_canvas" + gameObject.GetInstanceID();
#endif

void CameraUpdatedCallback(CinemachineBrain brain)
{
Expand Down