Skip to content

Commit

Permalink
Merge pull request #504 from anatawa12/follow-up-ndmf
Browse files Browse the repository at this point in the history
Remove Legacy ApplyOnPlay
  • Loading branch information
anatawa12 authored Sep 24, 2023
2 parents f8c0f15 + 1acb0fb commit 6f99aa9
Show file tree
Hide file tree
Showing 51 changed files with 44 additions and 1,149 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog].
### Deprecated

### Removed
- internal ApplyOnPlay framework `#504`

### Fixed

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog].
- You can migrate to `Remove Unused Objects` only with one click!

### Removed
- internal ApplyOnPlay framework `#504`

### Fixed
- Crash with Unity 2022 `#423`
Expand Down
178 changes: 0 additions & 178 deletions Editor/OptimizerProcessor.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Editor/OptimizerProcessor.cs.meta

This file was deleted.

4 changes: 0 additions & 4 deletions Editor/OptimizerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using Anatawa12.AvatarOptimizer.Processors;
#if NADEMOFU
using Anatawa12.AvatarOptimizer.ndmf;
using nadena.dev.ndmf;
#endif
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
Expand All @@ -21,12 +19,10 @@ internal class OptimizerSession
public ObjectMappingBuilder MappingBuilder { get; }
public MeshInfo2Holder MeshInfo2Holder { get; private set; } = new MeshInfo2Holder();

#if NADEMOFU
public static implicit operator OptimizerSession(BuildContext context)
{
return context.Extension<OptimizerContext>().session;
}
#endif

public OptimizerSession(GameObject rootObject, bool addToAsset, bool isTest) :
this(rootObject, addToAsset ? Utils.CreateAssetFile() : null, isTest)
Expand Down
4 changes: 1 addition & 3 deletions Editor/Processors/OptimizerPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if NADEMOFU
using System;
using System;
using Anatawa12.AvatarOptimizer.ErrorReporting;
using Anatawa12.AvatarOptimizer.ndmf;
using Anatawa12.AvatarOptimizer.Processors;
Expand Down Expand Up @@ -86,4 +85,3 @@ protected override void OnUnhandledException(Exception e)
}
}
}
#endif
19 changes: 0 additions & 19 deletions Editor/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
#if !NADEMOFU
using Anatawa12.ApplyOnPlay;
#endif
using JetBrains.Annotations;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -342,21 +338,6 @@ public static void DeleteTemporalDirectory()
FileUtil.DeleteFileOrDirectory(TemporalDirPath);
}

#if !NADEMOFU
[CanBeNull]
public static DummyObject CreateOutputAssetFile(GameObject avatarGameObject, ApplyReason reason)
{
switch (reason)
{
case ApplyReason.EnteringPlayMode:
return ApplyOnPlayConfig.Generate ? CreateAssetFile() : null;
case ApplyReason.ManualBake:
default:
return CreateOutputAssetFile(avatarGameObject);
}
}
#endif

public static DummyObject CreateAssetFile()
{
var obj = ScriptableObject.CreateInstance<DummyObject>();
Expand Down
8 changes: 1 addition & 7 deletions Editor/com.anatawa12.avatar-optimizer.editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [
{
"name": "nadena.dev.ndmf",
"expression": "0.4.0",
"define": "NADEMOFU"
}
],
"versionDefines": [],
"noEngineReferences": false
}
3 changes: 0 additions & 3 deletions Internal/ApplyOnPlay.meta

This file was deleted.

3 changes: 0 additions & 3 deletions Internal/ApplyOnPlay/Editor.meta

This file was deleted.

Loading

0 comments on commit 6f99aa9

Please sign in to comment.