No Criware Anymore
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 994dd8b8169af3646809acee61a0902e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 563cc63bc4fc0504aa33590e2d263881
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a05db99aed6ec949adfc390a40edb58
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 886ff5893aa663a46a61c7bfa6514e0e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9961547ad1dabaa4681e59243bd8afdf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,92 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriAtom))]
|
||||
public class CriAtomEditor : UnityEditor.Editor
|
||||
{
|
||||
#region Variables
|
||||
private CriAtom atom = null;
|
||||
#endregion
|
||||
|
||||
#region GUI Functions
|
||||
private void OnEnable()
|
||||
{
|
||||
atom = (CriAtom)base.target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (atom == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
atom.acfFile = EditorGUILayout.TextField("ACF File", atom.acfFile);
|
||||
atom.dspBusSetting = EditorGUILayout.TextField("DSP Bus Setting", atom.dspBusSetting);
|
||||
|
||||
for (int i = 0; i < atom.cueSheets.Length; i++) {
|
||||
var cueSheet = atom.cueSheets[i];
|
||||
EditorGUILayout.BeginVertical("HelpBox");
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Cue Sheet");
|
||||
if (GUILayout.Button("Remove")) {
|
||||
atom.RemoveCueSheetInternal(cueSheet.name);
|
||||
break;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUI.indentLevel++;
|
||||
cueSheet.name = EditorGUILayout.TextField("Name", cueSheet.name);
|
||||
cueSheet.acbFile = EditorGUILayout.TextField("ACB File", cueSheet.acbFile);
|
||||
cueSheet.awbFile = EditorGUILayout.TextField("AWB File", cueSheet.awbFile);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
if (GUILayout.Button("Add CueSheet")) {
|
||||
atom.AddCueSheetInternal("", "", "", null);
|
||||
}
|
||||
|
||||
atom.dontRemoveExistsCueSheet = EditorGUILayout.Toggle("Dont Remove Exists CueSheet", atom.dontRemoveExistsCueSheet);
|
||||
atom.dontDestroyOnLoad = EditorGUILayout.Toggle("Dont Destroy On Load", atom.dontDestroyOnLoad);
|
||||
}
|
||||
if (GUI.changed) {
|
||||
EditorUtility.SetDirty(atom);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Editor Utilities
|
||||
/**
|
||||
* \deprecated
|
||||
* This is a deprecated API that will be removed.
|
||||
* Please consider using CriAtomEditorUtilities.InitializeLibrary() instead.
|
||||
*/
|
||||
[Obsolete("Consider using CriAtomEditorUtilities.InitializeLibrary() instead.")]
|
||||
public static void InitializePluginForEditor() {
|
||||
CriWare.Editor.CriAtomEditorUtilities.InitializeLibrary();
|
||||
}
|
||||
|
||||
/**
|
||||
* \deprecated
|
||||
* This is a deprecated API that will be removed.
|
||||
* Please consider using CriAtomEditorUtilities.PreviewPlayer instead.
|
||||
*/
|
||||
[Obsolete("Consider using CriAtomEditorUtilities.PreviewPlayer instead.")]
|
||||
public class PreviewPlayer : CriWare.Editor.CriAtomEditorUtilities.PreviewPlayer { }
|
||||
#endregion
|
||||
} // end of class
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4580729b648468042bc67394cbfe5c75
|
||||
timeCreated: 1433816076
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,153 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
namespace CriWare.Editor {
|
||||
|
||||
public class CriAtomEditorSettingsProvider : SettingsProvider
|
||||
{
|
||||
static readonly string settingPath = "Project/CRIWARE/Editor/Atom Preview";
|
||||
|
||||
public CriAtomEditorSettingsProvider(string path, SettingsScope scope) : base(path, scope) { }
|
||||
|
||||
public override void OnGUI(string searchContext) {
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Library Initialization Settings for Audio Previewing in the Editor", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.Space();
|
||||
CriAtomEditorSettings.Instance.EditorInstance.OnInspectorGUI();
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
|
||||
[SettingsProvider]
|
||||
static SettingsProvider Create() {
|
||||
var provider = new CriAtomEditorSettingsProvider(settingPath, SettingsScope.Project);
|
||||
return provider;
|
||||
}
|
||||
} //class CriAtomEditorSettingsProvider
|
||||
|
||||
public class CriAtomEditorSettings : ScriptableObject
|
||||
{
|
||||
static readonly string SettingsDirPath = "Assets/CriData/Settings";
|
||||
static CriAtomEditorSettings instance = null;
|
||||
|
||||
private UnityEditor.Editor editorInstance = null;
|
||||
internal UnityEditor.Editor EditorInstance {
|
||||
get {
|
||||
if (editorInstance == null) {
|
||||
editorInstance = UnityEditor.Editor.CreateEditor(this);
|
||||
}
|
||||
return editorInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private bool hasSettingsChanged = false;
|
||||
internal void SetChangeFlag() { hasSettingsChanged = true; }
|
||||
internal bool GetChangeStatusOnce() {
|
||||
bool currentChangeStatus = hasSettingsChanged;
|
||||
hasSettingsChanged = false;
|
||||
return currentChangeStatus;
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private bool trySceneSettings = false;
|
||||
internal bool TrySceneSettings { get { return trySceneSettings; } }
|
||||
|
||||
[SerializeField]
|
||||
private CriAtomConfig atomConfig = new CriAtomConfig();
|
||||
internal CriAtomConfig AtomConfig { get { return atomConfig; } }
|
||||
|
||||
internal static CriAtomEditorSettings Instance {
|
||||
get {
|
||||
if (instance == null) {
|
||||
var guids = AssetDatabase.FindAssets("t:" + typeof(CriAtomEditorSettings).Name);
|
||||
if (guids.Length <= 0) {
|
||||
if (!System.IO.Directory.Exists(SettingsDirPath)) {
|
||||
System.IO.Directory.CreateDirectory(SettingsDirPath);
|
||||
}
|
||||
instance = CreateInstance<CriAtomEditorSettings>();
|
||||
AssetDatabase.CreateAsset(instance, System.IO.Path.Combine(SettingsDirPath, typeof(CriAtomEditorSettings).Name + ".asset"));
|
||||
} else {
|
||||
var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]);
|
||||
if (guids.Length > 1) {
|
||||
Debug.LogWarning("[CRIWARE] Multiple setting files founded. Using " + assetPath);
|
||||
}
|
||||
instance = AssetDatabase.LoadAssetAtPath<CriAtomEditorSettings>(assetPath);
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
internal void ResetConfig() {
|
||||
atomConfig = new CriAtomConfig();
|
||||
}
|
||||
} //class CriAtomEditorSettings
|
||||
|
||||
[CustomEditor(typeof(CriAtomEditorSettings))]
|
||||
public class CriAtomEditorSettingsEditor : UnityEditor.Editor
|
||||
{
|
||||
private SerializedProperty trySceneSettingsProp;
|
||||
private List<SerializedProperty> atomConfigProps = new List<SerializedProperty>();
|
||||
|
||||
private void OnEnable() {
|
||||
trySceneSettingsProp = serializedObject.FindProperty("trySceneSettings");
|
||||
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxVirtualVoices"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxVoiceLimitGroups"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxCategories"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxSequenceEventsPerFrame"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxBeatSyncCallbacksPerFrame"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxCueLinkCallbacksPerFrame"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.standardVoicePoolConfig"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.hcaMxVoicePoolConfig"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.outputSamplingRate"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.serverFrequency"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.asrOutputChannels"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.useRandomSeedWithTime"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.categoriesPerPlayback"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxFaders"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxBuses"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.maxParameterBlocks"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.vrMode"));
|
||||
atomConfigProps.Add(serializedObject.FindProperty("atomConfig.pcBufferingTime"));
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
const float LABEL_WIDTH = 250;
|
||||
float prevLabelWidth;
|
||||
|
||||
serializedObject.Update();
|
||||
prevLabelWidth = EditorGUIUtility.labelWidth;
|
||||
EditorGUIUtility.labelWidth = LABEL_WIDTH;
|
||||
EditorGUILayout.PropertyField(trySceneSettingsProp);
|
||||
if (trySceneSettingsProp.boolValue) {
|
||||
EditorGUILayout.HelpBox("Will use project settings if CriLibraryInitializer does not exist in the scene.", MessageType.Info);
|
||||
}
|
||||
EditorGUILayout.Space();
|
||||
foreach (var prop in atomConfigProps) {
|
||||
EditorGUILayout.PropertyField(prop);
|
||||
}
|
||||
EditorGUIUtility.labelWidth = prevLabelWidth;
|
||||
if (serializedObject.hasModifiedProperties) {
|
||||
(target as CriAtomEditorSettings).SetChangeFlag();
|
||||
}
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
if (GUILayout.Button("Reset to Default")) {
|
||||
(target as CriAtomEditorSettings).ResetConfig();
|
||||
(target as CriAtomEditorSettings).SetChangeFlag();
|
||||
}
|
||||
}
|
||||
} //class CriAtomEditorSettingsEditor
|
||||
|
||||
} //namespace CriWare.Editor
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdb0b816a0bf0284282bd91a06a57a05
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,192 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
/**
|
||||
* \addtogroup CRIWARE_EDITOR_UTILITY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* <summary>CriWare.Editor namespace</summary>
|
||||
* <remarks>
|
||||
* <para header='Description'>This is a namespace which includes a collection of classes that can be used in the Unity Editor environment.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
namespace CriWare.Editor {
|
||||
|
||||
/**
|
||||
* <summary>Class for the editor-only features of CRI Atom</summary>
|
||||
* <remarks>
|
||||
* <para header='Description'>Class that contains the editor-specific functions of CRI Atom.</para>
|
||||
* <para header='Note'>When using this class with the Assembly Definition version plug-in,<br/>
|
||||
* it is necessary to reference the following assembly definitions:<br/>
|
||||
* - CriMw.CriWare.Editor<br/>
|
||||
* - CriMw.CriWare.Runtime<br/></para>
|
||||
* </remarks>
|
||||
*/
|
||||
public class CriAtomEditorUtilities
|
||||
{
|
||||
/**
|
||||
* <summary>Initialize the CRI Atom library in the editor</summary>
|
||||
* <returns>Whether the initialization process was executed</returns>
|
||||
* <remarks>
|
||||
* <para header='Description'>This method is used to initialize the CRI Atom library dedicated to the Edit mode. <br/>
|
||||
* The Atom library will be initialized according to the Atom editor settings in the project settings. <br/>
|
||||
* Depending on the project settings, it is also possible to initialize
|
||||
* using the settings of the CriWareInitializer component in the currently loaded scene.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public static bool InitializeLibrary() {
|
||||
bool settingChanged = CriAtomEditorSettings.Instance.GetChangeStatusOnce();
|
||||
if (CriAtomPlugin.IsLibraryInitialized() && settingChanged == false) {
|
||||
return false;
|
||||
}
|
||||
if (settingChanged) {
|
||||
CriAtomPlugin.FinalizeLibrary();
|
||||
}
|
||||
|
||||
CriAtomConfig atomConfigEditor;
|
||||
if (CriAtomEditorSettings.Instance.TrySceneSettings == false) {
|
||||
atomConfigEditor = CriAtomEditorSettings.Instance.AtomConfig;
|
||||
} else {
|
||||
CriWareInitializer criInitializer = GameObject.FindObjectOfType<CriWareInitializer>();
|
||||
if (criInitializer != null) {
|
||||
atomConfigEditor = criInitializer.atomConfig;
|
||||
} else {
|
||||
atomConfigEditor = CriAtomEditorSettings.Instance.AtomConfig;
|
||||
Debug.Log("[CRIWARE] Atom Preview: No CriWareInitializer component found in current scene. " +
|
||||
"Using project settings instead.");
|
||||
}
|
||||
}
|
||||
return CriWareInitializer.InitializeAtom(atomConfigEditor);
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Audio player dedicated to previewing in the editor</summary>
|
||||
* <remarks>
|
||||
* <para header='Description'>This class is used to preview the playback of ADX2 audio in the Edit mode. <br/>
|
||||
* The loading of the relevant ACB data must be managed externally.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public class PreviewPlayer : CriDisposable {
|
||||
public CriAtomExPlayer player { get; private set; }
|
||||
private bool finalizeSuppressed = false;
|
||||
private bool isPlayerReady = false;
|
||||
|
||||
private void Initialize() {
|
||||
CriAtomEditorUtilities.InitializeLibrary();
|
||||
if (CriAtomPlugin.IsLibraryInitialized() == false) { return; }
|
||||
|
||||
player = new CriAtomExPlayer();
|
||||
if (player == null) { return; }
|
||||
|
||||
player.SetPanType(CriAtomEx.PanType.Pan3d);
|
||||
player.UpdateAll();
|
||||
|
||||
isPlayerReady = true;
|
||||
|
||||
CriDisposableObjectManager.Register(this, CriDisposableObjectManager.ModuleType.Atom);
|
||||
|
||||
if (finalizeSuppressed) {
|
||||
GC.ReRegisterForFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Initialization of the player</summary>
|
||||
*/
|
||||
public PreviewPlayer() {
|
||||
Initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Destroying the player</summary>
|
||||
*/
|
||||
public override void Dispose() {
|
||||
this.dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
finalizeSuppressed = true;
|
||||
}
|
||||
|
||||
private void dispose() {
|
||||
CriDisposableObjectManager.Unregister(this);
|
||||
if (player != null) {
|
||||
player.Dispose();
|
||||
player = null;
|
||||
}
|
||||
this.isPlayerReady = false;
|
||||
}
|
||||
|
||||
~PreviewPlayer() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Set the audio data and play</summary>
|
||||
* <param name='acb'>ACB data</param>
|
||||
* <param name='cueName'>Cue name</param>
|
||||
* <remarks>
|
||||
* <para header='Description'>Specify the ACB data and Cue name and then play.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public void Play(CriAtomExAcb acb, string cueName) {
|
||||
if (isPlayerReady == false) {
|
||||
this.Initialize();
|
||||
}
|
||||
|
||||
if (acb != null) {
|
||||
if (player != null) {
|
||||
player.SetCue(acb, cueName);
|
||||
player.Start();
|
||||
} else {
|
||||
Debug.LogWarning("[CRIWARE] Player is not ready. Please try reloading the inspector / editor window");
|
||||
}
|
||||
} else {
|
||||
Debug.LogWarning("[CRIWARE] ACB data is not set for previewing playback");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Stops the playback</summary>
|
||||
* <param name='withoutRelease'>Whether to stop without release time</param>
|
||||
* <remarks>
|
||||
* <para header='Description'>Stops all audio playback.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public void Stop(bool withoutRelease = false) {
|
||||
if (player != null) {
|
||||
if (withoutRelease) {
|
||||
player.StopWithoutReleaseTime();
|
||||
} else {
|
||||
player.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Resets the parameters of the player</summary>
|
||||
*/
|
||||
public void ResetPlayer() {
|
||||
player.SetVolume(1f);
|
||||
player.SetPitch(0);
|
||||
player.Loop(false);
|
||||
}
|
||||
}
|
||||
|
||||
} // end of class
|
||||
|
||||
} //namespace CriWare.Editor
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* end of file */
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15f32809ca2a1cf40982c3336cc81366
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,18 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriAtomListener))]
|
||||
public class CriAtomListenerEditor : UnityEditor.Editor
|
||||
{
|
||||
} // end of class
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7ddeb461d32378408896179255bf0cd
|
||||
timeCreated: 1433816082
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,133 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
public abstract class CriAtomSourceBaseEditor : UnityEditor.Editor
|
||||
{
|
||||
#region Variables
|
||||
protected CriAtomSourceBase source = null;
|
||||
private bool showAndroidConfig;
|
||||
private GUIStyle style;
|
||||
|
||||
private SerializedProperty m_followsOriginalSource;
|
||||
private SerializedProperty m_calculationType;
|
||||
private SerializedProperty m_calculationParameters;
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
this.source = (CriAtomSourceBase)base.target;
|
||||
this.style = new GUIStyle();
|
||||
m_followsOriginalSource = serializedObject.FindProperty("randomize3dConfig.followsOriginalSource");
|
||||
m_calculationType = serializedObject.FindProperty("randomize3dConfig.calculationType");
|
||||
m_calculationParameters = serializedObject.FindProperty("randomize3dConfig.calculationParameters");
|
||||
}
|
||||
|
||||
protected abstract void InspectorCueReferenceGUI();
|
||||
protected abstract void InspectorPreviewGUI();
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (this.source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
InspectorCueReferenceGUI();
|
||||
InspectorPreviewGUI();
|
||||
this.source.playOnStart = EditorGUILayout.Toggle("Play On Start", this.source.playOnStart);
|
||||
EditorGUILayout.Space();
|
||||
this.source.volume = EditorGUILayout.Slider("Volume", this.source.volume, 0.0f, 1.0f);
|
||||
this.source.pitch = EditorGUILayout.Slider("Pitch", this.source.pitch, -1200f, 1200);
|
||||
this.source.loop = EditorGUILayout.Toggle("Loop", this.source.loop);
|
||||
if (this.source.use3dPositioning = EditorGUILayout.Toggle("3D Positioning", this.source.use3dPositioning))
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
this.source.freezeOrientation = EditorGUILayout.Toggle("Freeze Orientation", this.source.freezeOrientation);
|
||||
this.source.regionOnStart = EditorGUILayout.ObjectField("Region On Start", this.source.regionOnStart, typeof(CriAtomRegion), true) as CriAtomRegion;
|
||||
this.source.listenerOnStart = EditorGUILayout.ObjectField("Listener On Start", this.source.listenerOnStart, typeof(CriAtomListener), true) as CriAtomListener;
|
||||
bool tempRandomizeSetting = EditorGUILayout.Toggle("3D Randomization", this.source.use3dRandomization);
|
||||
if (tempRandomizeSetting != this.source.use3dRandomization)
|
||||
{
|
||||
this.source.use3dRandomization = tempRandomizeSetting;
|
||||
}
|
||||
if (this.source.use3dRandomization)
|
||||
{
|
||||
EditorGUILayout.BeginVertical("HelpBox");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
this.m_followsOriginalSource.boolValue = EditorGUILayout.Toggle("Follow origin", this.m_followsOriginalSource.boolValue);
|
||||
var calcType = (int)(CriAtomEx.Randomize3dCalcType)EditorGUILayout.EnumPopup("Type", (CriAtomEx.Randomize3dCalcType)this.m_calculationType.intValue);
|
||||
if (calcType != this.m_calculationType.intValue)
|
||||
{
|
||||
this.m_calculationType.intValue = calcType;
|
||||
/* set new parameter to 1 */
|
||||
for (int i = 0; i < CriAtomEx.Randomize3dConfig.NumOfCalcParams; ++i)
|
||||
{
|
||||
if (this.m_calculationParameters.GetArrayElementAtIndex(i).floatValue <= 0f)
|
||||
{
|
||||
this.m_calculationParameters.GetArrayElementAtIndex(i).floatValue = 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < CriAtomEx.Randomize3dConfig.NumOfCalcParams; ++i)
|
||||
{
|
||||
var paramType = CriAtomEx.randomize3dParamTable[(CriAtomEx.Randomize3dCalcType)m_calculationType.intValue][i];
|
||||
if (paramType == CriAtomEx.Randomize3dParamType.None)
|
||||
{
|
||||
this.m_calculationParameters.GetArrayElementAtIndex(i).floatValue = 0f;
|
||||
continue;
|
||||
}
|
||||
this.m_calculationParameters.GetArrayElementAtIndex(i).floatValue = EditorGUILayout.FloatField(paramType.ToString(), this.m_calculationParameters.GetArrayElementAtIndex(i).floatValue);
|
||||
}
|
||||
switch ((CriAtomEx.Randomize3dCalcType)m_calculationType.intValue)
|
||||
{
|
||||
case CriAtomEx.Randomize3dCalcType.List:
|
||||
var templength = (uint)Mathf.Abs(EditorGUILayout.IntField("Max length of list", (int)this.source.randomPositionListMaxLength));
|
||||
if (templength != this.source.randomPositionListMaxLength)
|
||||
{
|
||||
this.source.randomPositionListMaxLength = templength;
|
||||
}
|
||||
EditorGUILayout.HelpBox("Please set the list of positions by using CriAtomSource.SetRandomPositionList()", MessageType.Info);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
this.source.use3dRandomization = this.source.use3dRandomization; /* apply change */
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
this.showAndroidConfig = EditorGUILayout.Foldout(this.showAndroidConfig, "Android Config");
|
||||
if (this.showAndroidConfig)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
style.stretchWidth = true;
|
||||
this.source.androidUseLowLatencyVoicePool = EditorGUILayout.Toggle("Low Latency Playback", this.source.androidUseLowLatencyVoicePool);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
if (GUI.changed)
|
||||
{
|
||||
EditorUtility.SetDirty(this.source);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
} // end of class
|
||||
} // namespace CriWare
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b656357d81bf0d0408dc264ac483ccf4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,117 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2014 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define CRI_UNITY_EDITOR_PREVIEW
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriAtomSource))]
|
||||
public class CriAtomSourceEditor : CriAtomSourceBaseEditor {
|
||||
#region Variables
|
||||
#if CRI_UNITY_EDITOR_PREVIEW
|
||||
public CriAtom atomComponent;
|
||||
private CriWare.Editor.CriAtomEditorUtilities.PreviewPlayer previewPlayer;
|
||||
private string strPreviewAcb = null;
|
||||
private string strPreviewAwb = null;
|
||||
private CriAtomExAcb previewAcb = null;
|
||||
private string lastCuesheet = "";
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
|
||||
#if CRI_UNITY_EDITOR_PREVIEW
|
||||
/* シーンからCriAtomコンポーネントを見つけ出す */
|
||||
atomComponent = (CriAtom)FindObjectOfType(typeof(CriAtom));
|
||||
#endif
|
||||
previewPlayer = new CriWare.Editor.CriAtomEditorUtilities.PreviewPlayer();
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
previewAcb = null;
|
||||
}
|
||||
lastCuesheet = "";
|
||||
if (previewPlayer != null) {
|
||||
previewPlayer.Dispose();
|
||||
previewPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void InspectorCueReferenceGUI()
|
||||
{
|
||||
(source as CriAtomSource).cueSheet = EditorGUILayout.TextField("Cue Sheet", (source as CriAtomSource).cueSheet);
|
||||
(source as CriAtomSource).cueName = EditorGUILayout.TextField("Cue Name", (source as CriAtomSource).cueName);
|
||||
}
|
||||
|
||||
protected override void InspectorPreviewGUI()
|
||||
{
|
||||
#if CRI_UNITY_EDITOR_PREVIEW
|
||||
GUI.enabled = false;
|
||||
atomComponent = (CriAtom)EditorGUILayout.ObjectField("CriAtom Object", atomComponent, typeof(CriAtom), true);
|
||||
GUI.enabled = (atomComponent != null);
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.LabelField("Preview", GUILayout.MaxWidth(EditorGUIUtility.labelWidth - 5));
|
||||
if (GUILayout.Button("Play", GUILayout.MaxWidth(60))) {
|
||||
this.StartPreviewPlayer();
|
||||
}
|
||||
if (GUILayout.Button("Stop", GUILayout.MaxWidth(60))) {
|
||||
this.previewPlayer.Stop();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUI.enabled = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CRI_UNITY_EDITOR_PREVIEW
|
||||
/* プレビュ用:音声データ設定・再生関数 */
|
||||
private void StartPreviewPlayer() {
|
||||
if (previewPlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastCuesheet != (source as CriAtomSource).cueSheet) {
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
previewAcb = null;
|
||||
}
|
||||
foreach (var cuesheet in atomComponent.cueSheets) {
|
||||
if (cuesheet.name == (source as CriAtomSource).cueSheet) {
|
||||
strPreviewAcb = Path.Combine(CriWare.Common.streamingAssetsPath, cuesheet.acbFile);
|
||||
strPreviewAwb = (cuesheet.awbFile == null) ? null : Path.Combine(CriWare.Common.streamingAssetsPath, cuesheet.awbFile);
|
||||
previewAcb = CriAtomExAcb.LoadAcbFile(null, strPreviewAcb, strPreviewAwb);
|
||||
lastCuesheet = cuesheet.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (previewAcb != null) {
|
||||
previewPlayer.player.SetVolume(this.source.volume);
|
||||
previewPlayer.player.SetPitch(this.source.pitch);
|
||||
previewPlayer.player.Loop(this.source.loop);
|
||||
previewPlayer.Play(previewAcb, (source as CriAtomSource).cueName);
|
||||
} else {
|
||||
Debug.LogWarning("[CRIWARE] Specified cue sheet could not be found");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7ba25dde88df304ea6345254cb82626
|
||||
timeCreated: 1433816076
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,221 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriAtomTransceiver)), CanEditMultipleObjects]
|
||||
public class CriAtomTransceiverEditor : UnityEditor.Editor {
|
||||
/* parameters */
|
||||
private SerializedProperty m_regionOnStart;
|
||||
private SerializedProperty m_useDedicatedInput;
|
||||
private SerializedProperty m_dedicatedInput;
|
||||
private SerializedProperty m_outputVolume;
|
||||
private SerializedProperty m_directAudioRadius;
|
||||
private SerializedProperty m_crossFadeDistance;
|
||||
private SerializedProperty m_coneInsideAngle;
|
||||
private SerializedProperty m_coneOutsideAngle;
|
||||
private SerializedProperty m_coneOutsideVolume;
|
||||
private SerializedProperty m_transceiverRadius;
|
||||
private SerializedProperty m_interiorDistance;
|
||||
private SerializedProperty m_minAttenuation;
|
||||
private SerializedProperty m_maxAttenuation;
|
||||
private SerializedProperty m_globalAisacName;
|
||||
private SerializedProperty m_maxAngleAisacDelta;
|
||||
private SerializedProperty m_distanceAisacControlId;
|
||||
private SerializedProperty m_listenerAzimuthAisacControlId;
|
||||
private SerializedProperty m_listenerElevationAisacControlId;
|
||||
private SerializedProperty m_outputAzimuthAisacControlId;
|
||||
private SerializedProperty m_outputElevationAisacControlId;
|
||||
private MethodInfo m_applyParametersMethod;
|
||||
|
||||
static private readonly GUIContent cUseDedicatedInputLabel = new GUIContent("Use Dedicated Input", "Use another game object as input position");
|
||||
static private readonly GUIContent cTranceiverRadiusLabel = new GUIContent("Non-Panning Radius");
|
||||
static private readonly GUIContent cConeInsideAngleLabel = new GUIContent("Inside");
|
||||
static private readonly GUIContent cConeOutsideAngle = new GUIContent("Outside");
|
||||
static private readonly GUIContent cDistanceAisacLabel = new GUIContent("Distance");
|
||||
static private readonly GUIContent cListenerAzimuthAisacLabel = new GUIContent("Listener Azimuth Angle");
|
||||
static private readonly GUIContent cListenerElevationAisacLabel = new GUIContent("Listener Elevation Angle");
|
||||
static private readonly GUIContent cOutputAzimuthAisacLabel = new GUIContent("Output Azimuth Angle");
|
||||
static private readonly GUIContent cOutputElevationAisacLabel = new GUIContent("Output Elevation Angle");
|
||||
|
||||
private void OnEnable() {
|
||||
m_regionOnStart = serializedObject.FindProperty("regionOnStart");
|
||||
m_useDedicatedInput = serializedObject.FindProperty("useDedicatedInput");
|
||||
m_dedicatedInput = serializedObject.FindProperty("dedicatedInput");
|
||||
m_outputVolume = serializedObject.FindProperty("outputVolume");
|
||||
m_directAudioRadius = serializedObject.FindProperty("directAudioRadius");
|
||||
m_crossFadeDistance = serializedObject.FindProperty("crossFadeDistance");
|
||||
m_coneInsideAngle = serializedObject.FindProperty("coneInsideAngle");
|
||||
m_coneOutsideAngle = serializedObject.FindProperty("coneOutsideAngle");
|
||||
m_coneOutsideVolume = serializedObject.FindProperty("coneOutsideVolume");
|
||||
m_transceiverRadius = serializedObject.FindProperty("transceiverRadius");
|
||||
m_interiorDistance = serializedObject.FindProperty("interiorDistance");
|
||||
m_minAttenuation = serializedObject.FindProperty("minAttenuation");
|
||||
m_maxAttenuation = serializedObject.FindProperty("maxAttenuation");
|
||||
m_globalAisacName = serializedObject.FindProperty("globalAisacName");
|
||||
m_maxAngleAisacDelta = serializedObject.FindProperty("maxAngleAisacDelta");
|
||||
m_distanceAisacControlId = serializedObject.FindProperty("distanceAisacControlId");
|
||||
m_listenerAzimuthAisacControlId = serializedObject.FindProperty("listenerAzimuthAisacControlId");
|
||||
m_listenerElevationAisacControlId = serializedObject.FindProperty("listenerElevationAisacControlId");
|
||||
m_outputAzimuthAisacControlId = serializedObject.FindProperty("outputAzimuthAisacControlId");
|
||||
m_outputElevationAisacControlId = serializedObject.FindProperty("outputElevationAisacControlId");
|
||||
|
||||
m_applyParametersMethod = typeof(CriAtomTransceiver).GetMethod("ApplyParameters", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
var targetObj = target as CriAtomTransceiver;
|
||||
|
||||
EditorGUILayout.PropertyField(m_regionOnStart);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(m_useDedicatedInput, cUseDedicatedInputLabel);
|
||||
if (m_useDedicatedInput.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_dedicatedInput);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(m_outputVolume);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Transceiving");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_directAudioRadius);
|
||||
EditorGUILayout.PropertyField(m_crossFadeDistance);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Cone Angles");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_coneInsideAngle, cConeInsideAngleLabel);
|
||||
EditorGUILayout.PropertyField(m_coneOutsideAngle, cConeOutsideAngle);
|
||||
using (var hScope = new EditorGUILayout.HorizontalScope()) {
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
if (GUILayout.Button("Set to Omni-Directional", GUILayout.Width(150))) {
|
||||
m_coneInsideAngle.floatValue = 360f;
|
||||
m_coneOutsideAngle.floatValue = 360f;
|
||||
}
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.PropertyField(m_coneOutsideVolume);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Panning");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_transceiverRadius, cTranceiverRadiusLabel);
|
||||
EditorGUILayout.PropertyField(m_interiorDistance);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Attenuation");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_minAttenuation);
|
||||
EditorGUILayout.PropertyField(m_maxAttenuation);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (targetObj.inspectorAisacSettingFoldout = EditorGUILayout.Foldout(targetObj.inspectorAisacSettingFoldout, "AISAC")) {
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_globalAisacName);
|
||||
EditorGUILayout.PropertyField(m_maxAngleAisacDelta);
|
||||
EditorGUILayout.LabelField("AISAC Control IDs");
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(m_distanceAisacControlId, cDistanceAisacLabel);
|
||||
EditorGUILayout.PropertyField(m_listenerAzimuthAisacControlId, cListenerAzimuthAisacLabel);
|
||||
EditorGUILayout.PropertyField(m_listenerElevationAisacControlId, cListenerElevationAisacLabel);
|
||||
EditorGUILayout.PropertyField(m_outputAzimuthAisacControlId, cOutputAzimuthAisacLabel);
|
||||
EditorGUILayout.PropertyField(m_outputElevationAisacControlId, cOutputElevationAisacLabel);
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
|
||||
if (GUI.changed) {
|
||||
ValidateParameters();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
if (m_applyParametersMethod != null) {
|
||||
m_applyParametersMethod.Invoke(targetObj, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateParameters() {
|
||||
if (m_outputVolume.floatValue < 0) { m_outputVolume.floatValue = 0; }
|
||||
if (m_directAudioRadius.floatValue < 0) { m_directAudioRadius.floatValue = 0; }
|
||||
if (m_crossFadeDistance.floatValue < 0) { m_crossFadeDistance.floatValue = 0; }
|
||||
m_coneInsideAngle.floatValue = Mathf.Clamp(m_coneInsideAngle.floatValue, 0, 360);
|
||||
m_coneOutsideAngle.floatValue = Mathf.Clamp(m_coneOutsideAngle.floatValue, 0, 360);
|
||||
m_coneInsideAngle.floatValue = Mathf.Min(m_coneInsideAngle.floatValue, m_coneOutsideAngle.floatValue);
|
||||
if (m_coneOutsideVolume.floatValue < 0) { m_coneOutsideVolume.floatValue = 0; }
|
||||
if (m_transceiverRadius.floatValue < 0) { m_transceiverRadius.floatValue = 0; }
|
||||
if (m_interiorDistance.floatValue < 0) { m_interiorDistance.floatValue = 0; }
|
||||
if (m_minAttenuation.floatValue < 0) { m_minAttenuation.floatValue = 0; }
|
||||
if (m_maxAttenuation.floatValue < 0) { m_maxAttenuation.floatValue = 0; }
|
||||
m_minAttenuation.floatValue = Mathf.Min(m_minAttenuation.floatValue, m_maxAttenuation.floatValue);
|
||||
if (m_maxAngleAisacDelta.floatValue < 0) { m_maxAngleAisacDelta.floatValue = 0; }
|
||||
}
|
||||
|
||||
private void OnSceneGUI() {
|
||||
var targetObj = target as CriAtomTransceiver;
|
||||
if (targetObj.enabled == false) { return; }
|
||||
|
||||
var transformObj = targetObj.transform;
|
||||
var outsideArcStartVector = Quaternion.AngleAxis(-m_coneOutsideAngle.floatValue / 2f, transformObj.up) * transformObj.forward;
|
||||
var insideArcStartVector = Quaternion.AngleAxis(-m_coneInsideAngle.floatValue / 2f, transformObj.up) * transformObj.forward;
|
||||
float screenSpaceConstant = Mathf.Min(HandleUtility.GetHandleSize(transformObj.position) * 3, targetObj.maxAttenuation);
|
||||
var dedicatedInput = m_dedicatedInput.objectReferenceValue as GameObject;
|
||||
|
||||
Handles.color = new Color(1, 1, 1, 0.3f);
|
||||
Handles.DrawDottedLine(transformObj.position, transformObj.position + transformObj.forward * screenSpaceConstant, 5f);
|
||||
Handles.color = new Color(1, 1, 1, 0.03f);
|
||||
if (m_coneInsideAngle.floatValue < 360) {
|
||||
Handles.DrawSolidArc(transformObj.position, transformObj.up, outsideArcStartVector, m_coneOutsideAngle.floatValue, screenSpaceConstant);
|
||||
Handles.DrawSolidArc(transformObj.position, transformObj.up, insideArcStartVector, m_coneInsideAngle.floatValue, screenSpaceConstant);
|
||||
}
|
||||
Handles.color = new Color(0.627f, 0.890f, 0.388f);
|
||||
Handles.DrawWireArc(transformObj.position, transformObj.up, outsideArcStartVector, m_coneOutsideAngle.floatValue, m_transceiverRadius.floatValue);
|
||||
Handles.color = new Color(1f, 0.537f, 0);
|
||||
Handles.DrawWireArc(transformObj.position, transformObj.up, outsideArcStartVector, m_coneOutsideAngle.floatValue, m_transceiverRadius.floatValue + m_interiorDistance.floatValue);
|
||||
|
||||
Handles.color = new Color(0.890f, 0.862f, 0.388f, 0.1f);
|
||||
if (m_useDedicatedInput.boolValue && dedicatedInput != null) {
|
||||
Handles.DrawSolidDisc(dedicatedInput.transform.position, dedicatedInput.transform.up, m_directAudioRadius.floatValue);
|
||||
} else {
|
||||
Handles.DrawSolidDisc(transformObj.position, transformObj.up, m_directAudioRadius.floatValue);
|
||||
}
|
||||
Handles.color = new Color(0.290f, 0.556f, 0.827f, 0.1f);
|
||||
if (m_useDedicatedInput.boolValue && dedicatedInput != null) {
|
||||
Handles.DrawSolidDisc(dedicatedInput.transform.position, dedicatedInput.transform.up, m_directAudioRadius.floatValue + m_crossFadeDistance.floatValue);
|
||||
} else {
|
||||
Handles.DrawSolidDisc(transformObj.position, transformObj.up, m_directAudioRadius.floatValue + m_crossFadeDistance.floatValue);
|
||||
}
|
||||
|
||||
using (var changeScope = new EditorGUI.ChangeCheckScope()) {
|
||||
Handles.color = new Color(0.3317462f, 0.6611561f, 0.990566f, 0.7f);
|
||||
float minAtt = Handles.RadiusHandle(Quaternion.identity, transformObj.position, targetObj.minAttenuation);
|
||||
float maxAtt = Handles.RadiusHandle(Quaternion.identity, transformObj.position, targetObj.maxAttenuation);
|
||||
if (changeScope.changed) {
|
||||
Undo.RecordObject(target, "Change Transceiver Attenuation");
|
||||
|
||||
minAtt = Mathf.Min(minAtt, maxAtt);
|
||||
targetObj.minAttenuation = minAtt;
|
||||
targetObj.maxAttenuation = maxAtt;
|
||||
|
||||
EditorUtility.SetDirty(target);
|
||||
|
||||
if (m_applyParametersMethod != null) {
|
||||
m_applyParametersMethod.Invoke(targetObj, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
/* end of file */
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79840c63aad7bb44f948a5b0fb1b81d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,89 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/**
|
||||
* \addtogroup CRIWARE_EDITOR_UTILITY
|
||||
* @{
|
||||
*/
|
||||
|
||||
namespace CriWare.Editor {
|
||||
|
||||
/**
|
||||
* <summary>This is a class used for bouncing the audio output to a file.</summary>
|
||||
* <remarks>
|
||||
* <para header='Description'>This class can be used to bounce the audio output from the ASR.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public static class CriAtomWaveFile
|
||||
{
|
||||
|
||||
/**
|
||||
* <summary>Starts the bouncing</summary>
|
||||
* <param name='path'>File path for the bouncing output</param>
|
||||
* <param name='numChannels'>Number of channels in the bounced output file (1, 2, 4, 6 or 8)</param>
|
||||
* <returns>Whether the bouncing has been started</returns>
|
||||
* <remarks>
|
||||
* <para header='Description'>Starts bouncing with the specified parameters.<br/>
|
||||
* 1, 2, 4, 6 or 8 can be specified for numChannels.<br/>
|
||||
* If numChannels is less than the number of ASR output channels, it will be automatically downmixed to the specified number of channels before bouncing.<br/>
|
||||
* If the number of numChannels is larger than the number of output channels of ASR, silence will be recorded for the extra channels.<br/></para>
|
||||
* </remarks>
|
||||
* <seealso cref='CriWare.Editor.CriAtomWaveFile.StopBounce'/>
|
||||
*/
|
||||
public static bool StartBounce(string path, uint numChannels)
|
||||
{
|
||||
return criAtomWaveFile_StartBounce(path, numChannels);
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Stops the bouncing</summary>
|
||||
* <remarks>
|
||||
* <para header='Description'>Stops the bouncing initiated by CriWare.Editor.CriAtomWaveFile.StartBounce .</para>
|
||||
* </remarks>
|
||||
* <seealso cref='CriWare.Editor.CriAtomWaveFile.StartBounce'/>
|
||||
*/
|
||||
public static void StopBounce()
|
||||
{
|
||||
criAtomWaveFile_StopBounce();
|
||||
}
|
||||
|
||||
/**
|
||||
* <summary>Acquiring the duration (expressed in ms) of the bounced waveform</summary>
|
||||
* <returns>Duration of the bounced waveform</returns>
|
||||
* <remarks>
|
||||
* <para header='Description'>Gets the duration of the bounced waveform, expressed in milliseconds.</para>
|
||||
* </remarks>
|
||||
*/
|
||||
public static uint GetBounceTime()
|
||||
{
|
||||
return criAtomWaveFile_GetBounceTime();
|
||||
}
|
||||
|
||||
#region DLL Import
|
||||
#if (UNITY_EDITOR && !UNITY_EDITOR_LINUX) && !CRIWARE_ENABLE_HEADLESS_MODE
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern bool criAtomWaveFile_StartBounce(string path, System.UInt32 num_channels);
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern void criAtomWaveFile_StopBounce();
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern System.UInt32 criAtomWaveFile_GetBounceTime();
|
||||
#else
|
||||
private static bool criAtomWaveFile_StartBounce(string path, System.UInt32 num_channels) { return false; }
|
||||
private static void criAtomWaveFile_StopBounce() { }
|
||||
private static System.UInt32 criAtomWaveFile_GetBounceTime() { return 0; }
|
||||
#endif
|
||||
#endregion
|
||||
}
|
||||
|
||||
} //namespace CriWare.Editor
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* end of file */
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b84f2ec5e0ac4724ac25c0df9625a72
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,743 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if UNITY_2017 && UNITY_EDITOR_WIN
|
||||
#define OPENFOLDERPANEL_IS_BROKEN
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
public sealed class CriAtomWindow : EditorWindow
|
||||
{
|
||||
#region Variables
|
||||
private int selectedAcfId = 0;
|
||||
private int selectedDspBusSettingId = 0;
|
||||
private int selectedCueInfoIndex = 0;
|
||||
private int selectedCueSheetId = 0;
|
||||
private string lastLoadedAcbGuid = null;
|
||||
private string lastLoadedAcfGuid = null;
|
||||
private bool isCueSheetListInitiated = false;
|
||||
private int lastPreviewCueSheetId = -1;
|
||||
private Vector2 scrollPosCueSheetList;
|
||||
private Vector2 scrollPosCueList;
|
||||
private Vector2 scrollPosWindow;
|
||||
private bool useCopyAssetsFromCriAtomCraft = false;
|
||||
private string[] popupAcfList = null;
|
||||
private Color currentGuiColor;
|
||||
private float cuesheetListWidth = 200;
|
||||
private float cueIdListWidth = 70;
|
||||
private bool isResizingLeftSplitter = false;
|
||||
private bool isResizingRightSplitter = false;
|
||||
private Vector2 lastMousePosLeftSplitter = new Vector2();
|
||||
private Vector2 lastMousePosRightSplitter = new Vector2();
|
||||
|
||||
private GameObject targetObject = null;
|
||||
private CriAtomSource targetAtomSource = null;
|
||||
private CriWare.Editor.CriAtomEditorUtilities.PreviewPlayer previewPlayer = null;
|
||||
private CriAtomExAcb previewAcb = null;
|
||||
|
||||
/* @cond excludele */
|
||||
private ulong acbKey = 0;
|
||||
private ulong lastAcbKey = 0;
|
||||
private string lastSelectedAcbGuid = null;
|
||||
/* @endcond */
|
||||
|
||||
[SerializeField] private string searchPath = "";
|
||||
[SerializeField] private CriAtomWindowInfo projInfo = new CriAtomWindowInfo();
|
||||
[SerializeField] private CriAtomWindowPrefs criAtomWindowPrefs = null;
|
||||
[SerializeField] private GUIStyle toolBarButtonStyle = null;
|
||||
|
||||
[SerializeField] private bool showPrivateCue = false;
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
[MenuItem("Window/CRIWARE/Atom Browser", false, 100)]
|
||||
static void OpenWindow()
|
||||
{
|
||||
EditorWindow.GetWindow<CriAtomWindow>(false, "Atom Browser");
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
searchPath = Application.streamingAssetsPath;
|
||||
criAtomWindowPrefs = CriAtomWindowPrefs.Load();
|
||||
|
||||
/* @cond excludele */
|
||||
if (criAtomWindowPrefs.useCommonKey) {
|
||||
var initializerObj = FindObjectOfType<CriWareInitializer>();
|
||||
ulong parsedKey = 0;
|
||||
if (initializerObj != null && initializerObj.useDecrypter == true && initializerObj.decrypterConfig != null
|
||||
&& ulong.TryParse(initializerObj.decrypterConfig.key, out parsedKey)) {
|
||||
criAtomWindowPrefs.SetOrRenewKeyThenSave("any", parsedKey);
|
||||
}
|
||||
}
|
||||
/* @endcond */
|
||||
|
||||
if (Selection.gameObjects.Length > 0) {
|
||||
targetObject = Selection.gameObjects[0];
|
||||
targetAtomSource = targetObject.GetComponent<CriAtomSource>();
|
||||
}
|
||||
|
||||
ReloadAcbInfo();
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
previewAcb = null;
|
||||
}
|
||||
lastLoadedAcbGuid = null;
|
||||
if (previewPlayer != null) {
|
||||
previewPlayer.Dispose();
|
||||
previewPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectionChange() {
|
||||
if (Selection.gameObjects.Length > 0) {
|
||||
targetObject = Selection.gameObjects[0];
|
||||
targetAtomSource = targetObject.GetComponent<CriAtomSource>();
|
||||
}
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void OnLostFocus() {
|
||||
StopPreview();
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
previewAcb = null;
|
||||
}
|
||||
lastLoadedAcbGuid = null;
|
||||
}
|
||||
|
||||
private void OnGUI() {
|
||||
if (toolBarButtonStyle == null) {
|
||||
toolBarButtonStyle = new GUIStyle(EditorStyles.toolbarButton);
|
||||
toolBarButtonStyle.alignment = TextAnchor.MiddleLeft;
|
||||
}
|
||||
|
||||
currentGuiColor = GUI.color;
|
||||
this.scrollPosWindow = GUILayout.BeginScrollView(this.scrollPosWindow);
|
||||
{
|
||||
GUISearchAndReload();
|
||||
GUIACFSettings();
|
||||
GUICueList();
|
||||
EditorGUILayout.Space();
|
||||
GUIImportAssetsFromAtomCraft();
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
GUI.color = currentGuiColor;
|
||||
}
|
||||
|
||||
private void ReloadAcbInfo() {
|
||||
TryInitializePlugin();
|
||||
projInfo.GetAcfInfoList(true, searchPath);
|
||||
projInfo.GetAcbInfoList(true, searchPath);
|
||||
selectedAcfId = 0;
|
||||
selectedDspBusSettingId = 0;
|
||||
selectedCueSheetId = 0;
|
||||
selectedCueInfoIndex = 0;
|
||||
ResetDataRecord();
|
||||
}
|
||||
|
||||
private void ResetDataRecord() {
|
||||
lastLoadedAcfGuid = null;
|
||||
lastLoadedAcbGuid = null;
|
||||
}
|
||||
|
||||
private void PlayPreview(CriAtomExAcb acb, string cuename) {
|
||||
if (previewPlayer == null) {
|
||||
previewPlayer = new CriWare.Editor.CriAtomEditorUtilities.PreviewPlayer();
|
||||
}
|
||||
previewPlayer.Play(acb, cuename);
|
||||
}
|
||||
|
||||
private void StopPreview(bool withoutRelease = true) {
|
||||
if (previewPlayer != null) {
|
||||
previewPlayer.Stop(withoutRelease);
|
||||
}
|
||||
}
|
||||
|
||||
private void TryInitializePlugin() {
|
||||
if (CriAtomPlugin.IsLibraryInitialized() == false) {
|
||||
previewAcb = null;
|
||||
}
|
||||
if (CriWare.Editor.CriAtomEditorUtilities.InitializeLibrary()) {
|
||||
ResetDataRecord();
|
||||
}
|
||||
}
|
||||
|
||||
private void GUISearchAndReload()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
this.searchPath = EditorGUILayout.TextField("Path to Search", this.searchPath);
|
||||
#if !OPENFOLDERPANEL_IS_BROKEN
|
||||
if (GUILayout.Button("...", EditorStyles.miniButton, GUILayout.Width(50)))
|
||||
{
|
||||
string pathTemp = EditorUtility.OpenFolderPanel("Select folder to search", this.searchPath, "");
|
||||
if (string.IsNullOrEmpty(pathTemp) == false) {
|
||||
if (pathTemp.Contains(Application.dataPath)) {
|
||||
this.searchPath = pathTemp;
|
||||
ReloadAcbInfo();
|
||||
} else {
|
||||
Debug.LogWarning("[CRIWARE] Selected folder should be inside this project. Search path will not be changed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (GUILayout.Button("Reload Info", EditorStyles.miniButton, GUILayout.Width(100))) {
|
||||
ReloadAcbInfo();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void GUIACFSettings()
|
||||
{
|
||||
var acfInfo = projInfo.GetAcfInfoList(false, this.searchPath);
|
||||
popupAcfList = new string[acfInfo.Count];
|
||||
for (int i = 0; i < acfInfo.Count; i++) {
|
||||
popupAcfList[i] = acfInfo[i].filePath;
|
||||
}
|
||||
if (acfInfo.Count > 0) {
|
||||
selectedAcfId = EditorGUILayout.Popup("ACF Files", selectedAcfId, popupAcfList);
|
||||
selectedDspBusSettingId = EditorGUILayout.Popup("DSPBusSettings", selectedDspBusSettingId, acfInfo[selectedAcfId].dspBusSettingsList.ToArray());
|
||||
} else {
|
||||
EditorGUILayout.LabelField("ACF Files", "No ACF has been found");
|
||||
EditorGUILayout.LabelField("DSPBusSettings", "-");
|
||||
}
|
||||
}
|
||||
|
||||
private void GUICueList()
|
||||
{
|
||||
const int cCueListItemHeight = 18;
|
||||
var acfInfoList = projInfo.GetAcfInfoList(false, this.searchPath);
|
||||
var acbInfoList = projInfo.GetAcbInfoList(false, searchPath);
|
||||
bool isAcfInfoAvailable = (selectedAcfId > acfInfoList.Count) && (selectedDspBusSettingId > acfInfoList[selectedAcfId].dspBusSettingsList.Count);
|
||||
bool isCueSheetAvailable = false;
|
||||
Rect splitterRect;
|
||||
|
||||
if (isCueSheetListInitiated == true) {
|
||||
lastPreviewCueSheetId = this.selectedCueSheetId;
|
||||
} else {
|
||||
isCueSheetListInitiated = true;
|
||||
}
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
/* cuesheet list */
|
||||
using (var cuesheetListScope = new EditorGUILayout.VerticalScope("CN Box", GUILayout.Width(cuesheetListWidth))) {
|
||||
using (var horizontalScope = new EditorGUILayout.HorizontalScope()) {
|
||||
if (GUILayout.Button("Cue Sheet", toolBarButtonStyle)) {
|
||||
projInfo.SortCueSheet();
|
||||
this.selectedCueSheetId = 0;
|
||||
}
|
||||
}
|
||||
using (var cuesheetScrollViewScope = new EditorGUILayout.ScrollViewScope(scrollPosCueSheetList)) {
|
||||
scrollPosCueSheetList = cuesheetScrollViewScope.scrollPosition;
|
||||
int listLengthInView = (int)position.height / cCueListItemHeight;
|
||||
int idFirstItemInView = Mathf.Clamp((int)scrollPosCueSheetList.y / cCueListItemHeight, 0, Mathf.Max(0, acbInfoList.Count - listLengthInView));
|
||||
|
||||
GUILayout.Space(idFirstItemInView * cCueListItemHeight);
|
||||
for (int i = idFirstItemInView; i < Mathf.Min(idFirstItemInView + listLengthInView, acbInfoList.Count); i++) {
|
||||
GUI.color = (this.lastPreviewCueSheetId == i) ? Color.yellow : currentGuiColor;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button(acbInfoList[i].name, EditorStyles.label)) {
|
||||
this.selectedCueSheetId = i;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
GUILayout.Space(Mathf.Max(0, acbInfoList.Count - idFirstItemInView - listLengthInView) * cCueListItemHeight);
|
||||
GUI.color = currentGuiColor;
|
||||
}
|
||||
}
|
||||
|
||||
splitterRect = EditorGUILayout.GetControlRect(false, 2, "CN Box", GUILayout.Width(2), GUILayout.ExpandHeight(true));
|
||||
cuesheetListWidth += GUILayoutResizeHandler(splitterRect, true, ref lastMousePosLeftSplitter, ref isResizingLeftSplitter).x;
|
||||
|
||||
if (this.selectedCueSheetId != lastPreviewCueSheetId) {
|
||||
this.selectedCueInfoIndex = 0;
|
||||
}
|
||||
|
||||
isCueSheetAvailable = (acbInfoList.Count > this.selectedCueSheetId);
|
||||
|
||||
using (var cueListAndInfoScope = new EditorGUILayout.VerticalScope("CN Box")) {
|
||||
bool playButtonPushed = false;
|
||||
bool isCueAvailable = false;
|
||||
CriAtomWindowInfo.CueInfo selectedCueInfo = null;
|
||||
/* @cond excludele */
|
||||
bool saveKeyButtonPushed = false;
|
||||
bool commonKeyToggled = false;
|
||||
/* @endcond */
|
||||
|
||||
/* list title */
|
||||
using (var cueListTitleScope = new EditorGUILayout.HorizontalScope()) {
|
||||
if (GUILayout.Button("Cue Name", toolBarButtonStyle)) {
|
||||
if (isCueSheetAvailable) {
|
||||
acbInfoList[selectedCueSheetId].SortCueInfo(CriAtomWindowInfo.CueSortType.Name);
|
||||
this.selectedCueInfoIndex = 0;
|
||||
}
|
||||
}
|
||||
splitterRect = EditorGUILayout.GetControlRect(false, 20, toolBarButtonStyle, GUILayout.Width(2));
|
||||
cueIdListWidth -= GUILayoutResizeHandler(splitterRect, true, ref lastMousePosRightSplitter, ref isResizingRightSplitter).x;
|
||||
if (GUILayout.Button("Cue ID", toolBarButtonStyle, GUILayout.Width(cueIdListWidth + 20))) {
|
||||
if (isCueSheetAvailable) {
|
||||
acbInfoList[selectedCueSheetId].SortCueInfo(CriAtomWindowInfo.CueSortType.Id);
|
||||
this.selectedCueInfoIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* cue list */
|
||||
using (var cueListScope = new EditorGUILayout.ScrollViewScope(scrollPosCueList, GUILayout.ExpandHeight(true))) {
|
||||
scrollPosCueList = cueListScope.scrollPosition;
|
||||
if (isCueSheetAvailable) {
|
||||
var acbInfo = acbInfoList[this.selectedCueSheetId];
|
||||
List<CriAtomWindowInfo.CueInfo> currentList;
|
||||
if (this.showPrivateCue) {
|
||||
currentList = acbInfo.cueInfoList;
|
||||
} else {
|
||||
currentList = acbInfo.publicCueInfoList;
|
||||
}
|
||||
|
||||
if (currentList.Count <= 0) {
|
||||
EditorGUILayout.HelpBox("Nothing to be shown here.\nTry push the \"Reload Info\" button to refresh the list.", MessageType.Error);
|
||||
} else {
|
||||
int listLengthInView = (int)position.height / cCueListItemHeight;
|
||||
int idFirstCueInView = Mathf.Clamp((int)scrollPosCueList.y / cCueListItemHeight, 0, Mathf.Max(0, currentList.Count - listLengthInView));
|
||||
|
||||
GUILayout.Space(idFirstCueInView * cCueListItemHeight);
|
||||
for (int i = idFirstCueInView; i < Mathf.Min(idFirstCueInView + listLengthInView, currentList.Count); ++i) {
|
||||
GUI.color = (this.selectedCueInfoIndex == i) ? Color.yellow : currentGuiColor;
|
||||
using (var cueItemScope = new EditorGUILayout.HorizontalScope(GUILayout.Height(cCueListItemHeight))) {
|
||||
if (GUILayout.Button(EditorGUIUtility.IconContent("Animation.Play"), EditorStyles.miniButton, GUILayout.Width(30))) {
|
||||
this.selectedCueInfoIndex = i;
|
||||
playButtonPushed = true;
|
||||
}
|
||||
if (GUILayout.Button(currentList[i].name + " (" + (currentList[i].length < 0 ? "loop" : Ms2String(currentList[i].length)) + ")", EditorStyles.label)) {
|
||||
if (selectedCueInfoIndex != i) {
|
||||
StopPreview();
|
||||
}
|
||||
this.selectedCueInfoIndex = i;
|
||||
}
|
||||
GUILayout.Label(currentList[i].id.ToString(), GUILayout.Width(cueIdListWidth));
|
||||
}
|
||||
}
|
||||
GUILayout.Space(Mathf.Max(0, currentList.Count - idFirstCueInView - listLengthInView) * cCueListItemHeight);
|
||||
GUI.color = currentGuiColor;
|
||||
}
|
||||
|
||||
isCueAvailable = currentList.Count > this.selectedCueInfoIndex;
|
||||
if (isCueAvailable) {
|
||||
selectedCueInfo = currentList[selectedCueInfoIndex];
|
||||
}
|
||||
} else {
|
||||
EditorGUILayout.HelpBox("No cue sheet is found.\nPlease check the search path. Press \"Reload Info\" button to refresh the list.", MessageType.Info);
|
||||
}
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
if (isCueSheetAvailable) {
|
||||
var acbInfo = acbInfoList[selectedCueSheetId];
|
||||
if (acbInfo.assetGuid != lastSelectedAcbGuid) {
|
||||
this.lastAcbKey = criAtomWindowPrefs.GetKey(acbInfo.assetGuid);
|
||||
this.acbKey = this.lastAcbKey;
|
||||
GUI.FocusControl(null);
|
||||
}
|
||||
this.lastSelectedAcbGuid = acbInfo.assetGuid;
|
||||
}
|
||||
/* @endcond */
|
||||
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar,GUILayout.ExpandWidth(true));
|
||||
{
|
||||
{
|
||||
var tempToggleVal = GUILayout.Toggle(this.showPrivateCue, "Show Private Cue", GUILayout.Width(120));
|
||||
if (tempToggleVal != this.showPrivateCue) {
|
||||
/* Clear cue selection when change setting */
|
||||
this.selectedCueInfoIndex = 0;
|
||||
}
|
||||
this.showPrivateCue = tempToggleVal;
|
||||
}
|
||||
if (GUILayout.Button("Stop All", EditorStyles.toolbarButton, GUILayout.Width(100))) {
|
||||
StopPreview();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
/* @cond excludele */
|
||||
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar,GUILayout.ExpandWidth(true));
|
||||
{
|
||||
GUILayout.Label("Decryption Key:", GUILayout.Width(100));
|
||||
this.acbKey = (ulong)Math.Abs(EditorGUILayout.LongField("", (long)this.acbKey, EditorStyles.miniTextField, GUILayout.Width(100)));
|
||||
if (GUILayout.Button("Save", EditorStyles.toolbarButton, GUILayout.Width(40))) { saveKeyButtonPushed = true; GUI.FocusControl(null);}
|
||||
{
|
||||
var tempToggleVal = GUILayout.Toggle(criAtomWindowPrefs.useCommonKey, "Common Key", GUILayout.Width(100));
|
||||
if (tempToggleVal != criAtomWindowPrefs.useCommonKey) {
|
||||
commonKeyToggled = true;
|
||||
}
|
||||
criAtomWindowPrefs.useCommonKey = tempToggleVal;
|
||||
}
|
||||
if (GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Width(50))) { this.acbKey = 0; saveKeyButtonPushed = true; }
|
||||
if (GUILayout.Button("Clear All Saved", EditorStyles.toolbarButton, GUILayout.Width(100))) { this.acbKey = 0; saveKeyButtonPushed = true; criAtomWindowPrefs.ClearKeysAndSave(); }
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
/* @endcond */
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginHorizontal("AppToolbar");
|
||||
{
|
||||
GUILayout.Label("Cue Information");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.LabelField("Cue ID", (isCueSheetAvailable && isCueAvailable) ? selectedCueInfo.id.ToString() : "N/A");
|
||||
string cueName = "N/A";
|
||||
string userData = "";
|
||||
if (isCueSheetAvailable && isCueAvailable) {
|
||||
cueName = selectedCueInfo.name;
|
||||
userData = selectedCueInfo.comment;
|
||||
}
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Cue Name", GUILayout.Width(145));
|
||||
GUILayout.Label(cueName, GUILayout.ExpandWidth(false));
|
||||
if (GUILayout.Button("Copy", GUILayout.Width(100))) {
|
||||
GUIUtility.systemCopyBuffer = cueName;
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
EditorGUILayout.LabelField("User Data", userData, EditorStyles.wordWrappedLabel, GUILayout.Height(28));
|
||||
|
||||
if (GUI.changed && isCueSheetAvailable) {
|
||||
CriAtomWindowInfo.AcfInfo acfInfo = null;
|
||||
var acbInfo = acbInfoList[selectedCueSheetId];
|
||||
if (isAcfInfoAvailable) {
|
||||
acfInfo = acfInfoList[selectedAcfId];
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
if (commonKeyToggled) {
|
||||
this.acbKey = criAtomWindowPrefs.GetKey(acbInfo.assetGuid);
|
||||
this.lastAcbKey = this.acbKey;
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
}
|
||||
previewAcb = null;
|
||||
lastLoadedAcbGuid = null;
|
||||
}
|
||||
if (saveKeyButtonPushed && acbKey != lastAcbKey) {
|
||||
criAtomWindowPrefs.SetOrRenewKeyThenSave(acbInfoList[selectedCueSheetId].assetGuid, this.acbKey);
|
||||
this.lastAcbKey = this.acbKey;
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
}
|
||||
previewAcb = null;
|
||||
lastLoadedAcbGuid = null;
|
||||
}
|
||||
/* @endcond */
|
||||
if (playButtonPushed && isCueAvailable) {
|
||||
StopPreview();
|
||||
|
||||
TryInitializePlugin();
|
||||
if (isAcfInfoAvailable == false) {
|
||||
CriAtomEx.UnregisterAcf();
|
||||
lastLoadedAcfGuid = null;
|
||||
selectedDspBusSettingId = 0;
|
||||
} else if (lastLoadedAcfGuid != acfInfo.assetGuid) {
|
||||
CriAtomEx.UnregisterAcf();
|
||||
CriAtomEx.RegisterAcf(null, Path.Combine(CriWare.Common.streamingAssetsPath, acfInfo.filePath));
|
||||
lastLoadedAcfGuid = acfInfo.assetGuid;
|
||||
selectedDspBusSettingId = 0;
|
||||
}
|
||||
if (lastLoadedAcbGuid != acbInfo.assetGuid) {
|
||||
if (previewAcb != null) {
|
||||
previewAcb.Dispose();
|
||||
}
|
||||
previewAcb = CriAtomExAcb.LoadAcbFile(
|
||||
null,
|
||||
Path.Combine(CriWare.Common.streamingAssetsPath, acbInfo.acbPath),
|
||||
string.IsNullOrEmpty(acbInfo.awbPath) ? null : Path.Combine(CriWare.Common.streamingAssetsPath, acbInfo.awbPath)
|
||||
);
|
||||
/* @cond excludele */
|
||||
if (this.acbKey != 0) {
|
||||
previewAcb.Decrypt(this.acbKey, 0);
|
||||
}
|
||||
/* @endcond */
|
||||
lastLoadedAcbGuid = acbInfo.assetGuid;
|
||||
}
|
||||
if (previewAcb != null) {
|
||||
CriAtomEx.DetachDspBusSetting();
|
||||
if (isAcfInfoAvailable) {
|
||||
CriAtomEx.AttachDspBusSetting(acfInfo.dspBusSettingsList[selectedDspBusSettingId]);
|
||||
}
|
||||
PlayPreview(previewAcb, selectedCueInfo.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* edit buttons */
|
||||
GUIEdit();
|
||||
} /* cueListAndInfoScope */
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void GUIEdit()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
if (GUILayout.Button("Create GameObject", GUILayout.Height(22))) {
|
||||
this.CreateAtomSourceGameObject(true);
|
||||
}
|
||||
|
||||
if (this.targetObject == null) {
|
||||
GUI.enabled = false;
|
||||
}
|
||||
if (GUILayout.Button("Add Component", GUILayout.Height(22))) {
|
||||
if (targetObject != null) {
|
||||
if (targetAtomSource != null) {
|
||||
if (EditorUtility.DisplayDialog("Duplicate Component", "CriAtomSource Component already exists. \nDo you really want to add more?", "Yes", "Cancel")) {
|
||||
this.CreateAtomSourceGameObject(false);
|
||||
}
|
||||
} else {
|
||||
this.CreateAtomSourceGameObject(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.targetAtomSource == null) {
|
||||
GUI.enabled = false;
|
||||
}
|
||||
if (GUILayout.Button("Update Component", GUILayout.Height(22))) {
|
||||
if (targetAtomSource != null) {
|
||||
var acbInfoList = projInfo.GetAcbInfoList(false, searchPath);
|
||||
if (acbInfoList.Count > this.selectedCueSheetId) {
|
||||
var acbInfo = acbInfoList[this.selectedCueSheetId];
|
||||
var cueInfo = acbInfo.cueInfoList[this.selectedCueInfoIndex];
|
||||
Undo.RegisterCompleteObjectUndo(targetAtomSource, "AtomSource Update");
|
||||
targetAtomSource.cueSheet = acbInfo.name;
|
||||
targetAtomSource.cueName = cueInfo.name;
|
||||
Selection.activeGameObject = targetObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
GUI.enabled = true;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void GUIImportAssetsFromAtomCraft()
|
||||
{
|
||||
if (criAtomWindowPrefs == null) {
|
||||
criAtomWindowPrefs = CriAtomWindowPrefs.Load();
|
||||
}
|
||||
|
||||
useCopyAssetsFromCriAtomCraft = CriFoldout(useCopyAssetsFromCriAtomCraft, "Import Assets from Atom Craft Project");
|
||||
if (useCopyAssetsFromCriAtomCraft) {
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
if (criAtomWindowPrefs != null) {
|
||||
criAtomWindowPrefs.outputAssetsRoot = EditorGUILayout.TextField("Import From:", criAtomWindowPrefs.outputAssetsRoot);
|
||||
}
|
||||
|
||||
#if !OPENFOLDERPANEL_IS_BROKEN
|
||||
if (GUILayout.Button("...", EditorStyles.miniButton, GUILayout.Width(50))) {
|
||||
string tmpPath = "";
|
||||
string errorMsg;
|
||||
tmpPath = EditorUtility.OpenFolderPanel("Select CRI Atom Craft output Assets Folder", criAtomWindowPrefs.outputAssetsRoot, "");
|
||||
if (CheckPathIsAtomCraftAssetRoot(tmpPath, out errorMsg)) {
|
||||
criAtomWindowPrefs.outputAssetsRoot = tmpPath;
|
||||
criAtomWindowPrefs.Save();
|
||||
} else {
|
||||
Debug.LogWarning(errorMsg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUI.color = Color.yellow;
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
if (GUILayout.Button("Import Assets", GUILayout.Width(160), GUILayout.Height(40))) {
|
||||
string errorMsg;
|
||||
if (CheckPathIsAtomCraftAssetRoot(criAtomWindowPrefs.outputAssetsRoot, out errorMsg) == false) {
|
||||
Debug.LogWarning(errorMsg);
|
||||
} else {
|
||||
try {
|
||||
CopyDirectory(criAtomWindowPrefs.outputAssetsRoot, Application.dataPath);
|
||||
Debug.Log("[CRIWARE] Assets successfully imported from " + criAtomWindowPrefs.outputAssetsRoot);
|
||||
} catch (Exception ex) {
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError("[CRIWARE] Failed to import assets from " + criAtomWindowPrefs.outputAssetsRoot);
|
||||
}
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
ReloadAcbInfo();
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
EditorGUILayout.HelpBox("Copy \"Assets\" folder (created in CRI Atom Craft) to the \"StreamingAssets\" folder.\nThe folder can be created by building with the \"With Unity Assets\" flag in CRI Atom Craft.", MessageType.Info);
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckPathIsAtomCraftAssetRoot(string outString, out string errorMsg)
|
||||
{
|
||||
errorMsg = "";
|
||||
try {
|
||||
if (string.IsNullOrEmpty(outString) == false && Path.GetFileName(outString) == "Assets") {
|
||||
if (Directory.Exists(outString) == false) {
|
||||
errorMsg = "[CRIWARE] Path to the assets does not exist: " + outString;
|
||||
return false;
|
||||
}
|
||||
foreach (string dir in Directory.GetDirectories(outString)) {
|
||||
if (Path.GetFileName(dir) == "Editor") {
|
||||
errorMsg = "[CRIWARE] Please choose the Assets folder in your <color=yellow>Atom Craft project</color> instead of the one in your Unity project. Import path will not be changed.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
errorMsg = "[CRIWARE] Unmatched folder name. Please set the right import path (\"Assets\" folder).";
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
errorMsg = "[CRIWARE] I/O Error: " + ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyDirectory(string sourceDirName, string destDirName)
|
||||
{
|
||||
try {
|
||||
if (Directory.Exists(destDirName) == false) {
|
||||
Directory.CreateDirectory(destDirName);
|
||||
File.SetAttributes(destDirName, File.GetAttributes(sourceDirName));
|
||||
}
|
||||
|
||||
foreach (var file in Directory.GetFiles(sourceDirName)) {
|
||||
string ext = Path.GetExtension(file.Replace("\\", "/"));
|
||||
if (ext == ".acf" || ext == ".acb" || ext == ".awb") {
|
||||
string targetPath = Path.Combine(destDirName, Path.GetFileName(file));
|
||||
Debug.Log(String.Format("[CRIWARE] Copying \"{0}\" to \"{1}\"", file, targetPath));
|
||||
File.Copy(file, targetPath, true);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var dir in Directory.GetDirectories(sourceDirName)) {
|
||||
/* sub directories */
|
||||
CopyDirectory(dir, Path.Combine(destDirName, Path.GetFileName(dir)));
|
||||
}
|
||||
} catch {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateAtomSourceGameObject(bool createGameObjectFlag)
|
||||
{
|
||||
if (Selection.gameObjects.Length == 0) {
|
||||
createGameObjectFlag = true;
|
||||
}
|
||||
var acbInfoList = projInfo.GetAcbInfoList(false, searchPath);
|
||||
if (acbInfoList.Count > this.selectedCueSheetId) {
|
||||
GameObject go = null;
|
||||
if (createGameObjectFlag) {
|
||||
go = new GameObject(acbInfoList[this.selectedCueSheetId].cueInfoList[this.selectedCueInfoIndex].name + "(CriAtomSource)");
|
||||
if (Selection.gameObjects.Length > 0) {
|
||||
go.transform.parent = Selection.gameObjects[0].transform;
|
||||
}
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create AtomSource GameObject");
|
||||
} else {
|
||||
go = Selection.gameObjects[0];
|
||||
}
|
||||
var acbInfo = acbInfoList[this.selectedCueSheetId];
|
||||
CriAtom atom = GameObject.FindObjectOfType(typeof(CriAtom)) as CriAtom;
|
||||
if (atom == null) {
|
||||
var criObject = GameObject.Find("/CRIWARE");
|
||||
if (criObject == null) {
|
||||
criObject = new GameObject("CRIWARE");
|
||||
Undo.RegisterCreatedObjectUndo(criObject, "Add CRIWARE GameObject");
|
||||
}
|
||||
atom = Undo.AddComponent<CriAtom>(criObject);
|
||||
var acfList = projInfo.GetAcfInfoList(false, searchPath);
|
||||
if (acfList.Count > selectedAcfId) {
|
||||
atom.acfFile = acfList[selectedAcfId].filePath;
|
||||
}
|
||||
}
|
||||
CriAtomCueSheet cueSheet = atom.GetCueSheetInternal(acbInfo.name);
|
||||
if (cueSheet == null) {
|
||||
cueSheet = atom.AddCueSheetInternal(null, acbInfo.acbPath, acbInfo.awbPath, null);
|
||||
}
|
||||
CriAtomSource newCriAtomSource = Undo.AddComponent<CriAtomSource>(go);
|
||||
newCriAtomSource.cueSheet = cueSheet.name;
|
||||
newCriAtomSource.cueName = acbInfo.cueInfoList[this.selectedCueInfoIndex].name;
|
||||
Selection.activeObject = go;
|
||||
}
|
||||
}
|
||||
|
||||
private Vector2 GUILayoutResizeHandler(Rect rect, bool isVertical, ref Vector2 lastMousePos, ref bool isResizing) {
|
||||
EditorGUIUtility.AddCursorRect(rect, isVertical ? MouseCursor.SplitResizeLeftRight : MouseCursor.SplitResizeUpDown);
|
||||
|
||||
if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition)) {
|
||||
lastMousePos = Event.current.mousePosition;
|
||||
isResizing = true;
|
||||
}
|
||||
|
||||
if (isResizing) {
|
||||
var mousePos = Event.current.mousePosition;
|
||||
GUI.DrawTexture(new Rect(isVertical ? new Vector2(mousePos.x, rect.y) : new Vector2(rect.x, mousePos.y), rect.size), EditorGUIUtility.whiteTexture);
|
||||
Repaint();
|
||||
if (new Rect(Vector2.zero, this.position.size).Contains(mousePos) == false) {
|
||||
isResizing = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Event.current.type == EventType.MouseUp) {
|
||||
if (isResizing) {
|
||||
isResizing = false;
|
||||
return Event.current.mousePosition - lastMousePos;
|
||||
}
|
||||
isResizing = false;
|
||||
}
|
||||
|
||||
return Vector2.zero;
|
||||
}
|
||||
|
||||
private string Ms2String(long timeMs) {
|
||||
long hh, mm, ss, ms;
|
||||
hh = timeMs / 3600000;
|
||||
mm = (timeMs % 3600000) / 60000;
|
||||
ss = (timeMs % 60000) / 1000;
|
||||
ms = timeMs % 1000;
|
||||
string res = ((hh > 0) ? hh.ToString("00") + ":" : "") + ((mm > 0) ? mm.ToString("00") + ":" : "") + ss.ToString("00") + ":" + ms.ToString("000");
|
||||
return res;
|
||||
}
|
||||
|
||||
private bool CriFoldout(bool foldout, string content) {
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
return EditorGUILayout.Foldout(foldout, content, true);
|
||||
#else
|
||||
return EditorGUILayout.Foldout(foldout, content);
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bacfcb712a3304a40b91990e9f581c6d
|
||||
timeCreated: 1433816076
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,19 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7dbb5a65a01a1de4ebfe0c4a1352cc1a, type: 3}
|
||||
m_Name: CriAtomWindowPrefs
|
||||
m_EditorClassIdentifier:
|
||||
outputAssetsRoot:
|
||||
useCommonKey: 1
|
||||
cuesheetKeyList:
|
||||
- cuesheetGuid: 000000000
|
||||
key: 75923756697503
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88e77466f0e64194e982232dcf64d4e7
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,401 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[Serializable]
|
||||
public class CriAtomWindowPrefs : ScriptableObject
|
||||
{
|
||||
public string outputAssetsRoot = String.Empty;
|
||||
|
||||
/* @cond excludele */
|
||||
static readonly private string commonCuesheetGuid = "000000000";
|
||||
|
||||
public bool useCommonKey = true;
|
||||
[SerializeField] private List<CueSheetKeyPair> cuesheetKeyList = new List<CueSheetKeyPair>();
|
||||
|
||||
private Dictionary<string, ulong> searchableKeyList = new Dictionary<string, ulong>();
|
||||
/* @endcond */
|
||||
|
||||
static string FindInstance() {
|
||||
var guids = AssetDatabase.FindAssets("t:" + typeof(CriAtomWindowPrefs).Name);
|
||||
if (guids.Length <= 0)
|
||||
return null;
|
||||
if (guids.Length > 1) {
|
||||
Debug.LogWarning("[CRIWARE] There are multiple preferences file of CriAtomWindow.");
|
||||
}
|
||||
return guids[0];
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
[Serializable]
|
||||
public class CueSheetKeyPair {
|
||||
public string cuesheetGuid;
|
||||
public ulong key;
|
||||
|
||||
public CueSheetKeyPair(string cuesheetGuid, ulong key) {
|
||||
this.cuesheetGuid = cuesheetGuid;
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
|
||||
/* Slow. Don't run it every frame */
|
||||
public void SetOrRenewKeyThenSave(string cuesheetGuid, ulong key) {
|
||||
if (useCommonKey) {
|
||||
cuesheetGuid = commonCuesheetGuid;
|
||||
}
|
||||
if (searchableKeyList.ContainsKey(cuesheetGuid)) {
|
||||
if (key == 0) {
|
||||
searchableKeyList.Remove(cuesheetGuid);
|
||||
} else {
|
||||
searchableKeyList[cuesheetGuid] = key;
|
||||
}
|
||||
} else {
|
||||
searchableKeyList.Add(cuesheetGuid, key);
|
||||
}
|
||||
this.Save();
|
||||
}
|
||||
|
||||
/* Slow. Don't run it every frame */
|
||||
public ulong GetKey(string cuesheetGuid) {
|
||||
if (useCommonKey) {
|
||||
cuesheetGuid = commonCuesheetGuid;
|
||||
}
|
||||
return searchableKeyList.ContainsKey(cuesheetGuid) ? searchableKeyList[cuesheetGuid] : 0;
|
||||
}
|
||||
|
||||
public void ClearKeysAndSave() {
|
||||
searchableKeyList.Clear();
|
||||
useCommonKey = true;
|
||||
this.Save();
|
||||
}
|
||||
|
||||
private void SerializeKeyDict() {
|
||||
this.cuesheetKeyList.Clear();
|
||||
foreach (var elem in searchableKeyList) {
|
||||
cuesheetKeyList.Add(new CueSheetKeyPair(elem.Key, elem.Value));
|
||||
}
|
||||
}
|
||||
|
||||
private void DeserializeKeyDict() {
|
||||
this.searchableKeyList.Clear();
|
||||
foreach(var elem in cuesheetKeyList) {
|
||||
searchableKeyList.Add(elem.cuesheetGuid, elem.key);
|
||||
}
|
||||
}
|
||||
/* @endcond */
|
||||
|
||||
public void Save ()
|
||||
{
|
||||
/* @cond excludele */
|
||||
this.SerializeKeyDict();
|
||||
/* @endcond */
|
||||
|
||||
if (string.IsNullOrEmpty(FindInstance())) {
|
||||
var script = MonoScript.FromScriptableObject(this);
|
||||
var prefsFilePath = Path.Combine(Path.GetDirectoryName(AssetDatabase.GetAssetPath(script)), "CriAtomWindowPrefs.asset");
|
||||
AssetDatabase.CreateAsset(this, prefsFilePath);
|
||||
} else {
|
||||
EditorUtility.SetDirty(this);
|
||||
}
|
||||
AssetDatabase.SaveAssets ();
|
||||
AssetDatabase.Refresh ();
|
||||
}
|
||||
|
||||
public static CriAtomWindowPrefs Load ()
|
||||
{
|
||||
CriAtomWindowPrefs preference;
|
||||
var guid = FindInstance();
|
||||
if (string.IsNullOrEmpty(guid)) {
|
||||
preference = CreateInstance<CriAtomWindowPrefs>();
|
||||
preference.Save();
|
||||
} else {
|
||||
var path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
preference = AssetDatabase.LoadAssetAtPath<CriAtomWindowPrefs>(path);
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
preference.DeserializeKeyDict();
|
||||
/* @endcond */
|
||||
|
||||
return preference;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CriAtomWindowInfo {
|
||||
#region Serializable Classes
|
||||
[Serializable]
|
||||
public class InfoBase {
|
||||
public string name = "";
|
||||
public int id = 0;
|
||||
public string assetGuid = null;
|
||||
public string comment = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AcfInfo : InfoBase {
|
||||
public string filePath = "";
|
||||
public List<string> dspBusSettingsList = new List<string>();
|
||||
|
||||
public AcfInfo(string name, int id, string comment, string filePath) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.comment = comment;
|
||||
|
||||
this.filePath = filePath;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AcbInfo : InfoBase {
|
||||
public string acbPath = "";
|
||||
public string awbPath = "";
|
||||
public List<CueInfo> cueInfoList;
|
||||
public List<CueInfo> publicCueInfoList;
|
||||
|
||||
private bool sortOrder = true; /* true = incremental */
|
||||
|
||||
public AcbInfo(string name, int id, string comment, string acbPath, string awbPath) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.comment = comment;
|
||||
|
||||
this.acbPath = acbPath;
|
||||
this.awbPath = awbPath;
|
||||
this.cueInfoList = new List<CueInfo>();
|
||||
this.publicCueInfoList = new List<CueInfo>();
|
||||
}
|
||||
|
||||
public void SortCueInfo(CueSortType type) {
|
||||
if (cueInfoList.Count <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case CueSortType.Id:
|
||||
this.cueInfoList.Sort((CueInfo x, CueInfo y) => {
|
||||
return sortOrder ? (x.id - y.id) : (y.id - x.id);
|
||||
});
|
||||
this.publicCueInfoList.Sort((CueInfo x, CueInfo y) => {
|
||||
return sortOrder ? (x.id - y.id) : (y.id - x.id);
|
||||
});
|
||||
break;
|
||||
case CueSortType.Name:
|
||||
this.cueInfoList.Sort((CueInfo x, CueInfo y) => {
|
||||
return sortOrder ? string.Compare(x.name, y.name) : string.Compare(y.name, x.name);
|
||||
});
|
||||
this.publicCueInfoList.Sort((CueInfo x, CueInfo y) => {
|
||||
return sortOrder ? string.Compare(x.name, y.name) : string.Compare(y.name, x.name);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sortOrder = !sortOrder;
|
||||
}
|
||||
}
|
||||
|
||||
public void SortCueSheet() {
|
||||
switch (cuesheetSortType) {
|
||||
case CueSheetSortType.NameInc:
|
||||
this.acbInfoList.Sort((AcbInfo x, AcbInfo y) => (
|
||||
string.Compare(x.name, y.name)
|
||||
));
|
||||
cuesheetSortType = CueSheetSortType.NameDec;
|
||||
break;
|
||||
case CueSheetSortType.NameDec:
|
||||
this.acbInfoList.Sort((AcbInfo x, AcbInfo y) => (
|
||||
string.Compare(y.name, x.name)
|
||||
));
|
||||
cuesheetSortType = CueSheetSortType.Id;
|
||||
break;
|
||||
case CueSheetSortType.Id:
|
||||
this.acbInfoList.Sort((AcbInfo x, AcbInfo y) => (
|
||||
x.id - y.id
|
||||
));
|
||||
cuesheetSortType = CueSheetSortType.NameInc;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private enum CueSheetSortType {
|
||||
NameInc,
|
||||
NameDec,
|
||||
Id
|
||||
}
|
||||
private CueSheetSortType cuesheetSortType = CueSheetSortType.NameInc;
|
||||
|
||||
public enum CueSortType {
|
||||
Id,
|
||||
Name
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CueInfo : InfoBase {
|
||||
public long length;
|
||||
public bool isPublic;
|
||||
public CueInfo(string name, int id, string comment, long length, bool isPublic) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.comment = comment;
|
||||
this.length = length;
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
} /* end of class */
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
[SerializeField] private List<AcfInfo> acfInfoList = new List<AcfInfo>();
|
||||
[SerializeField] private List<AcbInfo> acbInfoList = new List<AcbInfo>();
|
||||
#endregion
|
||||
|
||||
|
||||
public List<AcbInfo> GetAcbInfoList(bool forceReload, string searchPath) {
|
||||
if (acbInfoList == null || forceReload) {
|
||||
if (acbInfoList != null) { acbInfoList.Clear(); }
|
||||
acbInfoList = new List<AcbInfo>();
|
||||
|
||||
string[] files = null;
|
||||
try {
|
||||
files = Directory.GetFiles(searchPath, "*.acb", SearchOption.AllDirectories);
|
||||
} catch (Exception ex) {
|
||||
if (ex is ArgumentException || ex is ArgumentNullException) {
|
||||
Debug.LogWarning("[CRIWARE] Insufficient search path. Please check the path for file searching.");
|
||||
} else if (ex is DirectoryNotFoundException) {
|
||||
Debug.LogWarning("[CRIWARE] Search path not found: " + searchPath);
|
||||
} else {
|
||||
Debug.LogError("[CRIWARE] Error getting ACB files. Message: " + ex.Message);
|
||||
}
|
||||
}
|
||||
if (files != null && CriAtomPlugin.IsLibraryInitialized()) {
|
||||
int acbIndex = 0;
|
||||
foreach (string file in files) {
|
||||
string acbFilePath = file.Replace("\\", "/");
|
||||
AcbInfo acbInfo = new AcbInfo(
|
||||
Path.GetFileNameWithoutExtension(acbFilePath),
|
||||
acbIndex++,
|
||||
"",
|
||||
TryGetRelFilePath(acbFilePath),
|
||||
TryGetAwbFile(acbFilePath));
|
||||
/* 指定したACBファイル名(キューシート名)を指定してキュー情報を取得 */
|
||||
CriAtomExAcb acb = CriAtomExAcb.LoadAcbFile(null, acbFilePath, "");
|
||||
if (acb != null) {
|
||||
acbInfo.assetGuid = AssetDatabase.AssetPathToGUID("Assets" + acbFilePath.Substring(Application.dataPath.Length));
|
||||
/* キュー名リストの作成 */
|
||||
CriAtomEx.CueInfo[] cueInfoList = acb.GetCueInfoList();
|
||||
foreach (CriAtomEx.CueInfo cueInfo in cueInfoList) {
|
||||
bool found = false;
|
||||
foreach (var key in acbInfo.cueInfoList) {
|
||||
if (key.id == cueInfo.id) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found == false) {
|
||||
var newCueInfo = new CueInfo(cueInfo.name, cueInfo.id, cueInfo.userData, cueInfo.length, Convert.ToBoolean(cueInfo.headerVisibility));
|
||||
acbInfo.cueInfoList.Add(newCueInfo);
|
||||
if (newCueInfo.isPublic) {
|
||||
acbInfo.publicCueInfoList.Add(newCueInfo);
|
||||
}
|
||||
} else {
|
||||
/* inGame時のサブシーケンスの場合あり */
|
||||
Debug.Log("[CRIWARE] Duplicate cue ID " + cueInfo.id.ToString() + " in cue sheet " + acbInfo.name + ". Last cue name:" + cueInfo.name);
|
||||
}
|
||||
}
|
||||
acb.Dispose();
|
||||
} else {
|
||||
Debug.Log("[CRIWARE] Failed to load ACB file: " + file);
|
||||
}
|
||||
acbInfoList.Add(acbInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return acbInfoList;
|
||||
}
|
||||
|
||||
public List<AcfInfo> GetAcfInfoList(bool forceReload, string searchPath) {
|
||||
if (acfInfoList == null || forceReload) {
|
||||
if (acfInfoList != null) { acfInfoList.Clear(); }
|
||||
acfInfoList = new List<AcfInfo>();
|
||||
|
||||
string[] files = null;
|
||||
try {
|
||||
files = System.IO.Directory.GetFiles(searchPath, "*.acf", System.IO.SearchOption.AllDirectories);
|
||||
} catch (Exception ex) {
|
||||
if (ex is ArgumentException || ex is ArgumentNullException) {
|
||||
Debug.LogWarning("[CRIWARE] Insufficient search path. Please check the path for file searching.");
|
||||
} else if (ex is DirectoryNotFoundException) {
|
||||
Debug.LogWarning("[CRIWARE] Search path not found: " + searchPath);
|
||||
} else {
|
||||
Debug.LogError("[CRIWARE] Error getting ACF files. Message: " + ex.Message);
|
||||
}
|
||||
}
|
||||
if (files != null && CriAtomPlugin.IsLibraryInitialized()) {
|
||||
int index = 0;
|
||||
foreach (string file in files) {
|
||||
string acfFilePath = file.Replace("\\", "/");
|
||||
var acfInfo = new AcfInfo(
|
||||
System.IO.Path.GetFileNameWithoutExtension(acfFilePath),
|
||||
index++,
|
||||
"",
|
||||
TryGetRelFilePath(acfFilePath));
|
||||
acfInfo.assetGuid = AssetDatabase.AssetPathToGUID("Assets" + acfFilePath.Substring(Application.dataPath.Length));
|
||||
CriAtomEx.RegisterAcf(null, acfFilePath);
|
||||
CriAtomExAcf.AcfInfo nativeAcfInfo;
|
||||
CriAtomExAcf.GetAcfInfo(out nativeAcfInfo);
|
||||
for (ushort i = 0; i < nativeAcfInfo.numDspSettings; ++i) {
|
||||
acfInfo.dspBusSettingsList.Add(CriAtomExAcf.GetDspSettingNameByIndex(i));
|
||||
}
|
||||
CriAtomEx.UnregisterAcf();
|
||||
acfInfoList.Add(acfInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return acfInfoList;
|
||||
}
|
||||
|
||||
public void ResetInfo() {
|
||||
this.acfInfoList.Clear();
|
||||
this.acfInfoList = null;
|
||||
this.acbInfoList.Clear();
|
||||
this.acbInfoList = null;
|
||||
}
|
||||
|
||||
private string TryGetRelFilePath(string path) {
|
||||
Uri streamingAssetsUri = new Uri(CriWare.Common.streamingAssetsPath);
|
||||
Uri fullPathUri = new Uri(path);
|
||||
if (fullPathUri.ToString().Contains(streamingAssetsUri.ToString())) {
|
||||
string[] splitter = { streamingAssetsUri.ToString() + "/" };
|
||||
var pathChunks = fullPathUri.ToString().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
|
||||
return pathChunks[pathChunks.Length - 1];
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
private string TryGetAwbFile(string acbPath) {
|
||||
string dir = Path.GetDirectoryName(acbPath);
|
||||
string filenameNoExt = Path.GetFileNameWithoutExtension(acbPath);
|
||||
string presumedAwbPath = Path.Combine(dir, filenameNoExt + ".awb");
|
||||
if (File.Exists(presumedAwbPath)) {
|
||||
return TryGetRelFilePath(presumedAwbPath);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dbb5a65a01a1de4ebfe0c4a1352cc1a
|
||||
timeCreated: 1445602397
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cbed90d60f1598439f1b8e8ca810b49
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-213
@@ -1,213 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER && CRIWARE_TIMELINE_1_OR_NEWER
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine.Events;
|
||||
using System;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriTimeline.Atom {
|
||||
|
||||
public partial class CriAtomClipWaveformPreviewer {
|
||||
|
||||
private class CriAtomClipWaveformCanvas : IDisposable {
|
||||
private const string SHADER = "CRIWARE/CriAtomClipWaveformRender";
|
||||
private const int DEFAULT_TEXTURE_WIDTH = 4096;
|
||||
private static readonly Color backgroundColor = Color.clear;
|
||||
private static readonly Color waveColorForAll = new Color(1.0f, 0.635f, 0.0f, 1.0f); /* yellow */
|
||||
private static readonly Color waveColorForMono = new Color(0.332f, 0.661f, 0.991f, 1f); /* blue */
|
||||
|
||||
private Texture2D texture;
|
||||
private Material material;
|
||||
private int scanPosition = 0;
|
||||
private ClipBackgroundRegion lastRegion;
|
||||
private int lastWidth = 0;
|
||||
private bool lastLoop = false;
|
||||
private bool isDirty = true;
|
||||
private bool isDisposed = false;
|
||||
|
||||
public UnityAction updated = null;
|
||||
|
||||
public bool IsDirty {
|
||||
get { return isDirty; }
|
||||
set {
|
||||
if (isDirty = value) {
|
||||
scanPosition = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CriAtomClipWaveformCanvas() {
|
||||
this.texture = null;
|
||||
this.material = new Material(Shader.Find(SHADER));
|
||||
}
|
||||
|
||||
~CriAtomClipWaveformCanvas() {
|
||||
dispose();
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
public void UpdateTexture(ref CriAtomClipWaveformInfo info, bool loop, ClipBackgroundRegion? region = null, bool renderOnce = false) {
|
||||
const int BATCH_NUM_PIXEL = 50;
|
||||
|
||||
int scanWidth = region.HasValue ? (int)region.Value.position.width : DEFAULT_TEXTURE_WIDTH;
|
||||
|
||||
if (texture == null) {
|
||||
texture = new Texture2D(scanWidth, info.waveformInfo.numChannels, TextureFormat.RG16, false);
|
||||
texture.wrapMode = TextureWrapMode.Clamp;
|
||||
texture.filterMode = FilterMode.Bilinear;
|
||||
} else if (renderOnce == false) {
|
||||
if (region.HasValue && lastWidth != scanWidth) {
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
texture.Reinitialize(scanWidth, texture.height);
|
||||
#else
|
||||
texture.Resize(scanWidth, texture.height);
|
||||
#endif
|
||||
this.IsDirty = true;
|
||||
lastWidth = scanWidth;
|
||||
}
|
||||
if (region.HasValue && region.Value != lastRegion) {
|
||||
this.IsDirty = true;
|
||||
lastRegion = region.Value;
|
||||
}
|
||||
if (loop != lastLoop) {
|
||||
this.IsDirty = true;
|
||||
lastLoop = loop;
|
||||
}
|
||||
}
|
||||
|
||||
if (isDirty) {
|
||||
if (this.scanPosition >= scanWidth) {
|
||||
this.IsDirty = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
long startSmpIdx = region.HasValue
|
||||
? (long)((region.Value.startTime / info.waveDurationSecond) * info.waveformInfo.numSamples)
|
||||
: 0;
|
||||
long endSmpIdx = region.HasValue
|
||||
? (long)((region.Value.endTime / info.waveDurationSecond) * info.waveformInfo.numSamples)
|
||||
: (info.waveformInfo.numSamples - 1);
|
||||
long smpLength = endSmpIdx - startSmpIdx + 1;
|
||||
|
||||
float samplePerPixel = smpLength / (float)scanWidth;
|
||||
if (samplePerPixel <= 0) {
|
||||
samplePerPixel = float.Epsilon;
|
||||
}
|
||||
|
||||
for (int y = 0; y < texture.height; ++y) {
|
||||
for (int x = scanPosition; x < scanPosition + BATCH_NUM_PIXEL; ++x) {
|
||||
Int16 maxValue, minValue;
|
||||
long startPnt = (long)(startSmpIdx + x * samplePerPixel);
|
||||
if (loop) {
|
||||
startPnt %= info.waveformInfo.numSamples;
|
||||
}
|
||||
long range = (long)Mathf.Ceil(samplePerPixel);
|
||||
if (startPnt + range > info.waveformInfo.numSamples) {
|
||||
range = (long)Mathf.Floor(info.waveformInfo.numSamples - startPnt);
|
||||
}
|
||||
GetMinMaxPcmArray(info.lpcmBufferByInterleave,
|
||||
startPnt,
|
||||
range,
|
||||
y,
|
||||
info.waveformInfo.numChannels,
|
||||
out minValue, out maxValue);
|
||||
texture.SetPixel(x, y, new Color(
|
||||
maxValue / (float)Int16.MaxValue,
|
||||
minValue / (float)Int16.MinValue,
|
||||
0));
|
||||
}
|
||||
}
|
||||
|
||||
texture.Apply();
|
||||
|
||||
scanPosition += BATCH_NUM_PIXEL;
|
||||
|
||||
if (this.updated != null) {
|
||||
this.updated();
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetMinMaxPcmArray(Int16[] array, long index, long length, int channel, int numChannels, out Int16 min, out Int16 max) {
|
||||
Int16 maxValue = 0;
|
||||
Int16 minValue = 0;
|
||||
for (long i = 0; i < length; i++) {
|
||||
var currentIndex = (index + i) * numChannels + channel;
|
||||
var amplitude = array[currentIndex];
|
||||
if (maxValue < amplitude) {
|
||||
maxValue = amplitude;
|
||||
}
|
||||
if (minValue > amplitude) {
|
||||
minValue = amplitude;
|
||||
}
|
||||
}
|
||||
max = maxValue;
|
||||
min = minValue;
|
||||
}
|
||||
|
||||
public void Draw(Rect rect) {
|
||||
if (this.texture == null || this.material == null) { return; }
|
||||
Graphics.DrawTexture(rect, this.texture, this.material);
|
||||
}
|
||||
|
||||
public void SetMatParams(
|
||||
RenderChannelMode channelMode,
|
||||
int numChannels,
|
||||
bool isLooping,
|
||||
bool isMuted,
|
||||
float scale,
|
||||
float offset)
|
||||
{
|
||||
this.material.SetTexture("_MainTex", this.texture);
|
||||
this.material.SetColor("_BacCol", backgroundColor);
|
||||
this.material.SetColor("_ForCol", channelMode == RenderChannelMode.All ? waveColorForAll : waveColorForMono);
|
||||
this.material.SetFloat("_Channel", channelMode == RenderChannelMode.All ? numChannels : 1);
|
||||
|
||||
this.material.SetFloat("_Scale", scale);
|
||||
this.material.SetFloat("_Offset", offset);
|
||||
|
||||
this.material.SetInt("_IsLoop", isLooping ? 1 : 0);
|
||||
this.material.SetInt("_IsMute", isMuted ? 1 : 0);
|
||||
this.material.SetInt("_ForceMono", channelMode == RenderChannelMode.Mono ? 1 : 0);
|
||||
}
|
||||
|
||||
private void dispose() {
|
||||
if (this.isDisposed) { return; }
|
||||
|
||||
if (Application.isPlaying) {
|
||||
UnityEngine.Object.Destroy(this.texture);
|
||||
UnityEngine.Object.Destroy(this.material);
|
||||
} else {
|
||||
UnityEngine.Object.DestroyImmediate(this.texture);
|
||||
UnityEngine.Object.DestroyImmediate(this.material);
|
||||
}
|
||||
this.texture = null;
|
||||
this.material = null;
|
||||
|
||||
this.isDisposed = true;
|
||||
}
|
||||
|
||||
} //class CriAtomClipWaveformCanvas
|
||||
|
||||
} //partial class CriAtomClipWaveformPreviewer
|
||||
|
||||
} //namespace CriTimeline.Atom
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0f13bdc836d8464aabbebf21dab6560
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-84
@@ -1,84 +0,0 @@
|
||||
Shader "CRIWARE/CriAtomClipWaveformRender" {
|
||||
Properties{
|
||||
_MainTex("Main Texture", 2D) = "white" { }
|
||||
}
|
||||
|
||||
SubShader{
|
||||
Pass {
|
||||
Tags { "RenderType" = "Opaque" }
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
ZTest Always
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
uniform float4 _MainTex_ST;
|
||||
uniform fixed4 _BacCol;
|
||||
uniform fixed4 _ForCol;
|
||||
uniform float _Offset;
|
||||
uniform float _Scale;
|
||||
uniform int _IsLoop;
|
||||
uniform int _IsMute;
|
||||
uniform float _Channel;
|
||||
uniform int _ForceMono;
|
||||
|
||||
struct appdata {
|
||||
float4 vertex : POSITION;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
inline float zero_amplitude(v2f v, float volume) {
|
||||
return floor(volume * 100.0) == 0.0 ? abs(ddy(v.uv.y)) : volume;
|
||||
}
|
||||
|
||||
v2f vert(appdata v) {
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.uv.x *= _Scale;
|
||||
o.uv.x += _Offset;
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(v2f v) : SV_Target {
|
||||
float channel_height = (1.0 / (_Channel));
|
||||
int ch = floor(v.uv.y / (1.0 / _Channel)) + 1;
|
||||
|
||||
/* uv.y reads the values in reverse order of texture creation. */
|
||||
/* but _ForceMono is true, read the first channel at the end. */
|
||||
float2 ch_vec2 = {frac(v.uv.x), _Channel > 1 ? (ch - 1) * (1.0 / (_Channel - 1)) : 0.0 };
|
||||
ch_vec2.y = _ForceMono < 1 ? 1.0 - ch_vec2.y : ch_vec2.y;
|
||||
|
||||
float volume_max = tex2D(_MainTex, ch_vec2).r * channel_height / 2.0;
|
||||
volume_max = zero_amplitude(v, volume_max);
|
||||
volume_max = v.uv.x > 1 && _IsLoop < 1 ? abs(ddy(v.uv.y)) : volume_max;
|
||||
volume_max = _IsMute >= 1 ? abs(ddy(v.uv.y)) : volume_max;
|
||||
|
||||
float volume_min = tex2D(_MainTex, ch_vec2).g * channel_height / 2.0;
|
||||
volume_min = zero_amplitude(v, volume_min);
|
||||
volume_min = v.uv.x > 1 && _IsLoop < 1 ? abs(ddy(v.uv.y)) : volume_min;
|
||||
volume_min = _IsMute >= 1 ? abs(ddy(v.uv.y)) : volume_min;
|
||||
|
||||
float uvY = v.uv.y - ((channel_height / 2.0) * ch * 2.0) + channel_height / 2.0;
|
||||
fixed4 col = lerp(
|
||||
_BacCol,
|
||||
_ForCol,
|
||||
-volume_min <= uvY && uvY <= volume_max
|
||||
);
|
||||
clip(col.a - 0.5);
|
||||
return col;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f420a9b00c3898a4eb0ed6f645a04081
|
||||
timeCreated: 1606370626
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,302 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2019 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
//#define CRI_TIMELINE_ATOM_VERBOSE_DEBUG
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER && CRIWARE_TIMELINE_1_OR_NEWER
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine.Timeline;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriTimeline.Atom {
|
||||
|
||||
[CustomPropertyDrawer(typeof(CriAtomBehaviour))]
|
||||
public class CriAtomTimelineDrawer : PropertyDrawer {
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
|
||||
SerializedProperty volumeProp = property.FindPropertyRelative("volume");
|
||||
SerializedProperty pitchProp = property.FindPropertyRelative("pitch");
|
||||
SerializedProperty aisacProp = property.FindPropertyRelative("AISACValue");
|
||||
|
||||
EditorGUILayout.PropertyField(volumeProp);
|
||||
EditorGUILayout.PropertyField(pitchProp);
|
||||
EditorGUILayout.PropertyField(aisacProp);
|
||||
}
|
||||
}
|
||||
|
||||
[CustomEditor(typeof(CriAtomClipBase)), CanEditMultipleObjects]
|
||||
public class CriAtomClipEditor : UnityEditor.Editor { }
|
||||
|
||||
[CustomEditor(typeof(CriAtomTrack))]
|
||||
public class CriAtomTrackEditor : UnityEditor.Editor {
|
||||
private CriAtomTrack m_object;
|
||||
|
||||
public void OnEnable() {
|
||||
if (target != null) {
|
||||
m_object = target as CriAtomTrack;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
if (m_object == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
serializedObject.Update();
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
|
||||
EditorGUILayout.LabelField("Track Settings", EditorStyles.boldLabel);
|
||||
DrawLine(Color.black);
|
||||
m_object.m_AisacControls
|
||||
= EditorGUILayout.TextField("Aisac Control", m_object.m_AisacControls);
|
||||
m_object.m_StopOnWrapping
|
||||
= EditorGUILayout.Toggle("Stop On Wrapping", m_object.m_StopOnWrapping);
|
||||
m_object.m_StopAtGraphEnd
|
||||
= EditorGUILayout.Toggle("Stop At Graph End", m_object.m_StopAtGraphEnd);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Unity Editor", EditorStyles.boldLabel);
|
||||
DrawLine(Color.black);
|
||||
|
||||
m_object.m_IsRenderMono
|
||||
= EditorGUILayout.Toggle("Show Mono Waveform", m_object.m_IsRenderMono);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
EditorUtility.SetDirty(m_object);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawLine(Color color, int thickness = 1, int padding = 10) {
|
||||
Rect rect = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness));
|
||||
rect.height = thickness;
|
||||
rect.y += padding / 2;
|
||||
rect.x -= 2;
|
||||
rect.width += 6;
|
||||
EditorGUI.DrawRect(rect, color);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
|
||||
[CustomTimelineEditor(typeof(CriAtomClipBase))]
|
||||
public class CriAtomClipWaveformEditor : UnityEditor.Timeline.ClipEditor {
|
||||
private Dictionary<CriAtomClipBase, CriAtomClipWaveformPreviewer> atomClipPreviewDirectory
|
||||
= new Dictionary<CriAtomClipBase, CriAtomClipWaveformPreviewer>();
|
||||
|
||||
public override void OnCreate(TimelineClip clip, TrackAsset track, TimelineClip clonedFrom) {
|
||||
base.OnCreate(clip, track, clonedFrom);
|
||||
#if CRI_TIMELINE_ATOM_VERBOSE_DEBUG
|
||||
Debug.Log("[CRIWARE][Timeline] OnCreate");
|
||||
#endif
|
||||
|
||||
atomClipPreviewDirectory.Clear();
|
||||
|
||||
CriAtomClipBase atomClip = clip.asset as CriAtomClipBase;
|
||||
atomClipPreviewDirectory.Add(atomClip, new CriAtomClipWaveformPreviewer(atomClip));
|
||||
}
|
||||
|
||||
public override void OnClipChanged(TimelineClip clip) {
|
||||
base.OnClipChanged(clip);
|
||||
#if CRI_TIMELINE_ATOM_VERBOSE_DEBUG
|
||||
Debug.Log("[CRIWARE][Timeline] OnClipChanged");
|
||||
#endif
|
||||
|
||||
CriAtomClipBase atomClip = clip.asset as CriAtomClipBase;
|
||||
if (atomClipPreviewDirectory.ContainsKey(atomClip)) {
|
||||
return;
|
||||
}
|
||||
atomClipPreviewDirectory.Add(atomClip, new CriAtomClipWaveformPreviewer(atomClip));
|
||||
}
|
||||
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region) {
|
||||
base.DrawBackground(clip, region);
|
||||
#if CRI_TIMELINE_ATOM_VERBOSE_DEBUG
|
||||
Debug.Log("[CRIWARE][Timeline] DrawBackground");
|
||||
|
||||
Debug.Log("region.startTime : " + region.startTime.ToString() + "region.endTime : " + region.endTime.ToString());
|
||||
#endif
|
||||
|
||||
CriAtomClipBase atomClip = clip.asset as CriAtomClipBase;
|
||||
CriAtomClipWaveformPreviewer atomClipPreviewer;
|
||||
if (!atomClipPreviewDirectory.TryGetValue(atomClip, out atomClipPreviewer)) {
|
||||
#if CRI_TIMELINE_ATOM_VERBOSE_DEBUG
|
||||
Debug.LogError("[CRIWARE][Timeline] not contains key : " + clip.displayName);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
if (!atomClipPreviewer.HasDecodeTask()) {
|
||||
atomClipPreviewDirectory.Remove(atomClip);
|
||||
atomClipPreviewDirectory.Add(atomClip, new CriAtomClipWaveformPreviewer(atomClip));
|
||||
}
|
||||
|
||||
if (!atomClipPreviewer.HasPreviewData()) {
|
||||
/* While decoding or decode error. Skip renderring. */
|
||||
return;
|
||||
}
|
||||
|
||||
atomClipPreviewer.IsLooping = atomClip.loopWithinClip;
|
||||
atomClipPreviewer.IsMuted = atomClip.muted;
|
||||
CriAtomTrack atomTrack = clip.parentTrack as CriAtomTrack;
|
||||
if (atomTrack.m_IsRenderMono) {
|
||||
atomClipPreviewer.ChannelMode = CriAtomClipWaveformPreviewer.RenderChannelMode.Mono;
|
||||
} else {
|
||||
atomClipPreviewer.ChannelMode = CriAtomClipWaveformPreviewer.RenderChannelMode.All;
|
||||
}
|
||||
|
||||
if (Event.current.type == EventType.Repaint) {
|
||||
atomClipPreviewer.RenderMaterial(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CriAtomClipWaveformPreviewer {
|
||||
/* Number of drawing channels */
|
||||
public enum RenderChannelMode {
|
||||
Mono = 0, /* Mono(Left Channel) */
|
||||
All /* All Channels */
|
||||
}
|
||||
|
||||
public bool IsLooping = false;
|
||||
public bool IsMuted = true;
|
||||
public RenderChannelMode ChannelMode = RenderChannelMode.Mono;
|
||||
|
||||
private struct CriAtomClipWaveformInfo {
|
||||
public CriAtomEx.WaveformInfo waveformInfo;
|
||||
public double waveDurationSecond;
|
||||
public Int16[] lpcmBufferByInterleave;
|
||||
}
|
||||
|
||||
private Task decodeTask = null;
|
||||
private CriAtomClipWaveformInfo atomClipWaveformInfo;
|
||||
private CriAtomClipWaveformCanvas simpleCanvas;
|
||||
private CriAtomClipWaveformCanvas regionalCanvas;
|
||||
|
||||
public CriAtomClipWaveformPreviewer(CriAtomClipBase criAtomClip) {
|
||||
if (!CriAtomTimelinePreviewer.IsInitialized || string.IsNullOrEmpty(criAtomClip.AcbPath)) {
|
||||
return;
|
||||
}
|
||||
var acb = CriAtomTimelinePreviewer.Instance.GetAcb(criAtomClip.AcbPath, criAtomClip.AwbPath);
|
||||
if (acb == null) {
|
||||
Debug.LogError("[CRIWARE][Timeline] faild to load acb object.");
|
||||
return;
|
||||
}
|
||||
|
||||
decodeTask = Task.Run(() =>
|
||||
{
|
||||
this.atomClipWaveformInfo = new CriAtomClipWaveformInfo();
|
||||
if (!acb.GetWaveFormInfo(criAtomClip.CueName, out this.atomClipWaveformInfo.waveformInfo)) {
|
||||
/* without waveform */
|
||||
return;
|
||||
}
|
||||
this.atomClipWaveformInfo.lpcmBufferByInterleave = new Int16[this.atomClipWaveformInfo.waveformInfo.numSamples * this.atomClipWaveformInfo.waveformInfo.numChannels];
|
||||
if (!LoadWaveform(acb.nativeHandle, criAtomClip.CueName, ref this.atomClipWaveformInfo.lpcmBufferByInterleave)) {
|
||||
this.atomClipWaveformInfo.lpcmBufferByInterleave = null;
|
||||
return;
|
||||
}
|
||||
this.atomClipWaveformInfo.waveDurationSecond = this.atomClipWaveformInfo.waveformInfo.numSamples / (double)this.atomClipWaveformInfo.waveformInfo.samplingRate;
|
||||
});
|
||||
|
||||
simpleCanvas = new CriAtomClipWaveformCanvas();
|
||||
simpleCanvas.updated += () => {
|
||||
TimelineEditor.Refresh(RefreshReason.WindowNeedsRedraw);
|
||||
};
|
||||
regionalCanvas = new CriAtomClipWaveformCanvas();
|
||||
regionalCanvas.updated += () => {
|
||||
TimelineEditor.Refresh(RefreshReason.WindowNeedsRedraw);
|
||||
};
|
||||
}
|
||||
|
||||
~CriAtomClipWaveformPreviewer() {
|
||||
if (decodeTask != null) {
|
||||
if (!decodeTask.IsCompleted) {
|
||||
decodeTask.Wait();
|
||||
}
|
||||
decodeTask.Dispose();
|
||||
decodeTask = null;
|
||||
}
|
||||
simpleCanvas.Dispose();
|
||||
simpleCanvas = null;
|
||||
regionalCanvas.Dispose();
|
||||
regionalCanvas = null;
|
||||
}
|
||||
|
||||
public bool HasDecodeTask() {
|
||||
return decodeTask == null ? false : true;
|
||||
}
|
||||
|
||||
public bool HasPreviewData() {
|
||||
if (decodeTask == null || decodeTask.IsFaulted || decodeTask.IsCanceled || !decodeTask.IsCompleted) {
|
||||
return false;
|
||||
}
|
||||
/* decodeTask.IsCompleted == true and buffer == null is decode error. */
|
||||
return this.atomClipWaveformInfo.lpcmBufferByInterleave != null;
|
||||
}
|
||||
|
||||
public void RenderMaterial(ClipBackgroundRegion region) {
|
||||
if (region.position.height <= 0 | region.position.width <= 0) {
|
||||
/* region.position is invalid. */
|
||||
return;
|
||||
}
|
||||
|
||||
simpleCanvas.UpdateTexture(ref this.atomClipWaveformInfo, this.IsLooping, renderOnce:true);
|
||||
regionalCanvas.UpdateTexture(ref this.atomClipWaveformInfo, this.IsLooping, region);
|
||||
|
||||
simpleCanvas.SetMatParams(
|
||||
channelMode: ChannelMode,
|
||||
numChannels: this.atomClipWaveformInfo.waveformInfo.numChannels,
|
||||
isLooping: this.IsLooping,
|
||||
isMuted: this.IsMuted,
|
||||
scale: (float)((region.endTime - region.startTime) / this.atomClipWaveformInfo.waveDurationSecond),
|
||||
offset: (float)(region.startTime / this.atomClipWaveformInfo.waveDurationSecond));
|
||||
|
||||
regionalCanvas.SetMatParams(
|
||||
channelMode: ChannelMode,
|
||||
numChannels: this.atomClipWaveformInfo.waveformInfo.numChannels,
|
||||
isLooping: this.IsLooping,
|
||||
isMuted: this.IsMuted,
|
||||
scale: 1f,
|
||||
offset: 0);
|
||||
|
||||
if (regionalCanvas.IsDirty) {
|
||||
simpleCanvas.Draw(region.position);
|
||||
} else {
|
||||
regionalCanvas.Draw(region.position);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool LoadWaveform(IntPtr acbHn, string cueName, ref System.Int16[] decodeLpcmBuffer) {
|
||||
var gcHandle = GCHandle.Alloc(decodeLpcmBuffer, GCHandleType.Pinned);
|
||||
var result = CRIWAREF2B79675(acbHn, cueName, gcHandle.AddrOfPinnedObject(), decodeLpcmBuffer.LongLength);
|
||||
gcHandle.Free();
|
||||
return result;
|
||||
}
|
||||
|
||||
#region DLL Import
|
||||
#if !CRIWARE_ENABLE_HEADLESS_MODE
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern bool CRIWAREF2B79675(IntPtr acbHn, string cue_name, IntPtr decode_lpcm_buffer, System.Int64 decodeLpcmBufferLength);
|
||||
#else
|
||||
private static bool CRIWAREF2B79675(IntPtr acbHn, string cue_name, IntPtr decode_lpcm_buffer, System.Int64 decodeLpcmBufferLength) {return false;}
|
||||
#endif
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endif //UNITY_2019_3_OR_NEWER
|
||||
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif //UNITY_2018_1_OR_NEWER
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64709c1c359e022439e2bde0e6afa2d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,321 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CriWare.Editor {
|
||||
|
||||
public class CriLogConsole : EditorWindow
|
||||
{
|
||||
private const int logLineCount = 2;
|
||||
private const int logBoxHeight = logLineCount * 16;
|
||||
private const string PATTERN_W = "W[0-9]{8,12}M{0,1}";
|
||||
private const string PATTERN_E = "E[0-9]{8,12}M{0,1}";
|
||||
|
||||
private Rect upperArea;
|
||||
private Rect lowerArea;
|
||||
private Rect dividingLine;
|
||||
private Rect menuBar;
|
||||
|
||||
private Texture2D selectedBoxBg;
|
||||
private Texture2D oddBoxBg;
|
||||
private Texture2D infoIcon;
|
||||
private Texture2D errorIcon;
|
||||
private Texture2D warningIcon;
|
||||
|
||||
private float sizeRatio = 0.5f;
|
||||
private float middleLineHeight = 10f;
|
||||
private float menuBarHeight = 20f;
|
||||
|
||||
private bool repaintDividingLine;
|
||||
private bool isManualButtonActive = false;
|
||||
private bool needToResetScrollBar = true;
|
||||
|
||||
private Vector2 lowerPanelScroll;
|
||||
private Vector2 upperPanelScrollPos;
|
||||
|
||||
private GUIStyle dividingLineStyle;
|
||||
private GUIStyle lowerAreaStyle;
|
||||
private GUIStyle upperAreaLogStyle;
|
||||
|
||||
private string manualServerUrl = "https://docs.criware.jp/error/common/";
|
||||
private string[] optionLanguage = { "jpn", "eng" };
|
||||
private int optionLanguageIndex;
|
||||
private List<LogData> logDataList;
|
||||
private LogData selectedLog;
|
||||
|
||||
[MenuItem("Window/CRIWARE/CRI Log Console")]
|
||||
private static void OpenWindow() {
|
||||
CriLogConsole criLogConsole = GetWindow<CriLogConsole>();
|
||||
criLogConsole.titleContent = new GUIContent("CRI Log Console");
|
||||
}
|
||||
|
||||
private class LogData {
|
||||
public bool isSelected;
|
||||
public string logContent;
|
||||
public LogType type;
|
||||
public string errorNumber;
|
||||
|
||||
public LogData(bool isSelected, string logContent, LogType type, string errorNumber) {
|
||||
this.isSelected = isSelected;
|
||||
this.logContent = logContent;
|
||||
this.type = type;
|
||||
this.errorNumber = errorNumber;
|
||||
}
|
||||
|
||||
public LogData(bool isSelected, string logContent, LogType type) {
|
||||
this.isSelected = isSelected;
|
||||
this.logContent = logContent;
|
||||
this.type = type;
|
||||
|
||||
var matchW = Regex.Match(logContent, PATTERN_W);
|
||||
var matchE = Regex.Match(logContent, PATTERN_E);
|
||||
if(matchW.Success) {
|
||||
errorNumber = matchW.ToString();
|
||||
} else if(matchE.Success) {
|
||||
errorNumber = matchE.ToString();
|
||||
} else {
|
||||
errorNumber = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
errorIcon = EditorGUIUtility.Load("icons/console.erroricon.png") as Texture2D;
|
||||
warningIcon = EditorGUIUtility.Load("icons/console.warnicon.png") as Texture2D;
|
||||
infoIcon = EditorGUIUtility.Load("icons/console.infoicon.png") as Texture2D;
|
||||
|
||||
dividingLineStyle = new GUIStyle();
|
||||
upperAreaLogStyle = new GUIStyle();
|
||||
lowerAreaStyle = new GUIStyle();
|
||||
dividingLineStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D;
|
||||
upperAreaLogStyle.normal.textColor = new Color(0.7f, 0.7f, 0.7f);
|
||||
lowerAreaStyle.normal.textColor = new Color(0.9f, 0.9f, 0.9f);
|
||||
lowerAreaStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/projectbrowsericonareabg.png") as Texture2D;
|
||||
|
||||
oddBoxBg = EditorGUIUtility.Load("builtin skins/darkskin/images/cn entrybackodd.png") as Texture2D;
|
||||
selectedBoxBg = EditorGUIUtility.Load("builtin skins/darkskin/images/menuitemhover.png") as Texture2D;
|
||||
|
||||
if (logDataList == null) {
|
||||
logDataList = new List<LogData>();
|
||||
}
|
||||
selectedLog = null;
|
||||
Application.logMessageReceived += OnLogMessageReceived;
|
||||
}
|
||||
|
||||
private void Awake() {
|
||||
logDataList = new List<LogData>();
|
||||
ParseUnityLogFile(CriWareErrorHandler.logPrefix);
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
Application.logMessageReceived -= OnLogMessageReceived;
|
||||
}
|
||||
|
||||
private void OnDestroy() {
|
||||
Application.logMessageReceived -= OnLogMessageReceived;
|
||||
}
|
||||
|
||||
private void OnGUI() {
|
||||
GenerateManualBar();
|
||||
GenerateUpperArea();
|
||||
GenerateLowerArea();
|
||||
GenerateDividingLine();
|
||||
DividingLineEvent(Event.current);
|
||||
if (GUI.changed) {
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void GenerateManualBar() {
|
||||
menuBar = new Rect(0, 0, position.width, menuBarHeight);
|
||||
GUILayout.BeginArea(menuBar, EditorStyles.toolbar);
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button(new GUIContent("Clear"), EditorStyles.toolbarButton, GUILayout.Width(50))) {
|
||||
logDataList.Clear();
|
||||
selectedLog = null;
|
||||
isManualButtonActive = false;
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
|
||||
GUI.enabled = isManualButtonActive;
|
||||
if (GUILayout.Button(new GUIContent("Open Online Manual"), EditorStyles.toolbarButton, GUILayout.Width(130))) {
|
||||
if (selectedLog != null) {
|
||||
ShowManualFromBrowser(selectedLog.errorNumber);
|
||||
}
|
||||
}
|
||||
GUI.enabled = true;
|
||||
|
||||
optionLanguageIndex = EditorGUILayout.Popup("Language", optionLanguageIndex, optionLanguage);
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
private void GenerateUpperArea() {
|
||||
upperArea = new Rect(0, menuBarHeight, position.width, (position.height * sizeRatio) - menuBarHeight);
|
||||
GUILayout.BeginArea(upperArea);
|
||||
if (needToResetScrollBar) {
|
||||
upperPanelScrollPos = new Vector2(0, position.height * sizeRatio);
|
||||
needToResetScrollBar = false;
|
||||
}
|
||||
using (var upperPanelScope = new EditorGUILayout.ScrollViewScope(upperPanelScrollPos, GUILayout.ExpandHeight(true))) {
|
||||
upperPanelScrollPos = upperPanelScope.scrollPosition;
|
||||
int listNumInView = ((int)(position.height * sizeRatio) - (int)menuBarHeight) / logBoxHeight;
|
||||
int firstLogId = Mathf.Clamp((int)upperPanelScrollPos.y / logBoxHeight, 0, Mathf.Max(0, logDataList.Count - listNumInView));
|
||||
GUILayout.Space(logBoxHeight * firstLogId);
|
||||
for (int i = firstLogId; i < Mathf.Min(firstLogId + listNumInView, logDataList.Count); ++i) {
|
||||
string InfoShownOnBox = "";
|
||||
StringReader rs = new System.IO.StringReader(logDataList[i].logContent);
|
||||
for (int x = 0; x < logLineCount; ++x) {
|
||||
InfoShownOnBox = InfoShownOnBox + rs.ReadLine();
|
||||
if (x != logLineCount - 1) {
|
||||
InfoShownOnBox = InfoShownOnBox + "\r\n";
|
||||
}
|
||||
}
|
||||
if (GenerateLogBox(InfoShownOnBox, logDataList[i].type, i % 2 == 0, logDataList[i].isSelected)) {
|
||||
if (selectedLog != null) {
|
||||
selectedLog.isSelected = false;
|
||||
}
|
||||
logDataList[i].isSelected = true;
|
||||
selectedLog = logDataList[i];
|
||||
if (selectedLog.errorNumber != "") {
|
||||
isManualButtonActive = true;
|
||||
} else {
|
||||
isManualButtonActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.Space(Mathf.Max(0, logDataList.Count - firstLogId - listNumInView) * logBoxHeight);
|
||||
}
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
private void GenerateLowerArea() {
|
||||
lowerArea = new Rect(0, position.height * sizeRatio, position.width, position.height * (1 - sizeRatio));
|
||||
GUILayout.BeginArea(lowerArea);
|
||||
lowerPanelScroll = GUILayout.BeginScrollView(lowerPanelScroll);
|
||||
if (selectedLog != null) {
|
||||
GUILayout.TextArea(selectedLog.logContent, lowerAreaStyle);
|
||||
}
|
||||
if (isManualButtonActive) {
|
||||
if (GUILayout.Button(new GUIContent("Open Online Manual"), GUILayout.Width(130))) {
|
||||
ShowManualFromBrowser(selectedLog.errorNumber);
|
||||
}
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
private void GenerateDividingLine() {
|
||||
dividingLine = new Rect(0, (position.height * sizeRatio) - middleLineHeight, position.width, middleLineHeight * 2);
|
||||
GUILayout.BeginArea(new Rect(dividingLine.position + (Vector2.up * middleLineHeight), new Vector2(position.width, 2)), dividingLineStyle);
|
||||
GUILayout.EndArea();
|
||||
EditorGUIUtility.AddCursorRect(dividingLine, MouseCursor.ResizeVertical);
|
||||
}
|
||||
|
||||
private void DividingLineEvent(Event mouseEvent) {
|
||||
if (mouseEvent.type == EventType.MouseDown && mouseEvent.button == 0 && dividingLine.Contains(mouseEvent.mousePosition)) {
|
||||
sizeRatio = mouseEvent.mousePosition.y / position.height;
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private bool GenerateLogBox(string content, LogType boxType, bool isOdd, bool isSelected) {
|
||||
Texture2D icon = null;
|
||||
upperAreaLogStyle.normal.background = isSelected ? selectedBoxBg : oddBoxBg;
|
||||
switch (boxType) {
|
||||
case LogType.Error:
|
||||
icon = errorIcon;
|
||||
break;
|
||||
case LogType.Warning:
|
||||
icon = warningIcon;
|
||||
break;
|
||||
case LogType.Log:
|
||||
icon = infoIcon;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
GUIContent buttonContent = new GUIContent(content, icon);
|
||||
return GUILayout.Button(buttonContent, upperAreaLogStyle, GUILayout.ExpandWidth(true), GUILayout.Height(logBoxHeight));
|
||||
}
|
||||
|
||||
private bool IsCriLogCheck(string log) {
|
||||
return log.Contains(CriWareErrorHandler.logPrefix);
|
||||
}
|
||||
|
||||
private void OnLogMessageReceived(string condition, string stackTrace, LogType type) {
|
||||
bool isCri = IsCriLogCheck(condition);
|
||||
if (!isCri) {
|
||||
return;
|
||||
}
|
||||
string templogstring = condition + "\n" + stackTrace;
|
||||
LogData tmpLog = new LogData(false, templogstring, type);
|
||||
logDataList.Add(tmpLog);
|
||||
needToResetScrollBar = true;
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void ShowManualFromBrowser(string errorNum) {
|
||||
Application.OpenURL(GenerateManualUrl(errorNum));
|
||||
}
|
||||
|
||||
private string GenerateManualUrl(string errorNum) {
|
||||
return manualServerUrl + optionLanguage[optionLanguageIndex] + "/cri_external_error_list.html#" + errorNum;
|
||||
}
|
||||
|
||||
private void ParseUnityLogFile(string keyword) {
|
||||
bool foundCriLog = false;
|
||||
string criTmpFilePath = System.IO.Path.Combine(Path.GetTempPath() + "/Editor.log");
|
||||
try {
|
||||
File.Copy(Application.consoleLogPath, criTmpFilePath);
|
||||
string parsedLog = "";
|
||||
foreach (string line in File.ReadLines(criTmpFilePath)) {
|
||||
if (!foundCriLog) {
|
||||
if (line.Contains(keyword)) {
|
||||
parsedLog = line + "\r\n";
|
||||
foundCriLog = true;
|
||||
}
|
||||
} else {
|
||||
if (line != "") {
|
||||
parsedLog = parsedLog + line + "\r\n";
|
||||
} else {
|
||||
CategorizeLog(parsedLog);
|
||||
foundCriLog = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException copyError) {
|
||||
Debug.Log(copyError.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
File.Delete(criTmpFilePath);
|
||||
} catch (IOException deleteError) {
|
||||
Debug.Log(deleteError.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CategorizeLog(string log) {
|
||||
var matchW = Regex.Match(log, PATTERN_W);
|
||||
var matchE = Regex.Match(log, PATTERN_E);
|
||||
if(matchW.Success) {
|
||||
logDataList.Add(new LogData(false, log, LogType.Warning, matchW.ToString()));
|
||||
} else if(matchE.Success) {
|
||||
logDataList.Add(new LogData(false, log, LogType.Error, matchE.ToString()));
|
||||
} else {
|
||||
logDataList.Add(new LogData(false, log, LogType.Log, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare.Editor
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 189064c72c85d7c419a4bc2d55d2bbb2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6fe224288ee5bc47b8c9e7bdabef791
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,106 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriManaMovieController))]
|
||||
public class CriManaMovieControllerEditor : UnityEditor.Editor
|
||||
{
|
||||
private CriManaMovieController source = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
source = (CriManaMovieController)base.target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (this.source == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Startup Parameters");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
string moviePath = EditorGUILayout.TextField(new GUIContent("Movie Path", "The path to the movie file."), source.moviePath);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.moviePath = moviePath;
|
||||
}
|
||||
source.playOnStart = EditorGUILayout.Toggle(new GUIContent("Play On Start", "Immediatly play movie after Start of the component."), source.playOnStart);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool loop = EditorGUILayout.Toggle(new GUIContent("Loop", "Movie is played in continuous loop."), source.loop);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.loop = loop;
|
||||
}
|
||||
source.restartOnEnable = EditorGUILayout.Toggle(new GUIContent("Restart On Enable", "Restart playback after disabling and then enabling the component."), source.restartOnEnable);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool advancedAudioMode = EditorGUILayout.BeginToggleGroup(new GUIContent("Advanced Audio Mode", "Enable advanced audio mode."), source.advancedAudio);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
source.advancedAudio = advancedAudioMode;
|
||||
}
|
||||
if (source.advancedAudio)
|
||||
{
|
||||
EditorGUI.indentLevel += 2;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool useAmbisonics = EditorGUILayout.Toggle(new GUIContent("Ambisonics", "Use Ambisonics."), source.ambisonics);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
source.ambisonics = useAmbisonics;
|
||||
}
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
EditorGUILayout.PrefixLabel("Render Parameters");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool additiveMode = EditorGUILayout.Toggle(new GUIContent("Additive Mode", "Movie is rendered in additive blend mode."), source.additiveMode);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.additiveMode = additiveMode;
|
||||
}
|
||||
source.material = (Material)EditorGUILayout.ObjectField(new GUIContent("Material",
|
||||
"The material to render movie.\n" +
|
||||
"If 'none' use an internal default material."), source.material, typeof(Material), true);
|
||||
source.renderMode = (CriManaMovieMaterialBase.RenderMode)EditorGUILayout.EnumPopup(new GUIContent("Render Mode",
|
||||
"- Always: Render movie at each frame.\n" +
|
||||
"- OnVisibility: Render movie only when owner GameObject or Renderer Target is visible.\nOptimization when movie is not visible on screen.\n" +
|
||||
"- Never: Never render movie to the material. You need to call 'RenderMovie()' to control rendering."), source.renderMode);
|
||||
source.maxFrameDrop = (CriManaMovieMaterialBase.MaxFrameDrop)EditorGUILayout.EnumPopup(new GUIContent("Max Frame Drop",
|
||||
"- Disable: Disable frame dropping.\n" +
|
||||
"- One~Ten: Drops one or more maximum frames before each rendering if not in-sync.\n" +
|
||||
"- Infinite: Drops all frames until playback is in-sync.\n" +
|
||||
"Default is 'Two'."), source.maxFrameDrop);
|
||||
|
||||
EditorGUILayout.PrefixLabel("Renderer Control");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
source.target = (Renderer)EditorGUILayout.ObjectField(new GUIContent("Target", "Renderer object target to override its material with movie material.\nIf 'none', use owner GameObject Renderer if present."), source.target, typeof(Renderer), true);
|
||||
source.useOriginalMaterial = EditorGUILayout.Toggle(new GUIContent("Use Original Material", "If set to 'true', use the original Renderer Target material when movie is stopped."), source.useOriginalMaterial);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
if (GUI.changed) {
|
||||
EditorUtility.SetDirty(this.source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90f75aa41c1f34217898c275711b3e73
|
||||
timeCreated: 1445241046
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-91
@@ -1,91 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriManaMovieControllerForUI))]
|
||||
public class CriManaMovieControllerForUIEditor : UnityEditor.Editor
|
||||
{
|
||||
private CriManaMovieControllerForUI source = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
source = (CriManaMovieControllerForUI)base.target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (this.source == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Startup Parameters");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
string moviePath = EditorGUILayout.TextField(new GUIContent("Movie Path", "The path to the movie file."), source.moviePath);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.moviePath = moviePath;
|
||||
}
|
||||
source.playOnStart = EditorGUILayout.Toggle(new GUIContent("Play On Start", "Immediatly play movie after Start of the component."), source.playOnStart);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool loop = EditorGUILayout.Toggle(new GUIContent("Loop", "Movie is played in continuous loop."), source.loop);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.loop = loop;
|
||||
}
|
||||
source.restartOnEnable = EditorGUILayout.Toggle(new GUIContent("Restart On Enable", "Restart playback after disabling and then enabling the component."), source.restartOnEnable);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Render Parameters");
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool additiveMode = EditorGUILayout.Toggle(new GUIContent("Additive Mode", "Movie is rendered in additive blend mode."), source.additiveMode);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.additiveMode = additiveMode;
|
||||
}
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool applyTargetAlpha = EditorGUILayout.Toggle(new GUIContent("Apply Target Alpha", "Movie is rendered with Alpha color of the attached object."), source.applyTargetAlpha);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.applyTargetAlpha = applyTargetAlpha;
|
||||
}
|
||||
source.material = (Material)EditorGUILayout.ObjectField(new GUIContent("Material",
|
||||
"The material to render movie.\n" +
|
||||
"If 'none' use an internal default material."), source.material, typeof(Material), true);
|
||||
source.renderMode = (CriManaMovieMaterialBase.RenderMode)EditorGUILayout.EnumPopup(new GUIContent("Render Mode",
|
||||
"- Always: Render movie at each frame.\n" +
|
||||
"- OnVisibility: Render movie only when owner GameObject is visible or UI.Graphic Target is active. Optimization when movie is not visible on screen.\n" +
|
||||
"- Never: Never render movie to the material. You need to call 'RenderMovie()' to control rendering."), source.renderMode);
|
||||
source.maxFrameDrop = (CriManaMovieMaterialBase.MaxFrameDrop)EditorGUILayout.EnumPopup(new GUIContent("Max Frame Drop",
|
||||
"- Disable: Disable frame dropping.\n" +
|
||||
"- One~Ten: Drops one or more maximum frames before each rendering if not in-sync.\n" +
|
||||
"- Infinite: Drops all frames until playback is in-sync.\n" +
|
||||
"Default is 'Two'."), source.maxFrameDrop);
|
||||
|
||||
EditorGUILayout.PrefixLabel("Renderer Control");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
source.target = (UnityEngine.UI.Graphic)EditorGUILayout.ObjectField("Target", source.target, typeof(UnityEngine.UI.Graphic), true);
|
||||
source.useOriginalMaterial = EditorGUILayout.Toggle("Use Original Material", source.useOriginalMaterial);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
if (GUI.changed) {
|
||||
EditorUtility.SetDirty(this.source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe74e047c1a2845458bd23c1670338b4
|
||||
timeCreated: 1445245705
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,78 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriManaMovieMaterial))]
|
||||
public class CriManaMovieMaterialEditor : UnityEditor.Editor
|
||||
{
|
||||
private CriManaMovieMaterial source = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
source = (CriManaMovieMaterial)base.target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (this.source == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Startup Parameters");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
string moviePath = EditorGUILayout.TextField(new GUIContent("Movie Path", "The path to the movie file."), source.moviePath);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.moviePath = moviePath;
|
||||
}
|
||||
source.playOnStart = EditorGUILayout.Toggle(new GUIContent("Play On Start", "Immediatly play movie after Start of the component."), source.playOnStart);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool loop = EditorGUILayout.Toggle(new GUIContent("Loop", "Movie is played in continuous loop."), source.loop);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.loop = loop;
|
||||
}
|
||||
source.restartOnEnable = EditorGUILayout.Toggle(new GUIContent("Restart On Enable", "Restart playback after disabling and then enabling the component."), source.restartOnEnable);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
EditorGUILayout.PrefixLabel("Render Parameters");
|
||||
++EditorGUI.indentLevel;
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool additiveMode = EditorGUILayout.Toggle(new GUIContent("Additive Mode", "Movie is rendered in additive blend mode."), source.additiveMode);
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
source.additiveMode = additiveMode;
|
||||
}
|
||||
source.material = (Material)EditorGUILayout.ObjectField(new GUIContent("Material",
|
||||
"The material to render movie.\n" +
|
||||
"If 'none' use an internal default material."), source.material, typeof(Material), true);
|
||||
source.renderMode = (CriManaMovieMaterial.RenderMode)EditorGUILayout.EnumPopup(new GUIContent("Render Mode",
|
||||
"- Always: Render movie at each frame.\n" +
|
||||
"- OnVisibility: Render movie only when owner GameObject is visible. Optimization when movie is not visible on screen.\n" +
|
||||
"- Never: Never render movie to the material. You need to call 'RenderMovie()' to control rendering."), source.renderMode);
|
||||
source.maxFrameDrop = (CriManaMovieMaterial.MaxFrameDrop)EditorGUILayout.EnumPopup(new GUIContent("Max Frame Drop",
|
||||
"- Disabled: Disable frame dropping.\n" +
|
||||
"- One~Ten: Drops successively one or more frames at maximum if not in-sync.\n" +
|
||||
"- Infinite: Drops all frames until playback is in-sync.\n" +
|
||||
"Default is 'Disabled'."), source.maxFrameDrop);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
if (GUI.changed) {
|
||||
EditorUtility.SetDirty(this.source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 397790fc6753445de95b2745a82b84aa
|
||||
timeCreated: 1445249558
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28f29c601d9172d42a399e65de50bd21
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,172 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2019 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER && CRIWARE_TIMELINE_1_OR_NEWER
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriTimeline.Mana
|
||||
{
|
||||
[CustomEditor(typeof(CriManaClip)), CanEditMultipleObjects]
|
||||
public class CriManaTimelineComponentEditor : UnityEditor.Editor
|
||||
{
|
||||
private SerializedObject m_object;
|
||||
private SerializedProperty m_filePath;
|
||||
private SerializedProperty m_loopWithinClip;
|
||||
private SerializedProperty m_movieFrameRate;
|
||||
private SerializedProperty m_clipDuration;
|
||||
private SerializedProperty m_movieData;
|
||||
private SerializedProperty m_useOnMemoryPlayback;
|
||||
private SerializedProperty m_fadeinDuration;
|
||||
private SerializedProperty m_fadeinCurve;
|
||||
private SerializedProperty m_fadeoutDuration;
|
||||
private SerializedProperty m_fadeoutCurve;
|
||||
private SerializedProperty m_fadeAudio;
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
if (target != null) {
|
||||
m_object = new SerializedObject(target);
|
||||
m_filePath = m_object.FindProperty("m_moviePath");
|
||||
m_loopWithinClip = m_object.FindProperty("m_loopWithinClip");
|
||||
m_movieFrameRate = m_object.FindProperty("m_movieFrameRate");
|
||||
m_clipDuration = m_object.FindProperty("m_clipDuration");
|
||||
m_movieData = m_object.FindProperty("m_movieData");
|
||||
m_useOnMemoryPlayback = m_object.FindProperty("m_useOnMemoryPlayback");
|
||||
m_fadeinDuration = m_object.FindProperty("m_fadeinDuration");
|
||||
m_fadeoutDuration = m_object.FindProperty("m_fadeoutDuration");
|
||||
m_fadeAudio = m_object.FindProperty("m_fadeAudio");
|
||||
m_fadeinCurve = m_object.FindProperty("m_fadeinCurve");
|
||||
m_fadeoutCurve = m_object.FindProperty("m_fadeoutCurve");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (m_object == null ||
|
||||
m_filePath == null ||
|
||||
m_loopWithinClip == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_object.Update();
|
||||
EditorGUILayout.PropertyField(m_useOnMemoryPlayback);
|
||||
EditorGUILayout.PropertyField(m_movieData);
|
||||
if (m_useOnMemoryPlayback.boolValue) {
|
||||
GUI.enabled = false;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(m_filePath);
|
||||
|
||||
Event evt = Event.current;
|
||||
Rect moviePathFieldRect = GUILayoutUtility.GetLastRect();
|
||||
int id = GUIUtility.GetControlID(FocusType.Passive);
|
||||
switch (evt.type) {
|
||||
case EventType.DragUpdated:
|
||||
case EventType.DragPerform:
|
||||
if (!moviePathFieldRect.Contains(evt.mousePosition)) {
|
||||
break;
|
||||
}
|
||||
DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
|
||||
DragAndDrop.activeControlID = id;
|
||||
if (evt.type == EventType.DragPerform) {
|
||||
DragAndDrop.AcceptDrag();
|
||||
foreach (var path in DragAndDrop.paths) {
|
||||
if (System.IO.Path.GetExtension(path).Equals(".usm")) {
|
||||
string[] splitPath = Regex.Split(path, "Assets/StreamingAssets/");
|
||||
if(splitPath.Length < 2) {
|
||||
Debug.LogWarning("[Warning] Not in StreamingAssets Folder [" + System.IO.Path.GetFileName(path) + "].");
|
||||
} else {
|
||||
m_filePath.stringValue = splitPath[1];
|
||||
}
|
||||
|
||||
} else {
|
||||
Debug.LogWarning("[Warning] Not usm file [" + System.IO.Path.GetFileName(path) + "].");
|
||||
}
|
||||
}
|
||||
DragAndDrop.activeControlID = 0;
|
||||
}
|
||||
Event.current.Use();
|
||||
break;
|
||||
}
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
GUI.enabled = false;
|
||||
EditorGUILayout.PropertyField(m_movieFrameRate);
|
||||
EditorGUILayout.PropertyField(m_clipDuration);
|
||||
GUI.enabled = true;
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.PropertyField(m_loopWithinClip);
|
||||
|
||||
if ((target as CriManaClip).m_clip == null) return;
|
||||
var duration = (target as CriManaClip).m_clip.duration;
|
||||
EditorGUILayout.LabelField("Fade In", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.Slider(m_fadeinDuration, 0, (float)duration - m_fadeoutDuration.floatValue, new GUIContent("Duration [sec]"));
|
||||
EditorGUILayout.CurveField(m_fadeinCurve, Color.cyan, new Rect(0, 0, 1, 1), new GUIContent("Curve"));
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.LabelField("Fade Out", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.Slider(m_fadeoutDuration, 0, (float)duration-m_fadeinDuration.floatValue, new GUIContent("Duration [sec]"));
|
||||
EditorGUILayout.CurveField(m_fadeoutCurve, Color.cyan, new Rect(0, 0, 1, 1), new GUIContent("Curve"));
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.PropertyField(m_fadeAudio);
|
||||
|
||||
m_object.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
|
||||
[CustomTimelineEditor(typeof(CriManaClip))]
|
||||
public class CriManaClipEditor : ClipEditor
|
||||
{
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
|
||||
{
|
||||
var manaClip = clip.asset as CriManaClip;
|
||||
|
||||
var fullRect = region.position;
|
||||
fullRect.x = Mathf.LerpUnclamped(region.position.xMax, region.position.xMin, (float)region.endTime / (float)(region.endTime - region.startTime));
|
||||
fullRect.width *= (float)clip.duration / (float)(region.endTime - region.startTime);
|
||||
|
||||
var fadeinEnd = fullRect.xMin + fullRect.width * (float)(manaClip.m_fadeinDuration / clip.duration);
|
||||
var fadeoutStart = fullRect.xMax - fullRect.width * (float)(manaClip.m_fadeoutDuration / clip.duration);
|
||||
|
||||
GL.Begin(GL.TRIANGLES);
|
||||
GL.Color(Color.black);
|
||||
GL.Vertex3(fullRect.xMin, fullRect.yMin, 0);
|
||||
GL.Vertex3(fadeinEnd, fullRect.yMin, 0);
|
||||
GL.Vertex3(fullRect.xMin, fullRect.yMax, 0);
|
||||
GL.Vertex3(fullRect.xMax, fullRect.yMin, 0);
|
||||
GL.Vertex3(fullRect.xMax, fullRect.yMax, 0);
|
||||
GL.Vertex3(fadeoutStart, fullRect.yMin, 0);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(GL.LINES);
|
||||
GL.Color(Color.gray);
|
||||
GL.Vertex3(fadeinEnd, fullRect.yMin, 0);
|
||||
GL.Vertex3(fadeinEnd, fullRect.yMax, 0);
|
||||
GL.Vertex3(fadeoutStart, fullRect.yMin, 0);
|
||||
GL.Vertex3(fadeoutStart, fullRect.yMax, 0);
|
||||
GL.End();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 904fa2bb9e56dd1478e687f7e9861c52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "CriMw.CriWare.Editor",
|
||||
"references": [
|
||||
"CriMw.CriWare.Runtime",
|
||||
"Unity.Timeline",
|
||||
"Unity.Timeline.Editor"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "CRIWARE_TIMELINE_1_OR_NEWER"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd6f7e3ec622d1444bbb205e750a56c8
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ed031df3829ef741928cd2aa2f8075a
|
||||
timeCreated: 1513761507
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,947 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2018 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
public partial class CriProfiler
|
||||
{
|
||||
/* CRI Atom Preview connection ver. */
|
||||
private const int CRI_ATOM_PREVIEW_CONNECTION_VERSION = 0x00600000;
|
||||
|
||||
/* the size of the parameter "packet size" in bytes */
|
||||
private const int DATA_LENGTH_PARAM_SIZE = 4;
|
||||
|
||||
protected enum TcpCommandId {
|
||||
CRITCP_MAIL_OPEN = 1,
|
||||
CRITCP_MAIL_OPEN_RESULT,
|
||||
CRITCP_MAIL_RECV,
|
||||
CRITCP_MAIL_CHANGE,
|
||||
CRITCP_MAIL_EXIT,
|
||||
CRITCP_MAIL_SEND_CUESHEET_BINARY,
|
||||
CRITCP_MAIL_SEND_CUESHEET_BINARY_RESULT,
|
||||
CRITCP_MAIL_SEND_CUESHEET_BINARYDATA,
|
||||
CRITCP_MAIL_SEND_CUESHEET_BINARYDATA_RESULT,
|
||||
CRITCP_MAIL_START_MONITOR, /* 10 */
|
||||
CRITCP_MAIL_START_MONITOR_RESULT,
|
||||
CRITCP_MAIL_STOP_MONITOR,
|
||||
CRITCP_MAIL_STOP_MONITOR_RESULT,
|
||||
CRITCP_MAIL_MONITOR_AUOBJ_STATUS,
|
||||
CRITCP_MAIL_MONITOR_AUOBJ_STATUS_RESULT,
|
||||
CRITCP_MAIL_SEND_LOG_REQUEST,
|
||||
CRITCP_MAIL_SEND_LOG_REQUEST_RESULT,
|
||||
CRITCP_MAIL_START_LOG_PLAYBACK,
|
||||
CRITCP_MAIL_START_LOG_PLAYBACK_RESULT,
|
||||
CRITCP_MAIL_STOP_LOG_PLAYBACK, /* 20 */
|
||||
CRITCP_MAIL_STOP_LOG_PLAYBACK_RESULT,
|
||||
CRITCP_MAIL_START_LOG_RECORD,
|
||||
CRITCP_MAIL_START_LOG_RECORD_RESULT,
|
||||
CRITCP_MAIL_STOP_LOG_RECORD,
|
||||
CRITCP_MAIL_STOP_LOG_RECORD_RESULT,
|
||||
CRITCP_MAIL_DO_AUDIO_API,
|
||||
CRITCP_MAIL_DO_AUDIO_API_RESULT,
|
||||
CRITCP_MAIL_GET_COMMAND,
|
||||
CRITCP_MAIL_NON,
|
||||
CRITCP_MAIL_NUM_AUOBJ, /* 30 */
|
||||
CRITCP_MAIL_SEND_LOG,
|
||||
CRITCP_MAIL_SEND_LOG_RESULT,
|
||||
CRITCP_MAIL_PREVIEW_FLAG,
|
||||
CRITCP_MAIL_PREVIEW_FLAG_RESULT,
|
||||
CRITCP_MAIL_SEND_FILE_INFORMATION,
|
||||
CRITCP_MAIL_SEND_FILE_INFORMATION_RESULT,
|
||||
CRITCP_MAIL_SEND_FILE_DATA,
|
||||
CRITCP_MAIL_SEND_FILE_DATA_RESULT,
|
||||
CRITCP_MAIL_SEND_LOG_FOR_PLAYBACK,
|
||||
CRITCP_MAIL_SEND_LOG_FOR_PLAYBACK_RESULT, /* 40 */
|
||||
CRITCP_MAIL_PREVIEW_SEND_DETA_RESULT,
|
||||
CRITCP_MAIL_PREVIEW_SEND_DETA_RESULT_RESULT,
|
||||
CRITCP_MAIL_PREVIEW_CPU_LOAD,
|
||||
CRITCP_MAIL_PREVIEW_CPU_LOAD_RESULT,
|
||||
CRITCP_MAIL_PREVIEW_PLAYER_STATUS,
|
||||
CRITCP_MAIL_PREVIEW_PLAYER_STATUS_RESULT,
|
||||
CRITCP_MAIL_DO_FILE_SYSTEM_API,
|
||||
CRITCP_MAIL_DO_FILE_SYSTEM_API_RESULT,
|
||||
CRITCP_MAIL_SEND_REGISTER_ATOM_CONFIG_BINARY,
|
||||
CRITCP_MAIL_SEND_REGISTER_ATOM_CONFIG_BINARY_RESULT, /* 50 */
|
||||
CRITCP_MAIL_SEND_ATOM_CONFIG_BINARYDATA,
|
||||
CRITCP_MAIL_SEND_ATOM_CONFIG_BINARYDATA_RESULT,
|
||||
CRITCP_MAIL_SEND_ATOM_CUESHEET_BINARY,
|
||||
CRITCP_MAIL_SEND_ATOM_CUESHEET_BINARY_RESULT,
|
||||
CRITCP_MAIL_SEND_ATOM_CUESHEET_BINARYDATA,
|
||||
CRITCP_MAIL_SEND_ATOM_CUESHEET_BINARYDATA_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOM_EXPLAYBACKINFO_PLAY_POSITION,
|
||||
CRITCP_MAIL_MONITOR_ATOM_EXPLAYBACKINFO_PLAY_POSITION_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOM_EXPLAYBACKINFO_PLAY_END,
|
||||
CRITCP_MAIL_MONITOR_ATOM_EXPLAYBACKINFO_PLAY_END_RESULT, /* 60 */
|
||||
CRITCP_MAIL_MONITOR_ATOMEXPLAYERS_STATUS,
|
||||
CRITCP_MAIL_MONITOR_ATOMEXPLAYERS_STATUS_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOM_AUTO_MODULATION_AISAC_CONTROL,
|
||||
CRITCP_MAIL_MONITOR_ATOM_AUTO_MODULATION_AISAC_CONTROL_RESULT,
|
||||
CRITCP_MAIL_UPDATE_ATOM_CUESHEET_BINARY,
|
||||
CRITCP_MAIL_UPDATE_ATOM_CUESHEET_BINARY_RESULT,
|
||||
CRITCP_MAIL_UPDATE_ATOM_CUESHEET_BINARYDATA,
|
||||
CRITCP_MAIL_UPDATE_ATOM_CUESHEET_BINARYDATA_RESULT,
|
||||
CRITCP_MAIL_REQUEST_SEND_ACB,
|
||||
CRITCP_MAIL_REQUEST_SEND_ACB_RESULT, /* 70 */
|
||||
CRITCP_MAIL_SHOW_WINDOW,
|
||||
CRITCP_MAIL_SHOW_WINDOW_RESULT,
|
||||
CRITCP_MAIL_MONITOR_OVERWRITE_ACB,
|
||||
CRITCP_MAIL_MONITOR_OVERWRITE_ACB_RESULT,
|
||||
CRITCP_MAIL_OVERWRITE_ACB,
|
||||
CRITCP_MAIL_OVERWRITE_ACB_RESULT,
|
||||
CRITCP_MAIL_OVERWRITE_ACB_DATA,
|
||||
CRITCP_MAIL_OVERWRITE_ACB_DATA_RESULT,
|
||||
CRITCP_MAIL_MONITOR_RELEASE_ACB,
|
||||
CRITCP_MAIL_MONITOR_RELEASE_ACB_RESULT, /* 80 */
|
||||
CRITCP_MAIL_SEND_DUMMY,
|
||||
CRITCP_MAIL_SEND_DUMMY_RESULT,
|
||||
CRITCP_MAIL_UPDATE_PART_OF_ACF,
|
||||
CRITCP_MAIL_UPDATE_PART_OF_ACF_RESULT,
|
||||
CRITCP_MAIL_UPDATE_PART_OF_ACF_DATA,
|
||||
CRITCP_MAIL_UPDATE_PART_OF_ACF_DATA_RESULT,
|
||||
CRITCP_MAIL_MONITOR_OVERWRITE_ACF,
|
||||
CRITCP_MAIL_MONITOR_OVERWRITE_ACF_RESULT,
|
||||
CRITCP_MAIL_OVERWRITE_ACF,
|
||||
CRITCP_MAIL_OVERWRITE_ACF_RESULT, /* 90 */
|
||||
CRITCP_MAIL_OVERWRITE_ACF_DATA,
|
||||
CRITCP_MAIL_OVERWRITE_ACF_DATA_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOMEXASR_BUS_INFO,
|
||||
CRITCP_MAIL_MONITOR_ATOMEXASR_BUS_INFO_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOMEX_ERR_INFO,
|
||||
CRITCP_MAIL_MONITOR_ATOMEX_ERR_INFO_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOMEXASR_DSP_SPECTRA,
|
||||
CRITCP_MAIL_MONITOR_ATOMEXASR_DSP_SPECTRA_RESULT,
|
||||
CRITCP_MAIL_START_BOUNCE,
|
||||
CRITCP_MAIL_START_BOUNCE_RESULT, /* 100 */
|
||||
CRITCP_MAIL_STOP_BOUNCE,
|
||||
CRITCP_MAIL_STOP_BOUNCE_RESULT,
|
||||
CRITCP_MAIL_MONITOR_SEQUENCER_CALLBACK,
|
||||
CRITCP_MAIL_MONITOR_SEQUENCER_CALLBACK_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOM_TRACK_MUTE,
|
||||
CRITCP_MAIL_MONITOR_ATOM_TRACK_MUTE_RESULT,
|
||||
CRITCP_MAIL_MONITOR_PREVIEW_INFO,
|
||||
CRITCP_MAIL_MONITOR_PREVIEW_INFO_RESULT,
|
||||
CRITCP_MAIL_MONITOR_STREAM_AWB_INFO,
|
||||
CRITCP_MAIL_MONITOR_STREAM_AWB_INFO_RESULT, /* 110 */
|
||||
CRITCP_MAIL_CONNECTION_VERSION,
|
||||
CRITCP_MAIL_CONNECTION_VERSION_RESULT,
|
||||
CRITCP_MAIL_MONITOR_ATOM_EXPLAYBACKINFO_PLAY_POSITION_WITH_PLAY_STATUS,
|
||||
CRITCP_MAIL_MONITOR_REJECT_OVERWRITE_ACB,
|
||||
};
|
||||
|
||||
/* ログ用API識別番号 */
|
||||
protected const int logFuncBaseNum = 2000;
|
||||
protected enum LogFuncId {
|
||||
LOG_COMMAND_Non = 0, /* Non */
|
||||
LOG_COMMAND_Ex_Initialize, /* criAtomEx_Initialize */
|
||||
LOG_COMMAND_Ex_Finalize, /* criAtomEx_Finalize */
|
||||
LOG_COMMAND_ExAsr_Initialize, /* criAtomExAsr_Initialize */
|
||||
LOG_COMMAND_ExAsr_Finalize, /* criAtomExAsr_Finalize */
|
||||
LOG_COMMAND_ExHcaMx_Initialize, /* criAtomExHcaMx_Initialize */
|
||||
LOG_COMMAND_ExHcaMx_Finalize, /* criAtomExHcaMx_Finalize */
|
||||
LOG_COMMAND_Dbas_Create, /* criAtomDbas_Create */
|
||||
LOG_COMMAND_Dbas_Destroy, /* criAtomDbas_Destroy */
|
||||
LOG_COMMAND_StreamingCache_Create, /* criAtomStreamingCache_Create */
|
||||
LOG_COMMAND_StreamingCache_Destroy, /* criAtomStreamingCache_Destroy */
|
||||
LOG_COMMAND_ExVoicePool_AllocateStandardVoicePool, /* criAtomExVoicePool_AllocateStandardVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAdxVoicePool, /* criAtomExVoicePool_AllocateAdxVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAhxVoicePool, /* criAtomExVoicePool_AllocateAhxVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateHcaVoicePool, /* criAtomExVoicePool_AllocateHcaVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateHcaMxVoicePool, /* criAtomExVoicePool_AllocateHcaMxVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateWaveVoicePool, /* criAtomExVoicePool_AllocateWaveVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateRawPcmVoicePool, /* criAtomExVoicePool_AllocateRawPcmVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAdpcmVoicePool_WII, /* criAtomExVoicePool_AllocateAdpcmVoicePool_WII */
|
||||
LOG_COMMAND_ExVoicePool_AllocateVagVoicePool_PSP, /* criAtomExVoicePool_AllocateVagVoicePool_PSP */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAdpcmVoicePool_3DS, /* criAtomExVoicePool_AllocateAdpcmVoicePool_3DS */
|
||||
LOG_COMMAND_ExVoicePool_AllocateVagVoicePool_VITA, /* criAtomExVoicePool_AllocateVagVoicePool_VITA */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAtrac3VoicePool_PSP,/* criAtomExVoicePool_AllocateAtrac3VoicePool_PSP */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAt9VoicePool_VITA, /* criAtomExVoicePool_AllocateAt9VoicePool_VITA */
|
||||
LOG_COMMAND_ExVoicePool_Free, /* criAtomExVoicePool_Free */
|
||||
LOG_COMMAND_ExPlayer_Create, /* criAtomExPlayer_Create */
|
||||
LOG_COMMAND_ExPlayer_Destroy, /* criAtomExPlayer_Destroy */
|
||||
LOG_COMMAND_ExTween_Create, /* criAtomExTween_Create */
|
||||
LOG_COMMAND_ExTween_Destroy, /* criAtomExTween_Destroy */
|
||||
LOG_COMMAND_Decrypter_Create, /* criAtomDecrypter_Create */
|
||||
LOG_COMMAND_Decrypter_Destroy, /* criAtomDecrypter_Destroy */
|
||||
LOG_COMMAND_Ex3dSource_Create, /* criAtomEx3dSource_Create */
|
||||
LOG_COMMAND_Ex3dSource_Destroy, /* criAtomEx3dSource_Destroy */
|
||||
LOG_COMMAND_Ex3dListener_Create, /* criAtomEx3dListener_Create */
|
||||
LOG_COMMAND_Ex3dListener_Destroy, /* criAtomEx3dListener_Destroy */
|
||||
LOG_COMMAND_ExPlayer_AttachFader, /* criAtomExPlayer_AttachFader */
|
||||
LOG_COMMAND_ExPlayer_DetachFader, /* criAtomExPlayer_DetachFader */
|
||||
LOG_COMMAND_Ex_RegisterAcfConfig, /* criAtomEx_RegisterAcfConfig */
|
||||
LOG_COMMAND_Ex_RegisterAcfData, /* criAtomEx_RegisterAcfData */
|
||||
LOG_COMMAND_Ex_RegisterAcfFile, /* criAtomEx_RegisterAcfFile */
|
||||
LOG_COMMAND_Ex_RegisterAcfFileById, /* criAtomEx_RegisterAcfFileById */
|
||||
LOG_COMMAND_Ex_UnregisterAcf, /* criAtomEx_UnregisterAcf */
|
||||
LOG_COMMAND_ExAcb_LoadAcbData, /* criAtomExAcb_LoadAcbData */
|
||||
LOG_COMMAND_ExAcb_LoadAcbDataById, /* criAtomExAcb_LoadAcbDataById */
|
||||
LOG_COMMAND_ExAcb_LoadAcbFile, /* criAtomExAcb_LoadAcbFile */
|
||||
LOG_COMMAND_ExAcb_LoadAcbFileById, /* criAtomExAcb_LoadAcbFileById */
|
||||
LOG_COMMAND_ExAcb_Release, /* criAtomExAcb_Release */
|
||||
LOG_COMMAND_ExAcb_ReleaseAll, /* criAtomExAcb_ReleaseAll */
|
||||
LOG_COMMAND_ExPlayer_Start, /* criAtomExPlayer_Start */
|
||||
LOG_COMMAND_ExPlayer_Prepare, /* criAtomExPlayer_Prepare */
|
||||
LOG_COMMAND_ExPlayer_Stop, /* criAtomExPlayer_Stop */
|
||||
LOG_COMMAND_ExPlayer_StopWithoutReleaseTime, /* criAtomExPlayer_StopWithoutReleaseTime */
|
||||
LOG_COMMAND_ExPlayback_Stop, /* criAtomExPlayback_Stop */
|
||||
LOG_COMMAND_ExPlayback_StopWithoutReleaseTime, /* criAtomExPlayback_StopWithoutReleaseTime */
|
||||
LOG_COMMAND_ExPlayer_Pause, /* criAtomExPlayer_Pause */
|
||||
LOG_COMMAND_ExPlayer_Resume, /* criAtomExPlayer_Resume */
|
||||
LOG_COMMAND_ExPlayback_Pause, /* criAtomExPlayback_Pause */
|
||||
LOG_COMMAND_ExPlayback_Resume, /* criAtomExPlayback_Resume */
|
||||
LOG_COMMAND_ExPlaybackInfo_AllocateInfo, /* criAtomExPlaybackInfo_AllocateInfo */
|
||||
LOG_COMMAND_ExPlaybackInfo_FreeInfo, /* criAtomExPlaybackInfo_FreeInfo */
|
||||
LOG_COMMAND_Error, /* criError */
|
||||
LOG_COMMAND_ExPlaybackInfo_AddSound, /* criAtomExPlaybackInfo_AddSound */
|
||||
LOG_COMMAND_ExPlaybackSound_FreeSound, /* criAtomExPlaybackSound_FreeSound */
|
||||
LOG_COMMAND_SoundPlayer_Start, /* criAtomSoundPlayer_Start */
|
||||
LOG_COMMAND_SoundPlayer_Stop, /* criAtomSoundPlayer_Stop */
|
||||
LOG_COMMAND_SoundPlayer_StopWithoutRelease, /* criAtomSoundPlayer_StopWithoutRelease */
|
||||
LOG_COMMAND_SoundPlayer_PausePlayback, /* criAtomSoundPlayer_PausePlayback */
|
||||
LOG_COMMAND_SoundPlayer_SetWaveId, /* criAtomSoundPlayer_SetWaveId */
|
||||
LOG_COMMAND_SoundPlayer_SetContentId, /* criAtomSoundPlayer_SetContentId */
|
||||
LOG_COMMAND_SoundPlayer_SetData, /* criAtomSoundPlayer_SetData */
|
||||
LOG_COMMAND_SoundPlayer_SetFileStringPointer, /* criAtomSoundPlayer_SetFileStringPointer */
|
||||
LOG_COMMAND_ExPlayer_SetCueId, /* criAtomExPlayer_SetCueId */
|
||||
LOG_COMMAND_ExPlayer_SetCueName, /* criAtomExPlayer_SetCueName */
|
||||
LOG_COMMAND_ExPlayer_SetCueIndex, /* criAtomExPlayer_SetCueIndex */
|
||||
LOG_COMMAND_ExPlayer_SetData, /* criAtomExPlayer_SetData */
|
||||
LOG_COMMAND_ExPlayer_SetFile, /* criAtomExPlayer_SetFile */
|
||||
LOG_COMMAND_ExPlayer_SetContentId, /* criAtomExPlayer_SetContentId */
|
||||
LOG_COMMAND_ExPlayer_SetWaveId, /* criAtomExPlayer_SetWaveId */
|
||||
LOG_COMMAND_DbasId, /* CriAtomDbasId */
|
||||
LOG_COMMAND_StreamingCacheId, /* CriAtomStreamingCacheId */
|
||||
LOG_COMMAND_ExVoicePoolHn, /* CriAtomExVoicePoolHn */
|
||||
LOG_COMMAND_ExPlayerHn, /* CriAtomExPlayerHn */
|
||||
LOG_COMMAND_ExTweenHn, /* CriAtomExTweenHn */
|
||||
LOG_COMMAND_DecrypterHn, /* CriAtomDecrypterHn */
|
||||
LOG_COMMAND_Ex3dSourceHn, /* CriAtomEx3dSourceHn */
|
||||
LOG_COMMAND_Ex3dListenerHn, /* CriAtomEx3dListenerHn */
|
||||
LOG_COMMAND_ExPlaybackId, /* CriAtomExPlaybackId */
|
||||
LOG_COMMAND_ExConfig, /* CriAtomExConfig */
|
||||
LOG_COMMAND_ExAsrConfig, /* CriAtomExAsrConfig */
|
||||
LOG_COMMAND_ExHcaMxConfig, /* CriAtomExHcaMxConfig */
|
||||
LOG_COMMAND_DbasConfig, /* CriAtomDbasConfig */
|
||||
LOG_COMMAND_StreamingCacheConfig, /* CriAtomStreamingCacheConfig */
|
||||
LOG_COMMAND_ExStandardVoicePoolConfig, /* CriAtomExStandardVoicePoolConfig */
|
||||
LOG_COMMAND_ExAdxVoicePoolConfig, /* CriAtomExAdxVoicePoolConfig */
|
||||
LOG_COMMAND_ExAhxVoicePoolConfig, /* CriAtomExAhxVoicePoolConfig */
|
||||
LOG_COMMAND_ExHcaVoicePoolConfig, /* CriAtomExHcaVoicePoolConfig */
|
||||
LOG_COMMAND_ExHcaMxVoicePoolConfig, /* CriAtomExHcaMxVoicePoolConfig */
|
||||
LOG_COMMAND_ExWaveVoicePoolConfig, /* CriAtomExWaveVoicePoolConfig */
|
||||
LOG_COMMAND_ExRawPcmVoicePoolConfig, /* CriAtomExRawPcmVoicePoolConfig */
|
||||
LOG_COMMAND_ExAdpcmVoicePoolConfig_3DS, /* CriAtomExAdpcmVoicePoolConfig_3DS */
|
||||
LOG_COMMAND_ExAdpcmVoicePoolConfig_WII, /* CriAtomExAdpcmVoicePoolConfig_WII */
|
||||
LOG_COMMAND_ExVagVoicePoolConfig_PSP, /* CriAtomExVagVoicePoolConfig_PSP */
|
||||
LOG_COMMAND_ExAtrac3VoicePoolConfig_PSP, /* CriAtomExAtrac3VoicePoolConfig_PSP */
|
||||
LOG_COMMAND_ExVagVoicePoolConfig_VITA, /* CriAtomExVagVoicePoolConfig_VITA */
|
||||
LOG_COMMAND_ExAt9VoicePoolConfig_VITA, /* CriAtomExAt9VoicePoolConfig_VITA */
|
||||
LOG_COMMAND_ExPlayerConfig, /* CriAtomExPlayerConfig */
|
||||
LOG_COMMAND_ExTweenConfig, /* CriAtomExTweenConfig */
|
||||
LOG_COMMAND_DecrypterConfig, /* CriAtomDecrypterConfig */
|
||||
LOG_COMMAND_ExAcfConfig, /* CriAtomExAcfConfig */
|
||||
LOG_COMMAND_Ex3dSourceConfig, /* CriAtomEx3dSourceConfig */
|
||||
LOG_COMMAND_Ex3dListenerConfig, /* CriAtomEx3dListenerConfig */
|
||||
LOG_COMMAND_ExFaderConfig, /* CriAtomExFaderConfig */
|
||||
LOG_COMMAND_ExAcbHn, /* CriAtomExAcbHn */
|
||||
LOG_COMMAND_ExFaderHn, /* CriAtomExFaderHn */
|
||||
LOG_COMMAND_PlayerPoolPlayerInfo, /* CriAtomPlayerPoolPlayerInfo */
|
||||
LOG_COMMAND_PlayerPool_ReleasePlayer, /* criAtomPlayerPool_ReleasePlayer */
|
||||
LOG_COMMAND_SoundPlayer_Allocate_Element, /* criatomsoundplayer_allocate_element */
|
||||
LOG_COMMAND_ExCategory_CancelCuePlayback, /* criAtomExCategory_CancelCuePlayback */
|
||||
LOG_COMMAND_ExCue_StopByLimit, /* criAtomExCue_StopByLimit */
|
||||
LOG_COMMAND_ExCue_CancelCuePlayback, /* criAtomExCue_CancelCuePlayback */
|
||||
LOG_COMMAND_CancelPlaybackByProbability, /* criAtomExCue_CancelPlaybackByProbability */
|
||||
LOG_COMMAND_CancelPlaybackByCueTypeRandom, /* criAtomExCue_CancelPlaybackByyCueTypeRandom */
|
||||
LOG_COMMAND_CancelPlaybackByCueTypeSwitch, /* criAtomExCue_CancelPlaybackByyCueTypeSwitch */
|
||||
LOG_COMMAND_ExCategory_IncrementNumPlaybackCues, /* criAtomExCategory_IncrementNumPlaybackCues */
|
||||
LOG_COMMAND_ExCategory_DecrementNumPlaybackCues, /* criAtomExCategory_DecrementNumPlaybackCues */
|
||||
LOG_COMMAND_SoundVoice_Volume, /* criatomsoundvoice_parameter_update_on_changed:volume */
|
||||
LOG_COMMAND_SoundVoice_FreeVoice, /* criatomsoundvoice_FreeVoice */
|
||||
LOG_COMMAND_ExSequence_GetFreeBlock, /* criAtomExSequence_GetFreeSequenceBlock */
|
||||
LOG_COMMAND_ExSequence_SetFreeBlock, /* criAtomExSequence_SetFreeSequenceBlock */
|
||||
LOG_COMMAND_ExSequence_GetFreeSeqInfo, /* criAtomExSequence_GetFreeSequenceInfo */
|
||||
LOG_COMMAND_ExSequence_SetFreeSeqInfo, /* criAtomExSequence_SetFreeSequenceInfo */
|
||||
LOG_COMMAND_SoundVoice_Allocate, /* criAtomSoundVoice_AllocateVoice */
|
||||
LOG_COMMAND_GetAisacDestinationValue, /* criAtomCueSheet_GetAisacDestinationValue */
|
||||
LOG_COMMAND_SequenceTrack_Mute, /* criAtomSequenceTrack_Mute */
|
||||
LOG_COMMAND_Preview_RequestSendLog, /* CriAtomMonitorLoc::MakeLogSendRequestPacket */
|
||||
LOG_COMMAND_RequestSendAcb, /* CriAtomMonitorLoc::MakeRequestPacket4SendAcb */
|
||||
LOG_COMMAND_Monitor_MakeClosePacket, /* CriAtomMonitorLoc::MakeClosePacket */
|
||||
LOG_COMMAND_Monitor_MakeSendDataResultPacket, /* CriAtomMonitorLoc::MakeSendDataResultPacket */
|
||||
LOG_COMMAND_CpuLoadAndNumUsedVoices, /* CriAtomMonitorLoc::MakePerformanceInfoPacket */
|
||||
LOG_COMMAND_SequenceCallback, /* SequenceCallback */
|
||||
LOG_COMMAND_OverwriteAcf, /* CriAtomMonitorLoc::MakeRequestPacket4OverwriteAcf */
|
||||
LOG_COMMAND_StartLogging, /* CriAtomMonitorLoc::MakeLoggingStartTimePacket */
|
||||
LOG_COMMAND_SequenceLoopInfo, /* SequenceLoopInfo */
|
||||
LOG_COMMAND_Ex3dSource_Update, /* criAtomEx3dSource_Update */
|
||||
LOG_COMMAND_Ex3dListener_Update, /* criAtomEx3dListener_Update */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAiffVoicePool, /* criAtomExVoicePool_AllocateAiffVoicePool */
|
||||
LOG_COMMAND_ExAiffVoicePoolConfig, /* CriAtomExAiffVoicePoolConfig */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAt9VoicePool_PS4, /* criAtomExVoicePool_AllocateAt9VoicePool_PS4 */
|
||||
LOG_COMMAND_ExAt9VoicePoolConfig_PS4, /* CriAtomExAt9VoicePoolConfig_PS4 */
|
||||
LOG_COMMAND_UserLog, /* criAtomExMonitor_OutputUserLog */
|
||||
LOG_COMMAND_ExCategoryConfig, /* CriAtomExCategoryConfig */
|
||||
LOG_COMMAND_SoundVoice_KillByLimit, /* criatomsoundvoice_KillByLimit */
|
||||
LOG_COMMAND_SoundVoice_Virtualize, /* criatomsoundvoice_Virtualize */
|
||||
LOG_COMMAND_SoundVoice_UnVirtualize, /* criatomsoundvoice_UnVirtualize */
|
||||
LOG_COMMAND_AsrBusAnalyzeInfo, /* criAtomPreview_MakeAsrBusInfoPacket */
|
||||
LOG_COMMAND_LoudnessInfo, /* criAtomPreview_MakeLoudnessInfoPacket */
|
||||
LOG_COMMAND_StreamingInfo, /* criAtomPreview_MakeStreamingInfoPacket */
|
||||
LOG_COMMAND_PlayerPool_NumVoices, /* criAtomPreview_MakeLogPacketNumVoiceInVoicePool */
|
||||
LOG_COMMAND_ExVoicePool_AllocateAdpcmVoicePool_WIIU,/* criAtomExVoicePool_AllocateAdpcmVoicePool_WIIU */
|
||||
LOG_COMMAND_ExAdpcmVoicePoolConfig_WIIU, /* CriAtomExAdpcmVoicePoolConfig_WIIU */
|
||||
LOG_COMMAND_StreamTypeMemory, /* StreamTypeMemory */
|
||||
LOG_COMMAND_StreamTypeStream, /* StreamTypeStream */
|
||||
LOG_COMMAND_StreamTypeZeroLatencyStream, /* StreamTypeZeroLatencyStream */
|
||||
LOG_COMMAND_AsrBusAnalyzeInfoAllCh, /* criAtomPreview_MakeAsrBusInfoPacketForProfiler */
|
||||
LOG_COMMAND_ExPlayer_SetAisacControlValue, /* criAtomExPlayer_SetAisacControlByName, ById */
|
||||
LOG_COMMAND_SequenceTrack_Start, /* SetupSeuenceTrack */
|
||||
LOG_COMMAND_SequenceTrack_Stop, /* criAtomSequence_FreeSequenceTrack */
|
||||
LOG_COMMAND_SoundPlayer_SetVibrationId, /* criAtomSoundPlayer_SoundPlayer_SetVibrationId */
|
||||
LOG_COMMAND_ExGameVariableConfig, /* CriAtomExGameVariableConfig */
|
||||
LOG_COMMAND_SetGameVariable, /* SetGameVariableByname, ById */
|
||||
LOG_COMMAND_ExVibrationVoicePoolConfig, /* CriAtomExVibrationVoicePoolConfig */
|
||||
LOG_COMMAND_ExVoicePool_AllocateVibrationVoicePool, /* criAtomExVoicePool_AllocateVibrationVoicePool */
|
||||
LOG_COMMAND_ExVoicePlayer_Pause, /* criAtomExPlayer_Pause */
|
||||
LOG_COMMAND_SoundPlayer_SetVibrationName, /* criAtomSoundPlayer_SoundPlayer_SetVibrationName */
|
||||
LOG_COMMAND_ExCategory_Stop, /* criAtomExCategory_Stop */
|
||||
LOG_COMMAND_ExCategory_StopWithoutReleaseTime, /* criAtomExCategory_StopWithoutReleaseTime */
|
||||
LOG_COMMAND_Ex3dTransceiver_Create, /* criAtomEx3dTransceiver_Create */
|
||||
LOG_COMMAND_Ex3dTransceiver_Destroy, /* criAtomEx3dTransceiver_Destroy */
|
||||
LOG_COMMAND_Ex3dTransceiverHn, /* criAtomEx3dTransceiverHn */
|
||||
LOG_COMMAND_Ex3dTransceiverConfig, /* criAtomEx3dTransceiverConfig */
|
||||
LOG_COMMAND_Ex3dTransceiver_UpdateInput, /* criAtomEx3dTransceiver_UpdateInput */
|
||||
LOG_COMMAND_Ex3dTransceiver_UpdateOutput, /* criAtomEx3dTransceiver_UpdateOutput */
|
||||
LOG_COMMAND_SoundVoice_CalcFinalVoiceParamAndSilentVolumeCore, /* criAtomVoice_CalcFinalVoiceParamAndSilentVolumeCore */
|
||||
LOG_COMMAND_AdmPlayer_Create, /* criAtomAdmPlayer_Create */
|
||||
LOG_COMMAND_AdmPlayer_Destroy, /* criAtomAdmPlayer_Destroy */
|
||||
LOG_COMMAND_AdmPlayer_InternalStart, /* criatomadmplayer_internal_start */ /* フェーズ単位の再生処理 */
|
||||
LOG_COMMAND_AdmPlayer_Start, /* criAtomAdmPlayer_Start */
|
||||
LOG_COMMAND_AdmPlayer_Stop, /* criAtomAdmPlayer_Stop */
|
||||
LOG_COMMAND_AdmPlayer_StopByPhraseEnd, /* criAtomAdmPlayer_StopByPhraseEnd */
|
||||
};
|
||||
|
||||
protected enum LogParamId {
|
||||
LOG_STRINGS_ITEM_CRIATOMDEF = 0, /* #CRIATOMDEF */
|
||||
LOG_STRINGS_ITEM_CRIATOM, /* #CRIATOM */
|
||||
LOG_STRINGS_ITEM_TimeStamp, /* TimeStamp */
|
||||
LOG_STRINGS_ITEM_ThreadId, /* ThreadId */
|
||||
LOG_STRINGS_ITEM_ThreadModel, /* thread_model */
|
||||
LOG_STRINGS_ITEM_ServerFrequency, /* server_frequency */
|
||||
LOG_STRINGS_ITEM_ParameterUpdateInterval, /* parameter_update_interval */
|
||||
LOG_STRINGS_ITEM_MaxVirtualVoices, /* max_virtual_voices */
|
||||
LOG_STRINGS_ITEM_MaxVoiceLimitGroups, /* max_voice_limit_groups */
|
||||
LOG_STRINGS_ITEM_MaxCategories, /* max_categories */
|
||||
LOG_STRINGS_ITEM_MaxSequences, /* max_sequences */
|
||||
LOG_STRINGS_ITEM_MaxTracks, /* max_tracks */
|
||||
LOG_STRINGS_ITEM_MaxTrackItems, /* max_track_items */
|
||||
LOG_STRINGS_ITEM_MaxAisacAutoModulations, /* max_aisac_auto_modulations */
|
||||
LOG_STRINGS_ITEM_MaxPitch, /* max_pitch */
|
||||
LOG_STRINGS_ITEM_CoordinateSystem, /* coordinate_system */
|
||||
LOG_STRINGS_ITEM_RngIf, /* rng_if */
|
||||
LOG_STRINGS_ITEM_FsConfig, /* fs_config */
|
||||
LOG_STRINGS_ITEM_Context, /* context */
|
||||
LOG_STRINGS_ITEM_OutputChannels, /* output_channels */
|
||||
LOG_STRINGS_ITEM_OutputSamplingRate, /* output_sampling_rate */
|
||||
LOG_STRINGS_ITEM_SoundRendererType, /* sound_renderer_type */
|
||||
LOG_STRINGS_ITEM_NumMixers, /* num_mixers */
|
||||
LOG_STRINGS_ITEM_MaxVoices, /* max_voices */
|
||||
LOG_STRINGS_ITEM_MaxInputChannels, /* max_input_channels */
|
||||
LOG_STRINGS_ITEM_MaxSamplingRate, /* max_sampling_rate */
|
||||
LOG_STRINGS_ITEM_Identifier, /* identifier */
|
||||
LOG_STRINGS_ITEM_MaxStreams, /* max_streams */
|
||||
LOG_STRINGS_ITEM_MaxBps, /* max_bps */
|
||||
LOG_STRINGS_ITEM_DbasId, /* CriAtomDbasId */
|
||||
LOG_STRINGS_ITEM_MaxPath, /* max_path */
|
||||
LOG_STRINGS_ITEM_MaxFiles, /* max_files */
|
||||
LOG_STRINGS_ITEM_CacheSize, /* cache_size */
|
||||
LOG_STRINGS_ITEM_StreamingCacheId, /* CriAtomStreamingCacheId */
|
||||
LOG_STRINGS_ITEM_NumVoices, /* num_voices */
|
||||
LOG_STRINGS_ITEM_MaxChannels, /* max_channels */
|
||||
LOG_STRINGS_ITEM_StreamingFlag, /* streaming_flag */
|
||||
LOG_STRINGS_ITEM_DecodeLatency, /* decode_latency */
|
||||
LOG_STRINGS_ITEM_ExVoicePoolHn, /* CriAtomExVoicePoolHn */
|
||||
LOG_STRINGS_ITEM_AllocationMethod, /* allocation_method */
|
||||
LOG_STRINGS_ITEM_MaxPathStrings, /* max_path_strings */
|
||||
LOG_STRINGS_ITEM_UpdatesTime, /* updates_time */
|
||||
LOG_STRINGS_ITEM_ExPlayerHn, /* CriAtomExPlayerHn */
|
||||
LOG_STRINGS_ITEM_Id, /* id */
|
||||
LOG_STRINGS_ITEM_ParameterType, /* parameter_type */
|
||||
LOG_STRINGS_ITEM_Key, /* key */
|
||||
LOG_STRINGS_ITEM_DecrypterHn, /* CriAtomDecrypterHn */
|
||||
LOG_STRINGS_ITEM_Work, /* work */
|
||||
LOG_STRINGS_ITEM_WorkSize, /* work_size */
|
||||
LOG_STRINGS_ITEM_Ex3dSourceHn, /* CriAtomEx3dSourceHn */
|
||||
LOG_STRINGS_ITEM_Ex3dListenerHn, /* CriAtomEx3dListenerHn */
|
||||
LOG_STRINGS_ITEM_ExPlaybackId, /* CriAtomExPlaybackId */
|
||||
LOG_STRINGS_ITEM_ExFaderConfig, /* CriAtomExFaderConfig */
|
||||
LOG_STRINGS_ITEM_ExAcfConfig, /* CriAtomExAcfConfig */
|
||||
LOG_STRINGS_ITEM_AcfData, /* acf_data */
|
||||
LOG_STRINGS_ITEM_AcfDataSize, /* acf_data_size */
|
||||
LOG_STRINGS_ITEM_FsBinderHn, /* CriFsBinderHn */
|
||||
LOG_STRINGS_ITEM_Path, /* path */
|
||||
LOG_STRINGS_ITEM_AcbData, /* acb_data */
|
||||
LOG_STRINGS_ITEM_AcbDataSize, /* acb_data_size */
|
||||
LOG_STRINGS_ITEM_AwbPath, /* awb_path */
|
||||
LOG_STRINGS_ITEM_AwbId, /* awb_id */
|
||||
LOG_STRINGS_ITEM_AcbPath, /* acb_path */
|
||||
LOG_STRINGS_ITEM_AcbId, /* acb_id */
|
||||
LOG_STRINGS_ITEM_ExAcbHn, /* CriAtomExAcbHn */
|
||||
LOG_STRINGS_ITEM_Sw, /* sw */
|
||||
LOG_STRINGS_ITEM_ExResumeMode, /* CriAtomExResumeMode */
|
||||
LOG_STRINGS_ITEM_ErrorString, /* error_string */
|
||||
LOG_STRINGS_ITEM_SoundPlaybackId, /* CriAtomSoundPlaybackId */
|
||||
LOG_STRINGS_ITEM_SoundPlayerHn, /* CriAtomSoundPlayerHn */
|
||||
LOG_STRINGS_ITEM_AwbHn, /* CriAtomAwbHn */
|
||||
LOG_STRINGS_ITEM_ExCueId, /* CriAtomExCueId */
|
||||
LOG_STRINGS_ITEM_CueName, /* cue_name */
|
||||
LOG_STRINGS_ITEM_ExCueIndex, /* CriAtomExCueIndex */
|
||||
LOG_STRINGS_ITEM_Buffer, /* buffer */
|
||||
LOG_STRINGS_ITEM_Size, /* size */
|
||||
LOG_STRINGS_ITEM_ExWaveId, /* CriAtomExWaveId */
|
||||
LOG_STRINGS_ITEM_MemoryAwbHn, /* CriAtomAwbHn for Memory */
|
||||
LOG_STRINGS_ITEM_StreamAwbHn, /* CriAtomAwbHn for Stream */
|
||||
LOG_STRINGS_ITEM_ExTweenHn, /* CriAtomExTweenHn */
|
||||
LOG_STRINGS_ITEM_ExConfig, /* CriAtomExConfig */
|
||||
LOG_STRINGS_ITEM_ExAsrConfig, /* CriAtomExAsrConfig */
|
||||
LOG_STRINGS_ITEM_ExHcaMxConfig, /* CriAtomExHcaMxConfig */
|
||||
LOG_STRINGS_ITEM_ExDbasConfig, /* CriAtomExDbasConfig */
|
||||
LOG_STRINGS_ITEM_ExStreamingCacheConfig, /* CriAtomExStreamingCacheConfig */
|
||||
LOG_STRINGS_ITEM_ExStandardVoicePoolConfig, /* CriAtomExStandardVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExAdxVoicePoolConfig, /* CriAtomExAdxVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExAhxVoicePoolConfig, /* CriAtomExAhxVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExHcaVoicePoolConfig, /* CriAtomExHcaVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExHcaMxVoicePoolConfig, /* CriAtomExHcaMxVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExWaveVoicePoolConfig, /* CriAtomExWaveVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExRawPcmVoicePoolConfig, /* CriAtomExRawPcmVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_ExPlayerConfig, /* CriAtomExPlayerConfig */
|
||||
LOG_STRINGS_ITEM_ExTweenConfig, /* CriAtomExTweenConfig */
|
||||
LOG_STRINGS_ITEM_DecrypterConfig, /* CriAtomDecrypterConfig */
|
||||
LOG_STRINGS_ITEM_Ex3dSourceConfig, /* CriAtomEx3dSourceConfig */
|
||||
LOG_STRINGS_ITEM_Ex3dListenerConfig, /* CriAtomEx3dListenerConfig */
|
||||
LOG_STRINGS_ITEM_ExAdpcmVoicePoolConfig_3DS, /* CriAtomExAdpcmVoicePoolConfig_3DS */
|
||||
LOG_STRINGS_ITEM_ExAdpcmVoicePoolConfig_WII, /* CriAtomExAdpcmVoicePoolConfig_WII */
|
||||
LOG_STRINGS_ITEM_ExVagVoicePoolConfig_PSP, /* CriAtomExVagVoicePoolConfig_PSP */
|
||||
LOG_STRINGS_ITEM_ExAtrac3VoicePoolConfig_PSP, /* CriAtomExAtrac3VoicePoolConfig_PSP */
|
||||
LOG_STRINGS_ITEM_ExVagVoicePoolConfig_VITA, /* CriAtomExVagVoicePoolConfig_VITA */
|
||||
LOG_STRINGS_ITEM_ExAt9VoicePoolConfig_VITA, /* CriAtomExAt9VoicePoolConfig_VITA */
|
||||
LOG_STRINGS_ITEM_NumGroups, /* num_groups */
|
||||
LOG_STRINGS_ITEM_VoicesPerGroup, /* voices_per_group */
|
||||
LOG_STRINGS_ITEM_NumCategoryGroups, /* num_category_groups */
|
||||
LOG_STRINGS_ITEM_NumCategories, /* num_categories */
|
||||
LOG_STRINGS_ITEM_reserved, /* reserved */
|
||||
LOG_STRINGS_ITEM_ExFaderHn, /* CriAtomExFaderHn */
|
||||
LOG_STRINGS_ITEM_Guid, /* Guid */
|
||||
LOG_STRINGS_ITEM_parent_info_id, /* parent CriAtomExPlaybackId */
|
||||
LOG_STRINGS_ITEM_PlayerPoolPlayerInfo, /* CriAtomPlayerPoolPlayerInfo */
|
||||
LOG_STRINGS_ITEM_SoundElementHn, /* CriAtomSoundElementHn */
|
||||
LOG_STRINGS_ITEM_SoundVoiceHn, /* CriAtomSoundVoiceHn */
|
||||
LOG_STRINGS_ITEM_ExPlaybackId_Cause, /* Cause CriAtomExPlaybackId */
|
||||
LOG_STRINGS_ITEM_Index, /* Index */
|
||||
LOG_STRINGS_ITEM_NumAllPlaybacks, /* NumAllPlaybacks */
|
||||
LOG_STRINGS_ITEM_NumPlaybacks, /* NumPlaybacks */
|
||||
LOG_STRINGS_ITEM_CategoriesPerPlayback, /* categories_per_playback */
|
||||
LOG_STRINGS_ITEM_EnableVoicePriorityDecay, /* enable_voice_priority_decay */
|
||||
LOG_STRINGS_ITEM_Volume, /* volume */
|
||||
LOG_STRINGS_ITEM_SoundElementId, /* CriAtomSoundElementId */
|
||||
LOG_STRINGS_ITEM_SoundVoiceId, /* CriAtomSoundVoiceId */
|
||||
LOG_STRINGS_ITEM_ExAcbName, /* Acb Name */
|
||||
LOG_STRINGS_ITEM_PlayerPoolPlayerInfoId, /* CriAtomPlayerPoolPlayerInfoId */
|
||||
LOG_STRINGS_ITEM_AisacControl, /* Aisac Control */
|
||||
LOG_STRINGS_ITEM_TrackNo, /* track no */
|
||||
LOG_STRINGS_ITEM_Mute, /* mute */
|
||||
LOG_STRINGS_ITEM_Result, /* Result */
|
||||
LOG_STRINGS_ITEM_LogRecordMode, /* log record mode */
|
||||
LOG_STRINGS_ITEM_NumCh, /* Num Ch */
|
||||
LOG_STRINGS_ITEM_NumLoaders, /* Num Loaders */
|
||||
LOG_STRINGS_ITEM_NumPlayers, /* Num Players */
|
||||
LOG_STRINGS_ITEM_Status, /* Status */
|
||||
LOG_STRINGS_ITEM_PlayingTime, /* PlayingTime */
|
||||
LOG_STRINGS_ITEM_DspBusSpectra, /* DspBusSpectra */
|
||||
LOG_STRINGS_ITEM_CpuLoad, /* CpuLoad */
|
||||
LOG_STRINGS_ITEM_NumUsedVoices, /* NumUsedVoices */
|
||||
LOG_STRINGS_ITEM_SequencePlaybackPosition, /* SequencePlaybackPosition */
|
||||
LOG_STRINGS_ITEM_CallbackValue, /* CallbackValue */
|
||||
LOG_STRINGS_ITEM_CallbackString, /* CallbackString */
|
||||
LOG_STRINGS_ITEM_PeakLevel, /* PeakLevel */
|
||||
LOG_STRINGS_ITEM_RmsLevel, /* RmsLevel */
|
||||
LOG_STRINGS_ITEM_PeakHoldLevel, /* PeakHoldLevel */
|
||||
LOG_STRINGS_ITEM_RequestId, /* RequestId */
|
||||
LOG_STRINGS_ITEM_TargetId, /* TargetId */
|
||||
LOG_STRINGS_ITEM_Md5, /* Md5 */
|
||||
LOG_STRINGS_ITEM_GameVariable, /* GameVariable */
|
||||
LOG_STRINGS_ITEM_GameVariableName, /* GameVariableName */
|
||||
LOG_STRINGS_ITEM_TimeMs, /* TimeMs */
|
||||
LOG_STRINGS_ITEM_SnapShotName, /* SnapShotName */
|
||||
LOG_STRINGS_ITEM_AisacControlId, /* AisacControlId */
|
||||
LOG_STRINGS_ITEM_StartTimeMs, /* StartTimeMs */
|
||||
LOG_STRINGS_ITEM_SelectorName, /* SelectorName */
|
||||
LOG_STRINGS_ITEM_LabelName, /* LabelName */
|
||||
LOG_STRINGS_ITEM_BlockName, /* BlockName */
|
||||
LOG_STRINGS_ITEM_CategoryName, /* CategoryName */
|
||||
LOG_STRINGS_ITEM_AisacControlName, /* AisacControlName */
|
||||
LOG_STRINGS_ITEM_SettingName, /* SettingName */
|
||||
LOG_STRINGS_ITEM_CueSheetId, /* CueSheetId */
|
||||
LOG_STRINGS_ITEM_BusNo, /* BusNo */
|
||||
LOG_STRINGS_ITEM_FxType, /* FxType */
|
||||
LOG_STRINGS_ITEM_RemainedLoopCount, /* RemainedLoopCount */
|
||||
LOG_STRINGS_ITEM_SequenceLoopId, /* SequenceLoopId */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_Position, /* 3dPosVector_Position */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_Velocity, /* 3dPosVector_Velocity */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_Forward, /* 3dPosVector_Forward */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_Upward, /* 3dPosVector_Upward */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_FocusPoint, /* 3dPosVector_FocusPoint */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_Cone, /* 3dPosVector_Cone */
|
||||
LOG_STRINGS_ITEM_Ex3dMaxAngleAisacDelta, /* 3dMaxAngleAisacDelta */
|
||||
LOG_STRINGS_ITEM_Ex3dEnablePriorityDecay, /* 3dEnablePriorityDecay */
|
||||
LOG_STRINGS_ITEM_Ex3dDistanceFactor, /* 3dDistanceFactor */
|
||||
LOG_STRINGS_ITEM_Ex3dDistanceFocusLevel, /* 3dDistanceFocusLevel */
|
||||
LOG_STRINGS_ITEM_Ex3dDirectionFocusLevel, /* 3dDirectionFocusLevel */
|
||||
LOG_STRINGS_ITEM_Result3dPos, /* Result3dPos */
|
||||
LOG_STRINGS_ITEM_ExAiffVoicePoolConfig, /* CriAtomExAiffVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_SrType, /* SoundRendererTyoe */
|
||||
LOG_STRINGS_ITEM_ExAt9VoicePoolConfig_PS4, /* CriAtomExAt9VoicePoolConfig_PS4 */
|
||||
LOG_STRINGS_ITEM_AverageServerTime, /* AverageServerTime */
|
||||
LOG_STRINGS_ITEM_AverageServerInterval, /* AverageServerInterval */
|
||||
LOG_STRINGS_ITEM_MaxServerTime, /* MaxServerTime */
|
||||
LOG_STRINGS_ITEM_MaxServerInterval, /* MaxServerInterval */
|
||||
LOG_STRINGS_ITEM_UserLog, /* UserLog */
|
||||
LOG_STRINGS_ITEM_ByVoiceGroupLimitation, /* ByVoiceGroupLimitation */
|
||||
LOG_STRINGS_ITEM_ByVoicePoolLimitation, /* ByVoicePoolLimitation */
|
||||
LOG_STRINGS_ITEM_RetryFlag, /* RetryFlag */
|
||||
LOG_STRINGS_ITEM_BusName, /* BusName */
|
||||
LOG_STRINGS_ITEM_StreamType, /* StreamType */
|
||||
LOG_STRINGS_ITEM_MomentaryValue, /* MomentaryValue */
|
||||
LOG_STRINGS_ITEM_ShortTermValue, /* ShortTermValue */
|
||||
LOG_STRINGS_ITEM_IntegratedValue, /* IntegratedValue */
|
||||
LOG_STRINGS_ITEM_TotalBps, /* TotalBps */
|
||||
LOG_STRINGS_ITEM_NumCues, /* num_cues */
|
||||
LOG_STRINGS_ITEM_SoundFormat, /* SoundFormat *//* (CriAtomSoundFormatのこと) */
|
||||
LOG_STRINGS_ITEM_ExAdpcmVoicePoolConfig_WIIU, /* CriAtomExAdpcmVoicePoolConfig_WIIU */
|
||||
LOG_STRINGS_ITEM_AwbName, /* AwbName */
|
||||
LOG_STRINGS_ITEM_NumStreamAwb, /* NumStreamAwb */
|
||||
LOG_STRINGS_ITEM_ExPlayback_AllocateModule, /* ExPlayback_AllocateModule */
|
||||
LOG_STRINGS_ITEM_AisacControlValue, /* AisacControlValue */
|
||||
LOG_STRINGS_ITEM_NumAllPlaybacksForReact, /* NumAllPlaybacksForReact */
|
||||
LOG_STRINGS_ITEM_PreviewContext, /* PreviewContext */
|
||||
LOG_STRINGS_ITEM_MaxParameterBlocks, /* max_parameter_blocks */
|
||||
LOG_STRINGS_ITEM_MaxFaders, /* max_faders */
|
||||
LOG_STRINGS_ITEM_NumBuses, /* num_buses */
|
||||
LOG_STRINGS_ITEM_MaxRacks, /* max_racks */
|
||||
LOG_STRINGS_ITEM_OutputChannels4HcaMx, /* output_channels(HcaMxConfig用) */
|
||||
LOG_STRINGS_ITEM_OutputSamplingRate4HcaMx, /* output_sampling_rate(HcaMxConfig用) */
|
||||
LOG_STRINGS_ITEM_SoundRendererType4HcaMx, /* sound_renderer_type(HcaMxConfig用) */
|
||||
LOG_STRINGS_ITEM_SPEAKER_SYSTEM, /* speaker_system */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_LEFT, /* left_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_RIGHT, /* right_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_CENTER, /* center_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_LFE, /* lfe_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_SURROUND_LEFT, /* surround_left_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_SURROUND_RIGHT, /* surround_right_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_SURROUND_BACK_LEFT, /* surround_back_left_speaker_angle */
|
||||
LOG_STRINGS_ITEM_SPEAKER_ANGLE_SURROUND_BACK_RIGHT, /* surround_back_right_speaker_angle */
|
||||
LOG_STRINGS_ITEM_PAN_SPEAKER_TYPE, /* pan_speaker_type */
|
||||
LOG_STRINGS_ITEM_VOICE_STOP_REASON, /* CriAtomVoiceStopReason */
|
||||
LOG_STRINGS_ITEM_ExVibrationVoicePoolConfig, /* CriAtomExVibrationVoicePoolConfig */
|
||||
LOG_STRINGS_ITEM_TouchSenceEffectName, /* TouchSenceEffectName */
|
||||
LOG_STRINGS_ITEM_DspName, /* DspName */
|
||||
LOG_STRINGS_ITEM_DspObject, /* DspObject */
|
||||
LOG_STRINGS_ITEM_DspSlotNo, /* DspSlotNo */
|
||||
LOG_STRINGS_ITEM_DspPluginType, /* DspPluginType */
|
||||
LOG_STRINGS_ITEM_Ex3dPosVector_ListenerTop, /* 3dPosVector_ListenerTop */
|
||||
LOG_STRINGS_ITEM_Playback_Status, /* Playback_Status */
|
||||
LOG_STRINGG_ITEM_InstrumentInstanceCbFunc,
|
||||
LOG_STRINGG_ITEM_InstrumentInstanceCbObj,
|
||||
LOG_STRINGG_ITEM_AttachInstrumentInstancePlayerHn,
|
||||
LOG_STRINGG_ITEM_InstrumentInstance,
|
||||
LOG_STRINGS_ITEM_Ex3dTransceiverHn, /* CriAtomEx3dTransceiverHn */
|
||||
LOG_STRINGS_ITEM_Ex3dTransceiverConfig, /* CriAtomEx3dTransceiverConfig */
|
||||
LOG_STRINGS_ITEM_Ex3dRegionHn, /* CriAtomExRegionHn */
|
||||
LOG_STRINGS_ITEM_Ex3dTransceiverDirectAudioRadius, /* TransceiverDirectAudioRadius */
|
||||
LOG_STRINGS_ITEM_Ex3dTransceiverCrossFadeDistance, /* TransceiverCrossFadeDistance */
|
||||
LOG_STRINGS_ITEM_ProgramNo, /* サウンドプログラムバングプレビュー用Program No */
|
||||
LOG_STRINGS_ITEM_KeyNo, /* サウンドプログラムバングプレビュー用Key No */
|
||||
LOG_STRINGS_ITEM_Velocity, /* サウンドプログラムバングプレビュー用Velocity */
|
||||
LOG_STRINGS_ITEM_PitchBend, /* サウンドプログラムバングプレビュー用PitchBend */
|
||||
LOG_STRINGS_ITEM_Format, /* コーデックフォーマット:HCA, ADX, HCA-MX... */
|
||||
LOG_STRINGS_ITEM_MaxRhythmTracks, /* CriAtomAdmPlayerConfig.max_rhythm_tracks */
|
||||
LOG_STRINGS_ITEM_MaxMelodyTracks, /* CriAtomAdmPlayerConfig.max_melody_tracks */
|
||||
LOG_STRINGS_ITEM_MaxVocalTracks, /* CriAtomAdmPlayerConfig.max_vocal_tracks */
|
||||
LOG_STRINGS_ITEM_AdmPlayerHn, /* CriAtomAdmPlayerHn */
|
||||
};
|
||||
|
||||
/* ログのパラメータ引数の型 */
|
||||
protected enum LogParamTypes {
|
||||
TYPE_INT8 = 0,
|
||||
TYPE_INT16,
|
||||
TYPE_INT32,
|
||||
TYPE_INT64,
|
||||
TYPE_FLOAT32,
|
||||
TYPE_CHAR,
|
||||
TYPE_UINTPTR,
|
||||
TYPE_GUID,
|
||||
TYPE_128,
|
||||
TYPE_VECTOR
|
||||
}
|
||||
static protected readonly int[] ParamTypeSizes32 = new int[] {
|
||||
1, /* SIZE_INT8 */
|
||||
2, /* SIZE_INT16 */
|
||||
4, /* SIZE_INT32 */
|
||||
8, /* SIZE_INT64 */
|
||||
4, /* SIZE_FLOAT32 */
|
||||
2, /* SIZE_CHAR (String Size) */
|
||||
4, /* SIZE_UINTPTR (Handles) */
|
||||
16, /* SIZE_GUID */
|
||||
128, /* SIZE_128 */
|
||||
12 /* SIZE_VECTOR (Vector3f) */
|
||||
};
|
||||
static protected readonly int[] ParamTypeSizes64 = new int[] {
|
||||
1, /* SIZE_INT8 */
|
||||
2, /* SIZE_INT16 */
|
||||
4, /* SIZE_INT32 */
|
||||
8, /* SIZE_INT64 */
|
||||
4, /* SIZE_FLOAT32 */
|
||||
2, /* SIZE_CHAR (String Size) */
|
||||
8, /* SIZE_UINTPTR (Handles) */
|
||||
16, /* SIZE_GUID */
|
||||
128, /* SIZE_128 */
|
||||
12 /* SIZE_VECTOR (Vector3f) */
|
||||
};
|
||||
|
||||
protected struct LogParam {
|
||||
public readonly string name;
|
||||
public readonly LogParamTypes type;
|
||||
public readonly int size32;
|
||||
public readonly int size64;
|
||||
public LogParam(string name, LogParamTypes type)
|
||||
{
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.size32 = CriProfiler.ParamTypeSizes32[(int)type];
|
||||
this.size64 = CriProfiler.ParamTypeSizes64[(int)type];
|
||||
}
|
||||
}
|
||||
|
||||
static protected readonly LogParam[] LogParams = new LogParam[] {
|
||||
new LogParam( "#CRIATOMDEF", LogParamTypes.TYPE_CHAR ), /* 0 */
|
||||
new LogParam( "#CRIATOM", LogParamTypes.TYPE_CHAR ), /* 1 */
|
||||
new LogParam( "TimeStamp[usec]", LogParamTypes.TYPE_INT64 ), /* 2 */
|
||||
new LogParam( "ThreadId", LogParamTypes.TYPE_UINTPTR ), /* 3 */
|
||||
new LogParam( "thread_model", LogParamTypes.TYPE_INT8 ), /* 4 */
|
||||
new LogParam( "server_frequency", LogParamTypes.TYPE_FLOAT32 ), /* 5 */
|
||||
new LogParam( "parameter_update_interval", LogParamTypes.TYPE_INT16 ), /* 6 */
|
||||
new LogParam( "max_virtual_voices", LogParamTypes.TYPE_INT16 ), /* 7 */
|
||||
new LogParam( "max_voice_limit_groups", LogParamTypes.TYPE_INT16 ), /* 8 */
|
||||
new LogParam( "max_categories", LogParamTypes.TYPE_INT16 ), /* 9 */
|
||||
new LogParam( "max_sequences", LogParamTypes.TYPE_INT16 ), /* 10 */
|
||||
new LogParam( "max_tracks", LogParamTypes.TYPE_INT16 ), /* 11 */
|
||||
new LogParam( "max_track_items", LogParamTypes.TYPE_INT16 ), /* 12 */
|
||||
new LogParam( "max_aisac_auto_modulations", LogParamTypes.TYPE_INT16 ), /* 13 */
|
||||
new LogParam( "max_pitch", LogParamTypes.TYPE_FLOAT32 ), /* 14 */
|
||||
new LogParam( "coordinate_system", LogParamTypes.TYPE_INT8 ), /* 15 */
|
||||
new LogParam( "rng_if", LogParamTypes.TYPE_UINTPTR ), /* 16 */
|
||||
new LogParam( "fs_config", LogParamTypes.TYPE_UINTPTR ), /* 17 */
|
||||
new LogParam( "context", LogParamTypes.TYPE_UINTPTR ), /* 18 */
|
||||
new LogParam( "output_channels", LogParamTypes.TYPE_INT8 ), /* 19 */
|
||||
new LogParam( "output_sampling_rate", LogParamTypes.TYPE_INT32 ), /* 20 */
|
||||
new LogParam( "sound_renderer_type", LogParamTypes.TYPE_INT8 ), /* 21 */
|
||||
new LogParam( "num_mixers", LogParamTypes.TYPE_INT16 ), /* 22 */
|
||||
new LogParam( "max_voices", LogParamTypes.TYPE_INT16 ), /* 23 */
|
||||
new LogParam( "max_input_channels", LogParamTypes.TYPE_INT8 ), /* 24 */
|
||||
new LogParam( "max_sampling_rate", LogParamTypes.TYPE_INT32 ), /* 25 */
|
||||
new LogParam( "identifier", LogParamTypes.TYPE_INT32 ), /* 26 */
|
||||
new LogParam( "max_streams", LogParamTypes.TYPE_INT32 ), /* 27 */
|
||||
new LogParam( "max_bps", LogParamTypes.TYPE_INT32 ), /* 28 */
|
||||
new LogParam( "CriAtomDbasId", LogParamTypes.TYPE_INT32 ), /* 29 */
|
||||
new LogParam( "max_path", LogParamTypes.TYPE_INT16 ), /* 30 */
|
||||
new LogParam( "max_files", LogParamTypes.TYPE_INT32 ), /* 31 */
|
||||
new LogParam( "cache_size", LogParamTypes.TYPE_INT32 ), /* 32 */
|
||||
new LogParam( "CriAtomStreamingCacheId", LogParamTypes.TYPE_UINTPTR ), /* 33 */
|
||||
new LogParam( "num_voices", LogParamTypes.TYPE_INT32 ), /* 34 */
|
||||
new LogParam( "max_channels", LogParamTypes.TYPE_INT8 ), /* 35 */
|
||||
new LogParam( "streaming_flag", LogParamTypes.TYPE_INT8 ), /* 36 */
|
||||
new LogParam( "decode_latency", LogParamTypes.TYPE_INT32 ), /* 37 */
|
||||
new LogParam( "CriAtomExVoicePoolHn", LogParamTypes.TYPE_UINTPTR ), /* 38 */
|
||||
new LogParam( "allocation_method", LogParamTypes.TYPE_INT8 ), /* 39 */
|
||||
new LogParam( "max_path_strings", LogParamTypes.TYPE_INT16 ), /* 40 */
|
||||
new LogParam( "updates_time", LogParamTypes.TYPE_INT8 ), /* 41 */
|
||||
new LogParam( "CriAtomExPlayerHn", LogParamTypes.TYPE_UINTPTR ), /* 42 */
|
||||
new LogParam( "id", LogParamTypes.TYPE_INT32 ), /* 43 */
|
||||
new LogParam( "parameter_type", LogParamTypes.TYPE_INT8 ), /* 44 */
|
||||
new LogParam( "key", LogParamTypes.TYPE_INT64 ), /* 45 */
|
||||
new LogParam( "CriAtomDecrypterHn", LogParamTypes.TYPE_UINTPTR ), /* 46 */
|
||||
new LogParam( "work", LogParamTypes.TYPE_UINTPTR ), /* 47 */
|
||||
new LogParam( "work_size", LogParamTypes.TYPE_INT32 ), /* 48 */
|
||||
new LogParam( "CriAtomEx3dSourceHn", LogParamTypes.TYPE_UINTPTR ), /* 49 */
|
||||
new LogParam( "CriAtomEx3dListenerHn", LogParamTypes.TYPE_UINTPTR ), /* 50 */
|
||||
new LogParam( "CriAtomExPlaybackId", LogParamTypes.TYPE_INT32 ), /* 51 */
|
||||
new LogParam( "CriAtomExFaderConfig", LogParamTypes.TYPE_UINTPTR ), /* 52 */
|
||||
new LogParam( "CriAtomExAcfConfig", LogParamTypes.TYPE_UINTPTR ), /* 53 */
|
||||
new LogParam( "acf_data", LogParamTypes.TYPE_UINTPTR ), /* 54 */
|
||||
new LogParam( "acf_data_size", LogParamTypes.TYPE_INT32 ), /* 55 */
|
||||
new LogParam( "CriFsBinderHn", LogParamTypes.TYPE_UINTPTR ), /* 56 */
|
||||
new LogParam( "path", LogParamTypes.TYPE_CHAR ), /* 57 */
|
||||
new LogParam( "acb_data", LogParamTypes.TYPE_UINTPTR ), /* 58 */
|
||||
new LogParam( "acb_data_size", LogParamTypes.TYPE_INT32 ), /* 59 */
|
||||
new LogParam( "awb_path", LogParamTypes.TYPE_CHAR ), /* 60 */
|
||||
new LogParam( "awb_id", LogParamTypes.TYPE_INT32 ), /* 61 */
|
||||
new LogParam( "acb_path", LogParamTypes.TYPE_CHAR ), /* 62 */
|
||||
new LogParam( "acb_id", LogParamTypes.TYPE_INT32 ), /* 63 */
|
||||
new LogParam( "CriAtomExAcbHn", LogParamTypes.TYPE_UINTPTR ), /* 64 */
|
||||
new LogParam( "sw", LogParamTypes.TYPE_INT8 ), /* 65 */
|
||||
new LogParam( "CriAtomExResumeMode", LogParamTypes.TYPE_INT8 ), /* 66 */
|
||||
new LogParam( "error_string", LogParamTypes.TYPE_CHAR ), /* 67 */
|
||||
new LogParam( "CriAtomSoundPlaybackId", LogParamTypes.TYPE_INT32 ), /* 68 */
|
||||
new LogParam( "CriAtomSoundPlayerHn", LogParamTypes.TYPE_UINTPTR ), /* 69 */
|
||||
new LogParam( "CriAtomAwbHn", LogParamTypes.TYPE_UINTPTR ), /* 70 */
|
||||
new LogParam( "CriAtomExCueId", LogParamTypes.TYPE_INT32 ), /* 71 */
|
||||
new LogParam( "cue_name", LogParamTypes.TYPE_CHAR ), /* 72 */
|
||||
new LogParam( "CriAtomExCueIndex", LogParamTypes.TYPE_INT32 ), /* 73 */
|
||||
new LogParam( "buffer", LogParamTypes.TYPE_UINTPTR ), /* 74 */
|
||||
new LogParam( "size", LogParamTypes.TYPE_INT32 ), /* 75 */
|
||||
new LogParam( "CriAtomExWaveId", LogParamTypes.TYPE_INT32 ), /* 76 */
|
||||
new LogParam( "CriAtomAwbHn for Memory", LogParamTypes.TYPE_UINTPTR ), /* 77 */
|
||||
new LogParam( "CriAtomAwbHn for Stream", LogParamTypes.TYPE_UINTPTR ), /* 78 */
|
||||
new LogParam( "CriAtomExTweenHn", LogParamTypes.TYPE_UINTPTR ), /* 79 */
|
||||
new LogParam( "CriAtomExConfig", LogParamTypes.TYPE_UINTPTR ), /* 80 */
|
||||
new LogParam( "CriAtomExAsrConfig", LogParamTypes.TYPE_UINTPTR ), /* 81 */
|
||||
new LogParam( "CriAtomExHcaMxConfig", LogParamTypes.TYPE_UINTPTR ), /* 82 */
|
||||
new LogParam( "CriAtomDbasConfig", LogParamTypes.TYPE_UINTPTR ), /* 83 */
|
||||
new LogParam( "CriAtomStreamingCacheConfig", LogParamTypes.TYPE_UINTPTR ), /* 84 */
|
||||
new LogParam( "CriAtomExStandardVoicePoolConfig",LogParamTypes.TYPE_UINTPTR ), /* 85 */
|
||||
new LogParam( "CriAtomExAdxVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 86 */
|
||||
new LogParam( "CriAtomExAhxVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 87 */
|
||||
new LogParam( "CriAtomExHcaVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 88 */
|
||||
new LogParam( "CriAtomExHcaMxVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 89 */
|
||||
new LogParam( "CriAtomExWaveVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 90 */
|
||||
new LogParam( "CriAtomExRawPcmVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 91 */
|
||||
new LogParam( "CriAtomExPlayerConfig", LogParamTypes.TYPE_UINTPTR ), /* 92 */
|
||||
new LogParam( "CriAtomExTweenConfig", LogParamTypes.TYPE_UINTPTR ), /* 93 */
|
||||
new LogParam( "CriAtomDecrypterConfig", LogParamTypes.TYPE_UINTPTR ), /* 94 */
|
||||
new LogParam( "CriAtomEx3dSourceConfig", LogParamTypes.TYPE_UINTPTR ), /* 95 */
|
||||
new LogParam( "CriAtomEx3dListenerConfig", LogParamTypes.TYPE_UINTPTR ), /* 96 */
|
||||
new LogParam( "CriAtomExAdpcmVoicePoolConfig_3DS",LogParamTypes.TYPE_UINTPTR ), /* 97 */
|
||||
new LogParam( "CriAtomExAdpcmVoicePoolConfig_WII",LogParamTypes.TYPE_UINTPTR ), /* 98 */
|
||||
new LogParam( "CriAtomExVagVoicePoolConfig_PSP",LogParamTypes.TYPE_UINTPTR ), /* 99 */
|
||||
new LogParam( "CriAtomExAtrac3VoicePoolConfig_PSP",LogParamTypes.TYPE_UINTPTR ), /* 100 */
|
||||
new LogParam( "CriAtomExVagVoicePoolConfig_VITA",LogParamTypes.TYPE_UINTPTR ), /* 101 */
|
||||
new LogParam( "CriAtomExAt9VoicePoolConfig_VITA",LogParamTypes.TYPE_UINTPTR ), /* 102 */
|
||||
new LogParam( "num_groups", LogParamTypes.TYPE_INT16 ), /* 103 */
|
||||
new LogParam( "voices_per_group", LogParamTypes.TYPE_INT16 ), /* 104 */
|
||||
new LogParam( "num_category_groups", LogParamTypes.TYPE_INT16 ), /* 105 */
|
||||
new LogParam( "num_categories", LogParamTypes.TYPE_INT16 ), /* 106 */
|
||||
new LogParam( "reserved", LogParamTypes.TYPE_INT32 ), /* 107 */
|
||||
new LogParam( "CriAtomExFaderHn", LogParamTypes.TYPE_UINTPTR ), /* 108 */
|
||||
new LogParam( "Guid", LogParamTypes.TYPE_GUID ), /* 109 */
|
||||
new LogParam( "parent CriAtomExPlaybackId", LogParamTypes.TYPE_INT32 ), /* 110 */
|
||||
new LogParam( "CriAtomPlayerPoolPlayerInfo", LogParamTypes.TYPE_UINTPTR ), /* 111 */
|
||||
new LogParam( "CriAtomSoundElementHn", LogParamTypes.TYPE_UINTPTR ), /* 112 */
|
||||
new LogParam( "CriAtomSoundVoiceHn", LogParamTypes.TYPE_UINTPTR ), /* 113 */
|
||||
new LogParam( "cause CriAtomExPlaybackId", LogParamTypes.TYPE_INT32 ), /* 114 */
|
||||
new LogParam( "Index", LogParamTypes.TYPE_INT16 ), /* 115 */
|
||||
new LogParam( "NumAllPlaybacks", LogParamTypes.TYPE_INT16 ), /* 116 */
|
||||
new LogParam( "NumPlaybacks", LogParamTypes.TYPE_INT16 ), /* 117 */
|
||||
new LogParam( "categories_per_playback", LogParamTypes.TYPE_INT8 ), /* 118 */
|
||||
new LogParam( "enable_voice_priority_decay", LogParamTypes.TYPE_INT8 ), /* 119 */
|
||||
new LogParam( "volume", LogParamTypes.TYPE_FLOAT32 ), /* 120 */
|
||||
new LogParam( "CriAtomSoundElementId", LogParamTypes.TYPE_INT32 ), /* 121 */
|
||||
new LogParam( "CriAtomSoundVoiceId", LogParamTypes.TYPE_INT32 ), /* 122 */
|
||||
new LogParam( "Acb Name", LogParamTypes.TYPE_CHAR ), /* 123 */
|
||||
new LogParam( "CriAtomPlayerPoolPlayerInfoId", LogParamTypes.TYPE_INT32 ), /* 124 */
|
||||
new LogParam( "Aisac Control", LogParamTypes.TYPE_FLOAT32 ), /* 125 */
|
||||
new LogParam( "Track No", LogParamTypes.TYPE_INT16 ), /* 126 */
|
||||
new LogParam( "Mute", LogParamTypes.TYPE_INT8 ), /* 127 */
|
||||
new LogParam( "Result", LogParamTypes.TYPE_INT8 ), /* 128 */
|
||||
new LogParam( "Log Record Mode", LogParamTypes.TYPE_INT32 ), /* 129 */
|
||||
new LogParam( "NumCh", LogParamTypes.TYPE_INT8 ), /* 130 */
|
||||
new LogParam( "NumLoaders", LogParamTypes.TYPE_INT32 ), /* 131 */
|
||||
new LogParam( "NumPlayers", LogParamTypes.TYPE_INT32 ), /* 132 */
|
||||
new LogParam( "Status", LogParamTypes.TYPE_INT8 ), /* 133 */
|
||||
new LogParam( "PlayingTime", LogParamTypes.TYPE_INT32 ), /* 134 */
|
||||
new LogParam( "DspBusSpectra", LogParamTypes.TYPE_128 ), /* 135 */
|
||||
new LogParam( "CpuLoad", LogParamTypes.TYPE_FLOAT32 ), /* 136 */
|
||||
new LogParam( "NumUsedVoices", LogParamTypes.TYPE_INT32 ), /* 137 */
|
||||
new LogParam( "SequencePlaybackPosition", LogParamTypes.TYPE_INT64 ), /* 138 */
|
||||
new LogParam( "CallbackValue", LogParamTypes.TYPE_INT32 ), /* 139 */
|
||||
new LogParam( "CallbackString", LogParamTypes.TYPE_CHAR ), /* 140 */
|
||||
new LogParam( "PeakLevel", LogParamTypes.TYPE_FLOAT32 ), /* 141 */
|
||||
new LogParam( "RmsLevel", LogParamTypes.TYPE_FLOAT32 ), /* 142 */
|
||||
new LogParam( "PeakHoldLevel", LogParamTypes.TYPE_FLOAT32 ), /* 143 */
|
||||
new LogParam( "RequestId", LogParamTypes.TYPE_INT32 ), /* 144 */
|
||||
new LogParam( "TargetId", LogParamTypes.TYPE_INT32 ), /* 145 */
|
||||
new LogParam( "Md5", LogParamTypes.TYPE_GUID ), /* 146 */
|
||||
new LogParam( "GameVariable", LogParamTypes.TYPE_FLOAT32 ), /* 147 */
|
||||
new LogParam( "GameVariableName", LogParamTypes.TYPE_CHAR ), /* 148 */
|
||||
new LogParam( "TimeMs", LogParamTypes.TYPE_INT32 ), /* 149 */
|
||||
new LogParam( "SnapShotName", LogParamTypes.TYPE_CHAR ), /* 150 */
|
||||
new LogParam( "AisacControlId", LogParamTypes.TYPE_INT32 ), /* 151 */
|
||||
new LogParam( "StartTimeMs", LogParamTypes.TYPE_INT64 ), /* 152 */
|
||||
new LogParam( "SelectorName", LogParamTypes.TYPE_CHAR ), /* 153 */
|
||||
new LogParam( "LabelName", LogParamTypes.TYPE_CHAR ), /* 154 */
|
||||
new LogParam( "BlockName", LogParamTypes.TYPE_CHAR ), /* 155 */
|
||||
new LogParam( "CategoryName", LogParamTypes.TYPE_CHAR ), /* 156 */
|
||||
new LogParam( "AisacControlName", LogParamTypes.TYPE_CHAR ), /* 157 */
|
||||
new LogParam( "SettingName", LogParamTypes.TYPE_CHAR ), /* 158 */
|
||||
new LogParam( "CueSheetId", LogParamTypes.TYPE_INT32 ), /* 159 */
|
||||
new LogParam( "BusNo", LogParamTypes.TYPE_INT8 ), /* 160 */
|
||||
new LogParam( "FxType", LogParamTypes.TYPE_INT32 ), /* 161 */
|
||||
new LogParam( "RemainedLoopCount", LogParamTypes.TYPE_INT32 ), /* 162 */
|
||||
new LogParam( "SequenceLoopId", LogParamTypes.TYPE_INT16 ), /* 163 */
|
||||
new LogParam( "3dPosVector_Position", LogParamTypes.TYPE_VECTOR ), /* 164 */
|
||||
new LogParam( "3dPosVector_Velocity", LogParamTypes.TYPE_VECTOR ), /* 165 */
|
||||
new LogParam( "3dPosVector_Forward", LogParamTypes.TYPE_VECTOR ), /* 166 */
|
||||
new LogParam( "3dPosVector_Upward", LogParamTypes.TYPE_VECTOR ), /* 167 */
|
||||
new LogParam( "3dPosVector_FocusPoint", LogParamTypes.TYPE_VECTOR ), /* 168 */
|
||||
new LogParam( "3dPosVector_Cone", LogParamTypes.TYPE_VECTOR ), /* 169 */
|
||||
new LogParam( "3dMaxAngleAisacDelta", LogParamTypes.TYPE_FLOAT32 ), /* 170 */
|
||||
new LogParam( "3dEnablePriorityDecay", LogParamTypes.TYPE_FLOAT32 ), /* 171 */
|
||||
new LogParam( "3dDistanceFactor", LogParamTypes.TYPE_FLOAT32 ), /* 172 */
|
||||
new LogParam( "3dDistanceFocusLevel", LogParamTypes.TYPE_FLOAT32 ), /* 173 */
|
||||
new LogParam( "3dDirectionFocusLevel", LogParamTypes.TYPE_FLOAT32 ), /* 174 */
|
||||
new LogParam( "Result3dPos", LogParamTypes.TYPE_INT8 ), /* 175 */
|
||||
new LogParam( "CriAtomExAiffVoicePoolConfig", LogParamTypes.TYPE_UINTPTR ), /* 176 */
|
||||
new LogParam( "SoundRendererTyoe", LogParamTypes.TYPE_INT8 ), /* 177 */
|
||||
new LogParam( "CriAtomExAt9VoicePoolConfig_PS4",LogParamTypes.TYPE_UINTPTR ), /* 178 */
|
||||
new LogParam( "AverageServerTime", LogParamTypes.TYPE_INT32 ), /* 179 */
|
||||
new LogParam( "AverageServerInterval", LogParamTypes.TYPE_INT32 ), /* 180 */
|
||||
new LogParam( "MaxServerTime", LogParamTypes.TYPE_INT32 ), /* 181 */
|
||||
new LogParam( "MaxServerInterval", LogParamTypes.TYPE_INT32 ), /* 182 */
|
||||
new LogParam( "UserLog", LogParamTypes.TYPE_CHAR ), /* 183 */
|
||||
new LogParam( "ByVoiceGroupLimitation", LogParamTypes.TYPE_INT8 ), /* 184 */
|
||||
new LogParam( "ByVoicePoolLimitation", LogParamTypes.TYPE_INT8 ), /* 185 */
|
||||
new LogParam( "RetryFlag", LogParamTypes.TYPE_INT8 ), /* 186 */
|
||||
new LogParam( "BusName", LogParamTypes.TYPE_CHAR ), /* 187 */
|
||||
new LogParam( "StreamType", LogParamTypes.TYPE_INT8 ), /* 188 */
|
||||
new LogParam( "MomentaryValue", LogParamTypes.TYPE_FLOAT32 ), /* 189 */
|
||||
new LogParam( "ShortTermValue", LogParamTypes.TYPE_FLOAT32 ), /* 190 */
|
||||
new LogParam( "IntegratedValue", LogParamTypes.TYPE_FLOAT32 ), /* 191 */
|
||||
new LogParam( "TotalBps", LogParamTypes.TYPE_FLOAT32 ), /* 192 */
|
||||
new LogParam( "num_cues", LogParamTypes.TYPE_INT32 ), /* 193 */
|
||||
new LogParam( "SoundFormat", LogParamTypes.TYPE_INT32 ), /* 194 */
|
||||
new LogParam( "CriAtomExAdpcmVoicePoolConfig_WIIU",LogParamTypes.TYPE_UINTPTR ), /* 195 */
|
||||
new LogParam( "AwbName", LogParamTypes.TYPE_CHAR ), /* 196 */
|
||||
new LogParam( "NumStreamAwb", LogParamTypes.TYPE_INT32 ), /* 197 */
|
||||
new LogParam( "ExPlayback_AllocateModule", LogParamTypes.TYPE_INT8 ), /* 198 */
|
||||
new LogParam( "AisacControlValue", LogParamTypes.TYPE_FLOAT32 ), /* 199 */
|
||||
new LogParam( "NumAllPlaybacksForReact", LogParamTypes.TYPE_INT16 ), /* 200 */
|
||||
new LogParam( "PreviewContext", LogParamTypes.TYPE_INT32 ), /* 201 */
|
||||
new LogParam( "max_parameter_blocks", LogParamTypes.TYPE_INT16 ), /* 202 */
|
||||
new LogParam( "max_faders", LogParamTypes.TYPE_INT16 ), /* 203 */
|
||||
new LogParam( "num_buses", LogParamTypes.TYPE_INT16 ), /* 204 */
|
||||
new LogParam( "max_racks", LogParamTypes.TYPE_INT16 ), /* 205 */
|
||||
new LogParam( "output_channels_4_hcamx", LogParamTypes.TYPE_INT8 ), /* 206 */
|
||||
new LogParam( "output_sampling_rate_4_hcamx", LogParamTypes.TYPE_INT32 ), /* 207 */
|
||||
new LogParam( "sound_renderer_type_4_hcamx", LogParamTypes.TYPE_INT8 ), /* 208 */
|
||||
new LogParam( "speaker_system", LogParamTypes.TYPE_INT8 ), /* 209 */
|
||||
new LogParam( "left_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 210 */
|
||||
new LogParam( "right_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 211 */
|
||||
new LogParam( "center_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 212 */
|
||||
new LogParam( "lfe_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 213 */
|
||||
new LogParam( "surround_left_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 214 */
|
||||
new LogParam( "surround_right_speaker_angle", LogParamTypes.TYPE_FLOAT32 ), /* 215 */
|
||||
new LogParam( "surround_back_left_speaker_angle",LogParamTypes.TYPE_FLOAT32 ), /* 216 */
|
||||
new LogParam( "surround_back_right_speaker_angle",LogParamTypes.TYPE_FLOAT32 ), /* 217 */
|
||||
new LogParam( "pan_speaker_type", LogParamTypes.TYPE_INT8 ), /* 218 */
|
||||
new LogParam( "VoiceStopReason", LogParamTypes.TYPE_INT16 ), /* 219 */
|
||||
new LogParam( "CriAtomExVibrationVoicePoolConfig",LogParamTypes.TYPE_UINTPTR ), /* 220 */
|
||||
new LogParam( "TouceSenceEffectName", LogParamTypes.TYPE_CHAR ), /* 221 */
|
||||
new LogParam( "dsp_name", LogParamTypes.TYPE_CHAR ), /* 222 */
|
||||
new LogParam( "dsp_object", LogParamTypes.TYPE_UINTPTR ), /* 223 */
|
||||
new LogParam( "dsp_slot_no", LogParamTypes.TYPE_INT32 ), /* 224 */
|
||||
new LogParam( "dsp_plugin_type", LogParamTypes.TYPE_INT32 ), /* 225 */
|
||||
new LogParam( "3dPosVector_ListenerTop", LogParamTypes.TYPE_VECTOR ), /* 226 */
|
||||
new LogParam( "playback_status", LogParamTypes.TYPE_INT32 ), /* 227 */
|
||||
new LogParam( "instrument_instance_callback", LogParamTypes.TYPE_UINTPTR ), /* 228 */
|
||||
new LogParam( "instrument_instance_callback_obj", LogParamTypes.TYPE_UINTPTR ), /* 229 */
|
||||
new LogParam( "instrument_instance_attach_player",LogParamTypes.TYPE_UINTPTR ), /* 230 */
|
||||
new LogParam( "instrument_instance", LogParamTypes.TYPE_UINTPTR ), /* 231 */
|
||||
new LogParam( "CriAtomEx3dTransceiverHn", LogParamTypes.TYPE_UINTPTR ), /* 232 */
|
||||
new LogParam( "CriAtomEx3dTransceiverConfig", LogParamTypes.TYPE_UINTPTR ), /* 233 */
|
||||
new LogParam( "CriAtomEx3dRegionHn", LogParamTypes.TYPE_UINTPTR ), /* 234 */
|
||||
new LogParam( "CriAtomEx3dTransceiverDirectAudioRadius", LogParamTypes.TYPE_FLOAT32 ), /* 235 */
|
||||
new LogParam( "CriAtomEx3dTransceiverCrossFadeDistance", LogParamTypes.TYPE_FLOAT32 ), /* 236 */
|
||||
new LogParam( "program_no", LogParamTypes.TYPE_INT32 ), /* 237 */
|
||||
new LogParam( "key_no", LogParamTypes.TYPE_INT32 ), /* 238 */
|
||||
new LogParam( "Velocity", LogParamTypes.TYPE_INT16 ), /* 239 */
|
||||
new LogParam( "PitchBend", LogParamTypes.TYPE_INT16 ), /* 240 */
|
||||
|
||||
new LogParam("Format", LogParamTypes.TYPE_INT32 ), /* 241 */ /* CriAtomFormat */
|
||||
new LogParam("MaxRhythmTracks", LogParamTypes.TYPE_INT16 ), /* 242 */
|
||||
new LogParam("MaxMelodyTracks", LogParamTypes.TYPE_INT16 ), /* 243 */
|
||||
new LogParam("MaxVocalTracks", LogParamTypes.TYPE_INT16 ), /* 244 */
|
||||
new LogParam("AdmPlayerHn", LogParamTypes.TYPE_UINTPTR ), /* 245 */
|
||||
};
|
||||
|
||||
protected const uint LOG_MODE_OFF = 0;
|
||||
protected const uint LOG_MODE_PLAYBACK = 1;
|
||||
protected const uint LOG_MODE_ERROR = 1 << 1;
|
||||
protected const uint LOG_MODE_LOW_LEVEL_PLAYBACK = 1 << 2;
|
||||
protected const uint LOG_MODE_SYSTEM_INFO = 1 << 3;
|
||||
protected const uint LOG_MODE_HANDLE_INFO = 1 << 4;
|
||||
protected const uint LOG_MODE_CUE_LIMIT = 1 << 5;
|
||||
protected const uint LOG_MODE_PROBABILITY = 1 << 6;
|
||||
protected const uint LOG_MODE_CATEGORY = 1 << 7;
|
||||
protected const uint LOG_MODE_EXECUTING_INFORMATION = 1 << 8;
|
||||
protected const uint LOG_MODE_3D_INFO = 1 << 9;
|
||||
protected const uint LOG_MODE_USER_LOG = 1 << 10;
|
||||
protected const uint LOG_MODE_VOICE_VOLUME = 1 << 11;
|
||||
protected const uint LOG_MODE_ALL = 0xFFFFFFFF;
|
||||
|
||||
protected enum LogTypes {
|
||||
NON = 0,
|
||||
PLAYBACK,
|
||||
ERROR,
|
||||
LOW_LEVEL_PLAYBACK,
|
||||
SYSTEM_INFORMATION,
|
||||
HANDLE_INFORMATION,
|
||||
CUE_LIMIT,
|
||||
PROBABILITY,
|
||||
CATEGORY,
|
||||
EXECUTING_INFORMATION,
|
||||
INFORMATION_3D,
|
||||
USER_LOG,
|
||||
VOICE_VOLUME
|
||||
};
|
||||
|
||||
protected const uint FORMAT_NONE = 0;
|
||||
protected const uint FORMAT_ADX = 1 << 0;
|
||||
protected const uint FORMAT_HCA = 1 << 2;
|
||||
protected const uint FORMAT_HCA_MX = 1 << 3;
|
||||
protected const uint FORMAT_PCM = 1 << 4;
|
||||
protected const uint FORMAT_WAVE = 1 << 5;
|
||||
protected const uint FORMAT_RAW_PCM = 1 << 6;
|
||||
protected const uint FORMAT_AIFF = 1 << 7;
|
||||
protected const uint FORMAT_VIBRATION = 1 << 8;
|
||||
protected const uint FORMAT_AUDIO_BUFFER = 1 << 9;
|
||||
protected const uint FORMAT_SOUND_GENERATOR = 1 << 10;
|
||||
protected const uint FORMAT_RAW_PCM_FLOAT = 1 << 11;
|
||||
protected const uint FORMAT_HW1 = 1 << 16;
|
||||
protected const uint FORMAT_HW2 = 1 << 17;
|
||||
/* aliases */
|
||||
protected const uint FORMAT_XMA = FORMAT_HW1;
|
||||
protected const uint FORMAT_NDS_ADPCM = FORMAT_HW1;
|
||||
protected const uint FORMAT_WII_ADPCM = FORMAT_HW1;
|
||||
protected const uint FORMAT_WIIU_ADPCM = FORMAT_HW1;
|
||||
protected const uint FORMAT_3DS_ADPCM = FORMAT_HW1;
|
||||
protected const uint FORMAT_VAG = FORMAT_HW1;
|
||||
protected const uint FORMAT_ATRAC3 = FORMAT_HW2;
|
||||
protected const uint FORMAT_PSP2_HEVAG = FORMAT_HW1;
|
||||
protected const uint FORMAT_ATRAC9 = FORMAT_HW2;
|
||||
|
||||
protected enum StreamTypes {
|
||||
UNKNOWN = 0,
|
||||
ONMEMORY,
|
||||
STREAM,
|
||||
ZERO_LATENCY_STREAM,
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b5c9ddcfce383b46a04326d92d43c4f
|
||||
timeCreated: 1513761507
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 770ee637bb793ce42bf80dce6485d913
|
||||
timeCreated: 1513758004
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,212 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2018 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using System;
|
||||
using System.IO;
|
||||
#if (UNITY_5 || UNITY_2017_1_OR_NEWER) && (UNITY_IOS || UNITY_TVOS)
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
public class CriWareBuildPostprocessor : ScriptableObject
|
||||
{
|
||||
private static string prefsFilePath;
|
||||
public bool iosAddDependencyFrameworks = true;
|
||||
public bool iosReorderLibraryLinkingsForVp9 = true;
|
||||
|
||||
[MenuItem("GameObject/CRIWARE/Create CriWareBuildPostprocessorPrefs.asset")]
|
||||
public static void Create()
|
||||
{
|
||||
CriWareBuildPostprocessor instance = LoadExistingAsset();
|
||||
if (instance) {
|
||||
Debug.LogError("[CRIWARE] Preferences file of CriWareBuildPostprocessor already exists.");
|
||||
Selection.activeObject = instance;
|
||||
return;
|
||||
}
|
||||
|
||||
var scobj = ScriptableObject.CreateInstance<CriWareBuildPostprocessor>();
|
||||
if (scobj == null) {
|
||||
Debug.Log("[CRIWARE] Failed to create CriWareBuildPostprocessor");
|
||||
return;
|
||||
}
|
||||
|
||||
var script = MonoScript.FromScriptableObject(scobj);
|
||||
prefsFilePath = Path.Combine(Path.GetDirectoryName(AssetDatabase.GetAssetPath(script)), "CriWareBuildPostprocessorPrefs.asset");
|
||||
|
||||
AssetDatabase.CreateAsset(scobj, prefsFilePath);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
Debug.Log("[CRIWARE] Created the preferences file of CriWareBuildPostprocessor. (" + prefsFilePath + ")");
|
||||
|
||||
Selection.activeObject = scobj;
|
||||
}
|
||||
|
||||
private static CriWareBuildPostprocessor LoadExistingAsset()
|
||||
{
|
||||
string postProcessorPath = "";
|
||||
string[] searchResult = AssetDatabase.FindAssets("t:CriWareBuildPostprocessor");
|
||||
if (searchResult.Length == 0) {
|
||||
return null;
|
||||
}
|
||||
postProcessorPath = AssetDatabase.GUIDToAssetPath(searchResult[0]);
|
||||
var instance = (CriWareBuildPostprocessor)AssetDatabase.LoadAssetAtPath(postProcessorPath, typeof(CriWareBuildPostprocessor));
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
[PostProcessScene]
|
||||
public static void OnPostProcessScene() {
|
||||
CheckGraphicsApiProcess ();
|
||||
}
|
||||
|
||||
|
||||
[PostProcessBuild]
|
||||
public static void OnPostprocessBuild(BuildTarget build_target, string path)
|
||||
{
|
||||
CriWareBuildPostprocessor instance = LoadExistingAsset();
|
||||
if (instance == null) {
|
||||
instance = ScriptableObject.CreateInstance<CriWareBuildPostprocessor>();
|
||||
Debug.Log(
|
||||
"[CRIWARE] Run CriWareBuildPostprocessor.OnPostprocessBuild with default preferences.\n"
|
||||
+ "If you want to change the preferences, please create the preferences file by 'GameObject/CRIWARE/Create CriWareBuildPostprocessorPrefs.asset' menu."
|
||||
);
|
||||
} else {
|
||||
Debug.Log(
|
||||
"[CRIWARE] Run CriWareBuildPostprocessor.OnPostprocessBuild with default preferences.\n"
|
||||
+ "If you want to change the preferences, please edit the preferences file (" + prefsFilePath + ")"
|
||||
);
|
||||
}
|
||||
|
||||
instance.IosAddDependencyFrameworksProcess(build_target, path,
|
||||
instance.iosAddDependencyFrameworks,
|
||||
instance.iosReorderLibraryLinkingsForVp9);
|
||||
switch (build_target) {
|
||||
case BuildTarget.WebGL:
|
||||
instance.PostprocessBuildWebGL(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetAssetPath(string assetName, string substring)
|
||||
{
|
||||
string[] pathStock = AssetDatabase.FindAssets(assetName);
|
||||
if (pathStock == null) {
|
||||
return null;
|
||||
}
|
||||
foreach (string path in pathStock) {
|
||||
string strPath = AssetDatabase.GUIDToAssetPath(path);
|
||||
if (strPath.Contains(substring)) {
|
||||
return strPath;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void IosAddDependencyFrameworksProcess(BuildTarget build_target, string path, bool add_frameworks, bool reorder_linkings)
|
||||
{
|
||||
#if UNITY_IOS || UNITY_TVOS
|
||||
#if UNITY_5 || UNITY_2017_1_OR_NEWER
|
||||
if ((build_target != BuildTarget.iOS && build_target != BuildTarget.tvOS) ||
|
||||
(!add_frameworks && !reorder_linkings)) {
|
||||
return;
|
||||
}
|
||||
string project_path = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
|
||||
PBXProject project = new PBXProject();
|
||||
project.ReadFromString(File.ReadAllText(project_path));
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
string target = project.GetUnityFrameworkTargetGuid();
|
||||
#else
|
||||
string target = project.TargetGuidByName("Unity-iPhone");
|
||||
#endif
|
||||
if (add_frameworks) {
|
||||
Debug.Log("[CRIWARE][iOS] Add dependency frameworks (VideoToolbox/OpenGLES/Metal)");
|
||||
project.AddFrameworkToProject(target, "VideoToolbox.framework", false);
|
||||
project.AddFrameworkToProject(target, "OpenGLES.framework", false);
|
||||
project.AddFrameworkToProject(target, "Metal.framework", false);
|
||||
}
|
||||
if (reorder_linkings) {
|
||||
bool isVp9Enabled = false;
|
||||
string libPartialPath = null;
|
||||
if (build_target == BuildTarget.iOS) {
|
||||
libPartialPath = "iOS/libcri_mana_vpx.a";
|
||||
} else { /* tvOS */
|
||||
libPartialPath = "tvOS/libcri_mana_vpx.a";
|
||||
}
|
||||
string unityLibRelPath = GetAssetPath("libcri_mana_vpx", libPartialPath);
|
||||
if (unityLibRelPath == null) {
|
||||
isVp9Enabled = false;
|
||||
} else {
|
||||
if (!(unityLibRelPath.StartsWith("Assets") || unityLibRelPath.StartsWith("Package"))) {
|
||||
Debug.LogAssertion("[CRIWARE] Internal: Not supported directory root name : " + unityLibRelPath
|
||||
+ "libcri_mana_vpx should be placed in the directory below Assets/ and Package/.");
|
||||
}
|
||||
unityLibRelPath = unityLibRelPath.Replace("\\", "/");
|
||||
string unityRootDirName = unityLibRelPath.Split('/')[0];
|
||||
string xcodeProjectRelPath = unityLibRelPath.Replace(unityRootDirName, "Libraries");
|
||||
isVp9Enabled = project.ContainsFileByRealPath(xcodeProjectRelPath);
|
||||
}
|
||||
if (isVp9Enabled) {
|
||||
string guid = project.FindFileGuidByRealPath("Libraries/libiPhone-lib.a", PBXSourceTree.Source);
|
||||
if (!string.IsNullOrEmpty(guid)) {
|
||||
project.RemoveFileFromBuild(target, guid);
|
||||
project.AddFileToBuild(target, guid);
|
||||
Debug.Log("[CRIWARE][iOS] Reordered linking of libiPhone-lib.a for VP9 support.");
|
||||
} else {
|
||||
Debug.LogWarning("[CRIWARE][iOS] Failed to reorder linkings of libraries for VP9 support.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.WriteAllText(project_path, project.WriteToString());
|
||||
#else
|
||||
if (build_target != BuildTarget.iPhone) {
|
||||
return;
|
||||
}
|
||||
Debug.LogWarning("[CRIWARE][iOS] Please add dependency frameworks (VideoToolbox.framework, Metal.framework) on Xcode.");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private static bool CheckGraphicsApiProcess() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void PostprocessBuildWebGL(string path)
|
||||
{
|
||||
string SourceDir = GetAssetPath("sofdec2.worker", "WebGL/sofdec2.worker.bin");
|
||||
if (SourceDir == null) {
|
||||
SourceDir = GetAssetPath("sofdec2.worker", "WebGL2/sofdec2.worker.bin");
|
||||
Debug.Assert((SourceDir != null), "[CRIWARE] Internal: Failed to copy WebGL library files.");
|
||||
}
|
||||
SourceDir = Directory.GetParent(SourceDir).ToString();
|
||||
string DestnationDir = path + "/StreamingAssets/";
|
||||
|
||||
bool ret = true;
|
||||
try {
|
||||
Directory.CreateDirectory(DestnationDir);
|
||||
File.Copy(Path.Combine(SourceDir, "sofdec2.worker.bin"), DestnationDir + "sofdec2.worker.js", true);
|
||||
File.Copy(Path.Combine(SourceDir, "sofdec2.worker.wajs.bin"), DestnationDir + "sofdec2wasm.worker.js", true);
|
||||
File.Copy(Path.Combine(SourceDir, "sofdec2.worker.wasm.bin"), DestnationDir + "sofdec2.worker.wasm", true);
|
||||
}
|
||||
catch (System.Exception) {
|
||||
Debug.LogError("[CRIWARE][WebGL] Copying sofdec2.worker.js failed.");
|
||||
ret = false;
|
||||
}
|
||||
if (ret) {
|
||||
Debug.Log("[CRIWARE][WebGL] Copying sofdec2.worker.js succeeded.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ec5f96f85afa264b976655949c8c72a
|
||||
timeCreated: 1445602397
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,192 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2017 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if UNITY_EDITOR && UNITY_5_6_OR_NEWER
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
[assembly: InternalsVisibleTo("EditorTests")]
|
||||
namespace CriWare {
|
||||
|
||||
public class CriWareBuildPreprocessor : ScriptableObject {
|
||||
public bool muteOtherAudio = true;
|
||||
|
||||
public static CriWareBuildPreprocessor LoadExistingAsset() {
|
||||
string preProcessorPath = "";
|
||||
string[] searchResult = AssetDatabase.FindAssets("t:CriWareBuildPreprocessor");
|
||||
if (searchResult.Length == 0) {
|
||||
return null;
|
||||
}
|
||||
preProcessorPath = AssetDatabase.GUIDToAssetPath(searchResult[0]);
|
||||
var instance = (CriWareBuildPreprocessor)AssetDatabase.LoadAssetAtPath(preProcessorPath, typeof(CriWareBuildPreprocessor));
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public class CriWareBuildPreprocessExcecutor :
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
IPreprocessBuildWithReport
|
||||
#else
|
||||
IPreprocessBuild
|
||||
#endif
|
||||
{
|
||||
private static string prefsFilePath;
|
||||
|
||||
public int callbackOrder { get { return 0; } }
|
||||
|
||||
[MenuItem("GameObject/CRIWARE/Create CriWareBuildPreprocessorPrefs.asset")]
|
||||
public static void Create()
|
||||
{
|
||||
CriWareBuildPreprocessor instance = CriWareBuildPreprocessor.LoadExistingAsset();
|
||||
if (instance) {
|
||||
Debug.LogError("[CRIWARE] Preferences file of CriWareBuildPreprocessor already exists.");
|
||||
Selection.activeObject = instance;
|
||||
return;
|
||||
}
|
||||
|
||||
var scobj = ScriptableObject.CreateInstance<CriWareBuildPreprocessor>();
|
||||
if (scobj == null) {
|
||||
Debug.Log("[CRIWARE] Failed to create CriWareBuildPreprocessor asset");
|
||||
return;
|
||||
}
|
||||
|
||||
var script = MonoScript.FromScriptableObject(scobj);
|
||||
prefsFilePath = Path.Combine(Path.GetDirectoryName(AssetDatabase.GetAssetPath(script)), "CriWareBuildPreprocessorPrefs.asset");
|
||||
|
||||
AssetDatabase.CreateAsset(scobj, prefsFilePath);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
Debug.Log("[CRIWARE] Created the preferences file of CriWareBuildPreprocessor. (" + prefsFilePath + ")");
|
||||
|
||||
Selection.activeObject = scobj;
|
||||
}
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||
{
|
||||
OnPreprocessBuild(report.summary.platform, report.summary.outputPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
public void OnPreprocessBuild(BuildTarget build_target, string path)
|
||||
{
|
||||
CriWareBuildPreprocessor instance = CriWareBuildPreprocessor.LoadExistingAsset();
|
||||
if (instance == null) {
|
||||
instance = ScriptableObject.CreateInstance<CriWareBuildPreprocessor>();
|
||||
Debug.Log(
|
||||
"[CRIWARE] Run CriWareBuildPreprocessor.OnPreprocessBuild with default preferences.\n"
|
||||
+ "If you want to change the preferences, please create the preferences file by 'GameObject/CRIWARE/Create CriWareBuildPreprocessorPrefs.asset' menu."
|
||||
);
|
||||
} else {
|
||||
Debug.Log(
|
||||
"[CRIWARE] CriWareBuildPreprocessor preferences file has been loaded.\n"
|
||||
+ "If you want to change the preferences, please edit the preferences file (" + prefsFilePath + ")"
|
||||
);
|
||||
}
|
||||
|
||||
if (instance.muteOtherAudio == true) {
|
||||
ModifyAudioManager(build_target, path);
|
||||
}
|
||||
/* @cond excludele */
|
||||
#if UNITY_WEBGL
|
||||
CheckEmscriptenVersion();
|
||||
#endif
|
||||
/* @endcond */
|
||||
}
|
||||
|
||||
private static void ModifyAudioManager(BuildTarget build_target, string path)
|
||||
{
|
||||
string audioManagerPath = "ProjectSettings/AudioManager.asset";
|
||||
SerializedObject audioManager = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath(audioManagerPath)[0]);
|
||||
SerializedProperty propertyDisableUnityAudio = audioManager.FindProperty("m_DisableAudio");
|
||||
|
||||
if (build_target == BuildTarget.Android) {
|
||||
if (PlayerSettings.muteOtherAudioSources == true) {
|
||||
propertyDisableUnityAudio.boolValue = false;
|
||||
}
|
||||
} else {
|
||||
propertyDisableUnityAudio.boolValue = false;
|
||||
}
|
||||
|
||||
audioManager.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
private void CheckEmscriptenVersion() {
|
||||
var pluginInfoList = GetPluginInfoList();
|
||||
var webglPluginInfoList = ExtractWebGLPluginInfoList(pluginInfoList);
|
||||
MatchingWebglPlatformInfo(webglPluginInfoList);
|
||||
}
|
||||
|
||||
internal static List<CriWareVersionWindow.PluginInfo> GetPluginInfoList() {
|
||||
CriWareVersionWindow _criWareVersionWindow = ScriptableObject.CreateInstance("CriWareVersionWindow") as CriWareVersionWindow;
|
||||
_criWareVersionWindow.Reload(CriWareVersionWindow.PluginType.CRIWARE, true);
|
||||
var pluginInfoList = _criWareVersionWindow.PluginInfos;
|
||||
return pluginInfoList;
|
||||
}
|
||||
|
||||
internal static List<CriWareVersionWindow.PluginInfo> ExtractWebGLPluginInfoList(List<CriWareVersionWindow.PluginInfo> pluginInfoList) {
|
||||
const string webgl1PlatformSymbol = "WebGL";
|
||||
const string webgl2PlatformSymbol = "WebGL2";
|
||||
var webglPluginInfoList = new List<CriWareVersionWindow.PluginInfo>();
|
||||
|
||||
foreach (var pluginInfo in pluginInfoList) {
|
||||
if (pluginInfo.platform.Equals(webgl1PlatformSymbol) || pluginInfo.platform.Equals(webgl2PlatformSymbol)) {
|
||||
webglPluginInfoList.Add(pluginInfo);
|
||||
}
|
||||
}
|
||||
return webglPluginInfoList;
|
||||
}
|
||||
|
||||
internal static void MatchingWebglPlatformInfo(List<CriWareVersionWindow.PluginInfo> webglPluginInfoList) {
|
||||
string ExceptionMessage = null;
|
||||
|
||||
if (webglPluginInfoList.Count == 0) {
|
||||
return;
|
||||
} else if (webglPluginInfoList.Count > 1) {
|
||||
ExceptionMessage = "[CRIWARE] Several competing CRIWARE WebGL libraries are included."
|
||||
+ "Please refer to the manual and import the appropriate plug-in library.";
|
||||
} else {
|
||||
string requriedWebglPlatformSymbol;
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
requriedWebglPlatformSymbol = "WebGL2";
|
||||
if (webglPluginInfoList[0].platform.Equals(requriedWebglPlatformSymbol)) {
|
||||
return;
|
||||
} else {
|
||||
ExceptionMessage = "[CRIWARE] CRIWARE Unity Plug-in built with Emscripten v1 only runs on Unity 2021.1 or earlier."
|
||||
+ "Please refer to the manual and import the appropriate plug-in library.";
|
||||
}
|
||||
# else
|
||||
requriedWebglPlatformSymbol = "WebGL";
|
||||
if (webglPluginInfoList[0].platform.Equals(requriedWebglPlatformSymbol)) {
|
||||
return;
|
||||
} else {
|
||||
ExceptionMessage = "[CRIWARE] CRIWARE Unity Plug-in built with Emscripten v2 only runs on Unity 2021.2 or later."
|
||||
+ "Please refer to the manual and import the appropriate plug-in library.";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
throw new BuildFailedException(ExceptionMessage);
|
||||
}
|
||||
/* @endcond */
|
||||
|
||||
}
|
||||
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db5c2e0b215f3400f99a53d5c91fead2
|
||||
timeCreated: 1507701071
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,55 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
public class CriWareEditor : UnityEditor.Editor
|
||||
{
|
||||
[MenuItem("GameObject/CRIWARE/Create CRIWARE Library Initializer", false, 150)]
|
||||
public static void CreateCriwareLibraryInitalizer()
|
||||
{
|
||||
CriWareInitializer[] criWareInitializerList = FindObjectsOfType(typeof(CriWareInitializer)) as CriWareInitializer[];
|
||||
if (criWareInitializerList.Length > 0) {
|
||||
Debug.LogError("\"CriWareLibraryInitializer\" already exists.");
|
||||
|
||||
Selection.activeGameObject = criWareInitializerList[0].gameObject;
|
||||
|
||||
} else {
|
||||
GameObject go = null;
|
||||
go = new GameObject("CriWareLibraryInitializer");
|
||||
|
||||
go.AddComponent<CriWareInitializer>();
|
||||
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/CRIWARE/Create CRIWARE Error Handler", false, 150)]
|
||||
public static void CreateCriwareErrorHandler()
|
||||
{
|
||||
CriWareErrorHandler[] criWareErrorHandlerList = FindObjectsOfType(typeof(CriWareErrorHandler)) as CriWareErrorHandler[];
|
||||
if (criWareErrorHandlerList.Length > 0) {
|
||||
Debug.LogError("\"CriWareErrorHandler\" already exists.");
|
||||
|
||||
Selection.activeGameObject = criWareErrorHandlerList[0].gameObject;
|
||||
|
||||
} else {
|
||||
GameObject go = null;
|
||||
go = new GameObject("CriWareErrorHandler");
|
||||
|
||||
go.AddComponent<CriWareErrorHandler>();
|
||||
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
}
|
||||
|
||||
} // end of class
|
||||
|
||||
} //namespace CriWare
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf50923c69c53c54895cb08f93d2db47
|
||||
timeCreated: 1433816077
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,38 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriWareErrorHandler))]
|
||||
public class CriWareErrorHandlerEditor : UnityEditor.Editor {
|
||||
private SerializedProperty m_enableForceCrashOnError;
|
||||
private SerializedProperty m_dontDestroyOnLoad;
|
||||
|
||||
private void OnEnable() {
|
||||
m_enableForceCrashOnError = serializedObject.FindProperty("enableForceCrashOnError");
|
||||
m_dontDestroyOnLoad = serializedObject.FindProperty("dontDestroyOnLoad");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
EditorGUILayout.PropertyField(m_enableForceCrashOnError, new GUIContent("Force Crash on Error"));
|
||||
EditorGUILayout.HelpBox("Force Crash on Error:\nAny CRIWARE error will cause the editor to crash.\nDon't enable this when debugging in the editor.", m_enableForceCrashOnError.boolValue ? MessageType.Warning : MessageType.Info);
|
||||
EditorGUILayout.PropertyField(m_dontDestroyOnLoad, new GUIContent("Dont Destroy on Load"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private int GenIntField(string label_str, string tooltip, int field_value, int min, int max)
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
return Mathf.Min(max, Mathf.Max(min, EditorGUILayout.IntField(content, field_value)));
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
/* end of file */
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b87a25f74c8edf344858ddfe92560ec0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,470 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
[CustomEditor(typeof(CriWareInitializer))]
|
||||
public class CriWareInitializerEditor : UnityEditor.Editor
|
||||
{
|
||||
private void GenToggleField(string label_str, string tooltip, ref bool field_value)
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = EditorGUILayout.Toggle(content, field_value);
|
||||
}
|
||||
|
||||
private void GenIntField(string label_str, string tooltip, ref int field_value, int min, int max)
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = Math.Min(max, Math.Max(min, EditorGUILayout.IntField(content, field_value)));
|
||||
}
|
||||
|
||||
private void GenIntFieldWithUnit(string label_str, string label_unit, string tooltip, ref int field_value, int min, int max)
|
||||
{
|
||||
//GUIContent content = new GUIContent(label_str, tooltip);
|
||||
//field_value = Math.Min(max, Math.Max(min, EditorGUILayout.IntField(content, field_value)));
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = Math.Min(max, Math.Max(min, EditorGUILayout.IntField(content, field_value)));
|
||||
int indentLevel = EditorGUI.indentLevel;
|
||||
EditorGUI.indentLevel = 0;
|
||||
EditorGUILayout.LabelField(label_unit);
|
||||
EditorGUI.indentLevel = indentLevel;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
}
|
||||
|
||||
private void GenPositiveFloatField(string label_str, string tooltip, ref float field_value, float min, float max)
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = Math.Min(max, Math.Max(min, EditorGUILayout.FloatField(content, field_value)));
|
||||
}
|
||||
|
||||
private void GenPositiveFloatField(string label_str, string label_unit, string tooltip, ref float field_value, float min, float max)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = Math.Min(max, Math.Max(min, EditorGUILayout.FloatField(content, field_value)));
|
||||
int indentLevel = EditorGUI.indentLevel;
|
||||
EditorGUI.indentLevel = 0;
|
||||
EditorGUILayout.LabelField(label_unit);
|
||||
EditorGUI.indentLevel = indentLevel;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void GenStringField(string label_str, string tooltip, ref string field_value)
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = EditorGUILayout.TextField(content, field_value);
|
||||
}
|
||||
|
||||
private Enum GenEnumField(string label_str, string tooltip, Enum field_value)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
GUIContent content = new GUIContent(label_str, tooltip);
|
||||
field_value = EditorGUILayout.EnumPopup(content, field_value);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
return field_value;
|
||||
}
|
||||
|
||||
static private bool showFileSystemAndroidConfig = false;
|
||||
static private bool showAtomStandardVoicePoolConfig = false;
|
||||
static private bool showAtomHcaMxVoicePoolConfig = false;
|
||||
static private bool showAtomEditorConfig = false;
|
||||
static private bool showAtomPCConfig = false;
|
||||
/* @cond excludele */
|
||||
static private bool showAtomLINUXConfig = false;
|
||||
/* @endcond */
|
||||
static private bool showAtomIOSConfig = false;
|
||||
static private bool showAtomAndroidConfig = false;
|
||||
static private bool showAtomAndroidVoicePoolConfig = true;
|
||||
/* @cond excludele */
|
||||
static private bool showAtomVitaConfig = false;
|
||||
static private bool showAtomVitaAtrac9VoicePoolConfig = true;
|
||||
static private bool showAtomPs4Config = false;
|
||||
static private bool showAtomPs4Atrac9VoicePoolConfig = true;
|
||||
static private bool showAtomPs4Audio3dVoicePoolConfig = true;
|
||||
static private bool showAtomSwitchConfig = false;
|
||||
static private bool showAtomSwitchOpusVoicePoolConfig = true;
|
||||
static private bool showAtomWebGLConfig = false;
|
||||
static private bool showAtomWebGLWebAudioVoicePoolConfig = true;
|
||||
static private bool showManaVitaConfig = false;
|
||||
static private bool showManaWebGLConfig = false;
|
||||
/* @endcond */
|
||||
|
||||
static private string[] asrOutputModes = {"Default", "Stereo", "4ch", "6ch(5.1ch)", "8ch(7.1ch)"};
|
||||
static private int[] asrNumOutputChannels = {0, 2, 4, 6, 8};
|
||||
static private string[] inGamePreviewSwitchModes = { "Disable", "Enable", "Follow Build Setting" };
|
||||
static private CriAtomConfig.InGamePreviewSwitchMode[] inGamePreviewSwitchModeValues
|
||||
= { CriAtomConfig.InGamePreviewSwitchMode.Disable, CriAtomConfig.InGamePreviewSwitchMode.Enable, CriAtomConfig.InGamePreviewSwitchMode.FollowBuildSetting };
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
CriWareInitializer initializer = target as CriWareInitializer;
|
||||
|
||||
Undo.RecordObject(target, null);
|
||||
|
||||
GUI.changed = false;
|
||||
{
|
||||
// FileSystem Config
|
||||
initializer.initializesFileSystem =
|
||||
EditorGUILayout.BeginToggleGroup("Initialize FileSystem", initializer.initializesFileSystem);
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
GenIntField("Number of Loaders", "The maximum number of CriFsLoader objects used at a time. " +
|
||||
"NOTE: Count the number of CriFsLoadFileRequest objects and the total number of Streaming Voices in CRI Atom settings and the number of CriMana.Player component,",
|
||||
ref initializer.fileSystemConfig.numberOfLoaders, 0, 128);
|
||||
GenIntField("Number of Binders", "", ref initializer.fileSystemConfig.numberOfBinders, 0, 128);
|
||||
GenIntField("Number of Installers", "", ref initializer.fileSystemConfig.numberOfInstallers, 0, 128);
|
||||
GenIntFieldWithUnit("Install Buffer Size", "[KiB]", "Internal buffer size to install data. A larger buffer size result in better performance.", ref initializer.fileSystemConfig.installBufferSize, 32, int.MaxValue);
|
||||
GenIntField("Max Length of Path", "The maximum length of path (file path or url path) that can be passed.", ref initializer.fileSystemConfig.maxPath, 64, 2048);
|
||||
GenStringField("User Agent String", "", ref initializer.fileSystemConfig.userAgentString);
|
||||
GenToggleField("Minimize FD Usage", "With this option, the plugin minimizes file descriptor usage so that applicaiton can save file descriptor resource. However, this may increase file I/O instead.", ref initializer.fileSystemConfig.minimizeFileDescriptorUsage);
|
||||
GenToggleField("Enable CRC Check", "This option enables a CRC check on loading or binding when the cpk file contains CRC.", ref initializer.fileSystemConfig.enableCrcCheck);
|
||||
|
||||
showFileSystemAndroidConfig = EditorGUILayout.Foldout(showFileSystemAndroidConfig, "Android Config");
|
||||
if (showFileSystemAndroidConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
/* Ver.2.03.03 以前は 0 がデフォルト値だったことの互換性維持のための処理 */
|
||||
if (initializer.fileSystemConfig.androidDeviceReadBitrate == 0) {
|
||||
initializer.fileSystemConfig.androidDeviceReadBitrate = CriFsConfig.defaultAndroidDeviceReadBitrate;
|
||||
}
|
||||
}
|
||||
GenIntFieldWithUnit("Device Read Bitrate", "[bps]", "Expected minimum device read bitrate to be used for multi-streaming management." + CriFsConfig.defaultAndroidDeviceReadBitrate + " bps",
|
||||
ref initializer.fileSystemConfig.androidDeviceReadBitrate, 0, int.MaxValue);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
|
||||
// Atom Config
|
||||
initializer.initializesAtom =
|
||||
EditorGUILayout.BeginToggleGroup("Initialize Atom", initializer.initializesAtom);
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
|
||||
|
||||
GenStringField("ACF File Name", "", ref initializer.atomConfig.acfFileName);
|
||||
GenIntField("Max Virtual Voices", "", ref initializer.atomConfig.maxVirtualVoices, CriAtomPlugin.GetRequiredMaxVirtualVoices(initializer.atomConfig), 1024);
|
||||
GenIntField("Max Voice Limit Groups", "", ref initializer.atomConfig.maxVoiceLimitGroups, 0, 1024);
|
||||
GenIntField("Max Parameter Blocks", "", ref initializer.atomConfig.maxParameterBlocks, 1024, 4096);
|
||||
GenIntField("Max Buses", "Maximum number of buses.", ref initializer.atomConfig.maxBuses, 1, 64);
|
||||
GenIntField("Max Categories", "Maximum number of categories.", ref initializer.atomConfig.maxCategories, 0, 1024);
|
||||
GenIntField("Max Aisacs", "Maximum number of Aisacs.", ref initializer.atomConfig.maxAisacs,1,55);
|
||||
GenIntField("Max Bus Sends", "Maximum number of Bus Sends.", ref initializer.atomConfig.maxBusSends,1,32);
|
||||
GenIntField("Max Sequence Events Per Frame", "Maximum number of sequence events that will be triggered in one application frame.", ref initializer.atomConfig.maxSequenceEventsPerFrame, 0, 64);
|
||||
GenIntField("Max Beat Sync Callbacks Per Frame", "Maximum number of beat synchronized callback that will be triggered in one application frame.", ref initializer.atomConfig.maxBeatSyncCallbacksPerFrame, 0, 64);
|
||||
GenIntField("Max Cue Link Callbacks Per Frame", "Maximum number of cue link callback that will be triggered in one application frame.", ref initializer.atomConfig.maxCueLinkCallbacksPerFrame, 0, 64);
|
||||
GenIntField("Categories per Playback", "Number of category references per playback.", ref initializer.atomConfig.categoriesPerPlayback, 0, 16);
|
||||
GenIntField("Max Faders", "Maximum number of faders.", ref initializer.atomConfig.maxFaders, 0, 1024);
|
||||
GenIntFieldWithUnit("Sampling Rate", "[Hz]",
|
||||
"Sound output sampling rate. "
|
||||
+ "HCA-MX needs to set the sampling rate of HCA-MX data. "
|
||||
+ "A value of 0 (the default value) means that the internal value will be applied.",
|
||||
ref initializer.atomConfig.outputSamplingRate, 0, 192000);
|
||||
GenPositiveFloatField("Server Frequency", "[Hz]", "", ref initializer.atomConfig.serverFrequency, 15.0f, 120.0f);
|
||||
|
||||
int selected_output_mode = 0;
|
||||
foreach (int num_channnels in asrNumOutputChannels) {
|
||||
if (num_channnels == initializer.atomConfig.asrOutputChannels) {
|
||||
break;
|
||||
}
|
||||
selected_output_mode++;
|
||||
}
|
||||
selected_output_mode = EditorGUILayout.Popup("ASR Output Mode", selected_output_mode, asrOutputModes);
|
||||
initializer.atomConfig.asrOutputChannels = asrNumOutputChannels[selected_output_mode];
|
||||
|
||||
GenToggleField("Use Time For Seed", "", ref initializer.atomConfig.useRandomSeedWithTime);
|
||||
|
||||
if (initializer.atomConfig.inGamePreviewMode == CriAtomConfig.InGamePreviewSwitchMode.Default) {
|
||||
initializer.atomConfig.inGamePreviewMode = initializer.atomConfig.usesInGamePreview ?
|
||||
CriAtomConfig.InGamePreviewSwitchMode.Enable :
|
||||
CriAtomConfig.InGamePreviewSwitchMode.Disable;
|
||||
initializer.atomConfig.usesInGamePreview = false;
|
||||
}
|
||||
int selected_ingamepreview_switch_mode = 0;
|
||||
foreach (CriAtomConfig.InGamePreviewSwitchMode mode in inGamePreviewSwitchModeValues) {
|
||||
if (mode == initializer.atomConfig.inGamePreviewMode) {
|
||||
break;
|
||||
}
|
||||
selected_ingamepreview_switch_mode++;
|
||||
}
|
||||
selected_ingamepreview_switch_mode = EditorGUILayout.Popup("In Game Preview", selected_ingamepreview_switch_mode, inGamePreviewSwitchModes);
|
||||
initializer.atomConfig.inGamePreviewMode = inGamePreviewSwitchModeValues[selected_ingamepreview_switch_mode];
|
||||
|
||||
if (initializer.atomConfig.inGamePreviewMode != CriAtomConfig.InGamePreviewSwitchMode.Disable) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Max Preview Objects", "", ref initializer.atomConfig.inGamePreviewConfig.maxPreviewObjects, 0, 1024);
|
||||
GenIntFieldWithUnit("Communication Buffer Size", "[KiB]", "Size of buffer for communication between library and tool.", ref initializer.atomConfig.inGamePreviewConfig.communicationBufferSize, 2048, int.MaxValue);
|
||||
GenIntFieldWithUnit("Update Interval", "[counts of server process]", "Interval to update playback position.", ref initializer.atomConfig.inGamePreviewConfig.playbackPositionUpdateInterval, 1, 8);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
if (initializer.atomConfig.inGamePreviewMode == CriAtomConfig.InGamePreviewSwitchMode.Enable ||
|
||||
initializer.atomConfig.inGamePreviewMode == CriAtomConfig.InGamePreviewSwitchMode.FollowBuildSetting) {
|
||||
EditorGUI.indentLevel += 2;
|
||||
showAtomStandardVoicePoolConfig = EditorGUILayout.Foldout(showAtomStandardVoicePoolConfig, "Switch Monitor Config");
|
||||
if (showAtomStandardVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenToggleField("Initialize Socket", "Initialize Socket library while CriWare Monitor initialization. Please turn off this flag if your project initializes Socket library.",
|
||||
ref initializer.atomConfig.switchInitializeSocket);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
/* @endcond */
|
||||
|
||||
/* @cond excludele */
|
||||
GenToggleField("VR Mode", "", ref initializer.atomConfig.vrMode);
|
||||
/* @endcond */
|
||||
GenToggleField("Keep Playing Sound On Pause", "", ref initializer.atomConfig.keepPlayingSoundOnPause);
|
||||
|
||||
showAtomStandardVoicePoolConfig = EditorGUILayout.Foldout(showAtomStandardVoicePoolConfig, "Standard Voice Pool Config");
|
||||
if (showAtomStandardVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.standardVoicePoolConfig.memoryVoices, 0, 1024);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.standardVoicePoolConfig.streamingVoices, 0, 1024);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomHcaMxVoicePoolConfig = EditorGUILayout.Foldout(showAtomHcaMxVoicePoolConfig, "HCA-MX Voice Pool Config");
|
||||
if (showAtomHcaMxVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.hcaMxVoicePoolConfig.memoryVoices, 0, 1024);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.hcaMxVoicePoolConfig.streamingVoices, 0, 1024);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomEditorConfig = EditorGUILayout.Foldout(showAtomEditorConfig, "Editor Config");
|
||||
if (showAtomEditorConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenToggleField("Enable User PCM Out Mode", "For audio recording or manual output.", ref initializer.atomConfig.editorPcmOutputConfig.enable);
|
||||
GenIntField("PCM Buffer Length", "", ref initializer.atomConfig.editorPcmOutputConfig.bufferLength, 1024, 48000);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomPCConfig = EditorGUILayout.Foldout(showAtomPCConfig, "PC Config");
|
||||
if (showAtomPCConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntFieldWithUnit("Buffering Time", "[msec]", "Sound buffering time in msec.", ref initializer.atomConfig.pcBufferingTime, 0, 2000);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
/* @cond excludele */
|
||||
showAtomLINUXConfig = EditorGUILayout.Foldout(showAtomLINUXConfig, "Linux Config");
|
||||
if (showAtomLINUXConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
initializer.atomConfig.linuxOutput = (CriAtomConfig.LinuxOutput)GenEnumField("Sound Output", "Sound output system (default is PulseAudio).", initializer.atomConfig.linuxOutput);
|
||||
GenIntFieldWithUnit("PulseAudio Latency", "[usec]", "Latency setting for PluseAudio.", ref initializer.atomConfig.linuxPulseLatencyUsec, 0, 200000);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
/* @endcond */
|
||||
showAtomIOSConfig = EditorGUILayout.Foldout(showAtomIOSConfig, "iOS Config");
|
||||
if (showAtomIOSConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenToggleField("Enable SonicSYNC", "", ref initializer.atomConfig.iosEnableSonicSync);
|
||||
EditorGUI.BeginDisabledGroup(initializer.atomConfig.iosEnableSonicSync);
|
||||
{
|
||||
GenIntFieldWithUnit("Buffering Time", "[msec]", "Sound buffering time in msec.", ref initializer.atomConfig.iosBufferingTime, 16, 200);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
GenToggleField("Override iPod Music", "", ref initializer.atomConfig.iosOverrideIPodMusic);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomAndroidConfig = EditorGUILayout.Foldout(showAtomAndroidConfig, "Android Config");
|
||||
if (showAtomAndroidConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenToggleField("Enable SonicSYNC", "", ref initializer.atomConfig.androidEnableSonicSync);
|
||||
EditorGUI.BeginDisabledGroup(initializer.atomConfig.androidEnableSonicSync);
|
||||
{
|
||||
/* Ver.2.03.03 以前は 0 がデフォルト値だったことの互換性維持のための処理 */
|
||||
if (initializer.atomConfig.androidBufferingTime == 0) {
|
||||
initializer.atomConfig.androidBufferingTime = (int)(4 * 1000.0 / initializer.atomConfig.serverFrequency);
|
||||
}
|
||||
if (initializer.atomConfig.androidStartBufferingTime == 0) {
|
||||
initializer.atomConfig.androidStartBufferingTime = (int)(3 * 1000.0 / initializer.atomConfig.serverFrequency);
|
||||
}
|
||||
}
|
||||
GenIntFieldWithUnit("Buffering Time", "[msec]", "Sound buffering time in msec.", ref initializer.atomConfig.androidBufferingTime, 50, 500);
|
||||
GenIntFieldWithUnit("Start Buffering", "[msec]", "Sound buffering time to start playing. This value will be applied when using the low latency voice pool.", ref initializer.atomConfig.androidStartBufferingTime, 50, 500);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
showAtomAndroidVoicePoolConfig = EditorGUILayout.Foldout(showAtomAndroidVoicePoolConfig, "Low Latency Standard Voice Pool Config");
|
||||
if (showAtomAndroidVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.androidLowLatencyStandardVoicePoolConfig.memoryVoices, 0, 32);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.androidLowLatencyStandardVoicePoolConfig.streamingVoices, 0, 32);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
GenToggleField("Use Android Fast Mixer", "", ref initializer.atomConfig.androidUsesAndroidFastMixer);
|
||||
GenToggleField("Use Asr For Default Playback", "", ref initializer.atomConfig.androidForceToUseAsrForDefaultPlayback);
|
||||
GenToggleField("[Beta] Use AAudio", "", ref initializer.atomConfig.androidUsesAAudio);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
/* @cond excludele */
|
||||
showAtomVitaConfig = EditorGUILayout.Foldout(showAtomVitaConfig, "PS Vita Config");
|
||||
if (showAtomVitaConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
showAtomVitaAtrac9VoicePoolConfig = EditorGUILayout.Foldout(showAtomVitaAtrac9VoicePoolConfig, "ATRAC9 Voice Pool Config");
|
||||
if (showAtomVitaAtrac9VoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.vitaAtrac9VoicePoolConfig.memoryVoices, 0, 32);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.vitaAtrac9VoicePoolConfig.streamingVoices, 0, 32);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomPs4Config = EditorGUILayout.Foldout(showAtomPs4Config, "PS4 Config");
|
||||
if (showAtomPs4Config) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
showAtomPs4Atrac9VoicePoolConfig = EditorGUILayout.Foldout(showAtomPs4Atrac9VoicePoolConfig, "ATRAC9 Voice Pool Config");
|
||||
if (showAtomPs4Atrac9VoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.ps4Atrac9VoicePoolConfig.memoryVoices, 0, 256);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.ps4Atrac9VoicePoolConfig.streamingVoices, 0, 256);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
|
||||
initializer.atomConfig.ps4Audio3dConfig.useAudio3D =
|
||||
EditorGUILayout.BeginToggleGroup("Object-Based Audio", initializer.atomConfig.ps4Audio3dConfig.useAudio3D);
|
||||
EditorGUI.indentLevel += 2;
|
||||
showAtomPs4Audio3dVoicePoolConfig = EditorGUILayout.Foldout(showAtomPs4Audio3dVoicePoolConfig, "Audio 3D Voice Pool Config");
|
||||
if (showAtomPs4Audio3dVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.ps4Audio3dConfig.voicePoolConfig.memoryVoices, 0, 256);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.ps4Audio3dConfig.voicePoolConfig.streamingVoices, 0, 256);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 2;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
}
|
||||
|
||||
showAtomSwitchConfig = EditorGUILayout.Foldout(showAtomSwitchConfig, "Switch Config");
|
||||
if (showAtomSwitchConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenToggleField("Enable SonicSYNC", "", ref initializer.atomConfig.switchEnableSonicSync);
|
||||
showAtomSwitchOpusVoicePoolConfig = EditorGUILayout.Foldout(showAtomSwitchOpusVoicePoolConfig, "Opus Voice Pool Config");
|
||||
if (showAtomSwitchOpusVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Memory Voices", "", ref initializer.atomConfig.switchOpusVoicePoolConfig.memoryVoices, 0, 256);
|
||||
GenIntField("Streaming Voices", "", ref initializer.atomConfig.switchOpusVoicePoolConfig.streamingVoices, 0, 256);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showAtomWebGLConfig = EditorGUILayout.Foldout(showAtomWebGLConfig, "WebGL Config");
|
||||
if (showAtomWebGLConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
showAtomWebGLWebAudioVoicePoolConfig = EditorGUILayout.Foldout(showAtomWebGLWebAudioVoicePoolConfig, "WebAudio Voice Pool Config");
|
||||
if (showAtomWebGLWebAudioVoicePoolConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
GenIntField("Voices", "", ref initializer.atomConfig.webglWebAudioVoicePoolConfig.voices, 0, 32);
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
/* @endcond */
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
|
||||
/* @cond excludele */
|
||||
// Mana Config
|
||||
initializer.initializesMana =
|
||||
EditorGUILayout.BeginToggleGroup("Initialize Mana", initializer.initializesMana);
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
GenIntField("Number Of Decoders", "The maximum number of CriMana.Player component at a time. NOTE: Count as 2 when playing a movie with alpha channel.",
|
||||
ref initializer.manaConfig.numberOfDecoders, 0, 128);
|
||||
GenIntField("Number Of Max Entries", "", ref initializer.manaConfig.numberOfMaxEntries, 0, 1024);
|
||||
|
||||
showManaVitaConfig = EditorGUILayout.Foldout(showManaVitaConfig, "PS Vita Config");
|
||||
if (showManaVitaConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
initializer.manaConfig.vitaH264PlaybackConfig.useH264Playback =
|
||||
EditorGUILayout.BeginToggleGroup("H.264 Playback", initializer.manaConfig.vitaH264PlaybackConfig.useH264Playback);
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
GenIntField("Max Width", "", ref initializer.manaConfig.vitaH264PlaybackConfig.maxWidth, 64, 1280);
|
||||
GenIntField("Max Height", "", ref initializer.manaConfig.vitaH264PlaybackConfig.maxHeight, 64, 720);
|
||||
GenToggleField("Get Memory From CDRAM",
|
||||
"Let Mana H264 decoder use VRAM.\n" +
|
||||
"This significantly boost decoding and drawing of movie textures. " +
|
||||
"But It may takes longer to prepare the player depending movie size."
|
||||
, ref initializer.manaConfig.vitaH264PlaybackConfig.getMemoryFromTexture);
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
showManaWebGLConfig = EditorGUILayout.Foldout(showManaWebGLConfig, "WebGL Config");
|
||||
if (showManaWebGLConfig) {
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
GenStringField("WebWorker Path",
|
||||
"The directory path where sofdec2.worker.js is located.\n" +
|
||||
"sofdec2.worker.js is generated in StreamingAssets at build time."
|
||||
, ref initializer.manaConfig.webglConfig.webworkerPath);
|
||||
GenIntFieldWithUnit("Heap Size"
|
||||
,"[MiB]"
|
||||
,"Set heap size.\n"
|
||||
, ref initializer.manaConfig.webglConfig.heapSize
|
||||
, 32
|
||||
, 512);
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
/* @endcond */
|
||||
|
||||
/* @cond excludele */
|
||||
// Decrypter Config
|
||||
initializer.useDecrypter =
|
||||
EditorGUILayout.BeginToggleGroup("Decrypter Settings", initializer.useDecrypter);
|
||||
EditorGUI.indentLevel += 1;
|
||||
{
|
||||
initializer.decrypterConfig.key =
|
||||
EditorGUILayout.TextField("Key Value", initializer.decrypterConfig.key);
|
||||
GenStringField("Auth File Name", "", ref initializer.decrypterConfig.authenticationFile);
|
||||
GenToggleField("Enable Atom Decryption", "", ref initializer.decrypterConfig.enableAtomDecryption);
|
||||
GenToggleField("Enable Mana Decryption", "", ref initializer.decrypterConfig.enableManaDecryption);
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
/* @endcond */
|
||||
GenToggleField("Dont Initialize On Awake", "", ref initializer.dontInitializeOnAwake);
|
||||
GenToggleField("Dont Destroy On Load", "", ref initializer.dontDestroyOnLoad);
|
||||
}
|
||||
if (GUI.changed) {
|
||||
EditorUtility.SetDirty(initializer);
|
||||
}
|
||||
}
|
||||
} // end of class
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
/* end of file */
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3495d48c4496a8148ba10db9308bd557
|
||||
timeCreated: 1433816076
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,720 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2014 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
public sealed class CriWareVersionWindow : EditorWindow
|
||||
{
|
||||
List<TargetInfo> searchresult = new List<TargetInfo>();
|
||||
private readonly string[][] pluginBinaryFilenames = {
|
||||
new string[]{"PC", "PCx64", "CRIWARE Monitor Unity", "x86_64/cri_ware_unity.dll"},
|
||||
new string[]{"PC", "PCx86", "CRIWARE Monitor Unity", "x86/cri_ware_unity.dll"},
|
||||
new string[]{"MacOSX", "Mac_X86_64", "CRIWARE Monitor Unity", "cri_ware_unity.bundle/Contents/MacOS/cri_ware_unity"},
|
||||
new string[]{"MacOSX", "Mac_ARMv8_A64", "CRIWARE Monitor Unity", "cri_ware_unity.bundle/Contents/MacOS/cri_ware_unity"},
|
||||
new string[]{"Android", "Android", "CRIWARE Monitor Unity", "Android/libs/arm64-v8a/libcri_ware_unity.so"},
|
||||
new string[]{"Android", "Android", "CRIWARE Monitor Unity", "Android/libs/armeabi-v7a/libcri_ware_unity.so"},
|
||||
new string[]{"Android", "Android", "CRIWARE Monitor Unity", "Android/libs/x86/libcri_ware_unity.so"},
|
||||
new string[]{"Android", "Android", "CRIWARE Monitor Unity", "Android/libs/x86_64/libcri_ware_unity.so"},
|
||||
new string[]{"iOS", "iOS_ARMv7", "CRIWARE Monitor Unity", "iOS/libcri_ware_unity.a"},
|
||||
new string[]{"iOS", "iOS_ARMv7s", "CRIWARE Monitor Unity", "iOS/libcri_ware_unity.a"},
|
||||
new string[]{"iOS", "iOS_ARMv8_A64", "CRIWARE Monitor Unity", "iOS/libcri_ware_unity.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86", "CRIWARE Monitor Unity", "iOS/libcri_ware_unity.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86_64", "CRIWARE Monitor Unity", "iOS/libcri_ware_unity.a"},
|
||||
/* @cond excludele */
|
||||
new string[]{"tvOS", "iOS_ARMv8_A64", "CRIWARE Monitor Unity", "tvOS/libcri_ware_unity.a"},
|
||||
new string[]{"tvOS", "iOS_SIM_X86_64", "CRIWARE Monitor Unity", "tvOS/libcri_ware_unity.a"},
|
||||
new string[]{"PS4", "PS4", "CRIWARE Monitor Unity", "PS4/cri_ware_unity.prx"},
|
||||
new string[]{"PS5", "PS5", "CRIWARE Monitor Unity", "PS5/cri_ware_unity.prx"},
|
||||
new string[]{"XboxOne", "XboxOne", "CRIWARE Monitor Unity", "XboxOne/cri_ware_unity.dll"},
|
||||
new string[]{"XboxOne", "XboxOne", "CRIWARE Monitor Unity", "GameCoreXboxOne/cri_ware_unity.dll"},
|
||||
new string[]{"Scarlett", "Scarlett", "CRIWARE Monitor Unity", "Scarlett/cri_ware_unity.dll"},
|
||||
new string[]{"Scarlett", "Scarlett", "CRIWARE Monitor Unity", "GameCoreScarlett/cri_ware_unity.dll"},
|
||||
new string[]{"SWITCH", "SWITCH", "CRIWARE Monitor Unity", "NX64/cri_ware_unity.a"},
|
||||
new string[]{"UWP", "WinRT ARM64", "CRIWARE Monitor Unity", "UWP/ARM64/cri_ware_unity.dll"},
|
||||
new string[]{"UWP", "WinRT ARM", "CRIWARE Monitor Unity", "UWP/ARM/cri_ware_unity.dll"},
|
||||
new string[]{"UWP", "WinRT x86", "CRIWARE Monitor Unity", "UWP/x86/cri_ware_unity.dll"},
|
||||
new string[]{"UWP", "WinRT x64", "CRIWARE Monitor Unity", "UWP/x64/cri_ware_unity.dll"},
|
||||
new string[]{"WebGL", "Emscripten", "CRIWARE Unity", "WebGL/cri_ware_unity.bc"},
|
||||
new string[]{"WebGL2", "Emscripten", "CRIWARE Unity", "WebGL2/cri_ware_unity.bc"},
|
||||
new string[]{"Linux", "LINUX_X86_64", "CRIWARE Unity", "x86_64/libcri_ware_unity.so"},
|
||||
new string[]{"Stadia", "LINUX_X86_64", "CRIWARE Unity", "GGP/cri_ware_unity.so"},
|
||||
/* @endcond */
|
||||
};
|
||||
|
||||
private readonly string[][] lipsBinaryFilenames = {
|
||||
/* @cond excludele */
|
||||
new string[]{"PC", "PCx64", "CRI Lips Unity", "x86_64/cri_lips_unity.dll"},
|
||||
new string[]{"PC", "PCx86", "CRI Lips Unity", "x86/cri_lips_unity.dll"},
|
||||
new string[]{"MacOSX", "Mac_X86_64", "CRI Lips Unity", "cri_lips_unity.bundle/Contents/MacOS/cri_lips_unity"},
|
||||
new string[]{"MacOSX", "Mac_ARMv8_A64", "CRI Lips Unity", "cri_lips_unity.bundle/Contents/MacOS/cri_lips_unity"},
|
||||
new string[]{"Android", "Android", "CRI Lips Unity", "Android/libs/arm64-v8a/libcri_lips_unity.so"},
|
||||
new string[]{"Android", "Android", "CRI Lips Unity", "Android/libs/armeabi-v7a/libcri_lips_unity.so"},
|
||||
new string[]{"Android", "Android", "CRI Lips Unity", "Android/libs/x86/libcri_lips_unity.so"},
|
||||
new string[]{"Android", "Android", "CRI Lips Unity", "Android/libs/x86_64/libcri_lips_unity.so"},
|
||||
new string[]{"iOS", "iOS_ARMv7", "CRI Lips Unity", "iOS/libcri_lips_unity.a"},
|
||||
new string[]{"iOS", "iOS_ARMv7s", "CRI Lips Unity", "iOS/libcri_lips_unity.a"},
|
||||
new string[]{"iOS", "iOS_ARMv8_A64", "CRI Lips Unity", "iOS/libcri_lips_unity.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86", "CRI Lips Unity", "iOS/libcri_lips_unity.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86_64", "CRI Lips Unity", "iOS/libcri_lips_unity.a"},
|
||||
new string[]{"tvOS", "iOS_ARMv8_A64", "CRI Lips Unity", "tvOS/libcri_lips_unity.a"},
|
||||
new string[]{"tvOS", "iOS_SIM_X86_64", "CRI Lips Unity", "tvOS/libcri_lips_unity.a"},
|
||||
new string[]{"PS4", "PS4", "CRI Lips Unity", "PS4/cri_lips_unity.prx"},
|
||||
new string[]{"PS5", "PS5", "CRI Lips Unity", "PS5/cri_lips_unity.prx"},
|
||||
new string[]{"XboxOne", "XboxOne", "CRI Lips Unity", "XboxOne/cri_lips_unity.dll"},
|
||||
new string[]{"Scarlett", "Scarlett", "CRI Lips Unity", "Scarlett/cri_lips_unity.dll"},
|
||||
new string[]{"SWITCH", "SWITCH", "CRI Lips Unity", "NX64/cri_lips_unity.a"},
|
||||
/* @endcond */
|
||||
};
|
||||
|
||||
private readonly string[][] mcDspBinaryFilenames = {
|
||||
/* @cond excludele */
|
||||
new string[]{"PC", "PCx64", "CRI AFX MCDSP", "x86_64/criafx_mcdsp.dll"},
|
||||
new string[]{"PC", "PCx86", "CRI AFX MCDSP", "x86/criafx_mcdsp.dll"},
|
||||
new string[]{"MacOSX", "Mac_X86_64", "CRI AFX MCDSP", "criafx_mcdsp.bundle/Contents/MacOS/criafx_mcdsp"},
|
||||
new string[]{"MacOSX", "Mac_ARMv8_A64", "CRI AFX MCDSP", "criafx_mcdsp.bundle/Contents/MacOS/criafx_mcdsp"},
|
||||
new string[]{"Android", "Android", "CRI AFX MCDSP", "Android/libs/arm64-v8a/libcriafx_mcdsp.so"},
|
||||
new string[]{"Android", "Android", "CRI AFX MCDSP", "Android/libs/armeabi-v7a/libcriafx_mcdsp.so"},
|
||||
new string[]{"Android", "Android", "CRI AFX MCDSP", "Android/libs/x86/libcriafx_mcdsp.so"},
|
||||
new string[]{"Android", "Android", "CRI AFX MCDSP", "Android/libs/x86_64/libcriafx_mcdsp.so"},
|
||||
new string[]{"iOS", "iOS_ARMv7", "CRI AFX MCDSP", "iOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"iOS", "iOS_ARMv7s", "CRI AFX MCDSP", "iOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"iOS", "iOS_ARMv8_A64", "CRI AFX MCDSP", "iOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86", "CRI AFX MCDSP", "iOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86_64", "CRI AFX MCDSP", "iOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"tvOS", "iOS_ARMv8_A64", "CRI AFX MCDSP", "tvOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"tvOS", "iOS_SIM_X86_64", "CRI AFX MCDSP", "tvOS/libcriafx_mcdsp.a"},
|
||||
new string[]{"PS4", "PS4", "CRI AFX MCDSP", "PS4/criafx_mcdsp.prx"},
|
||||
new string[]{"XboxOne", "XboxOne", "CRI AFX MCDSP", "XboxOne/criafx_mcdsp.dll"},
|
||||
new string[]{"SWITCH", "SWITCH", "CRI AFX MCDSP", "NX64/criafx_mcdsp.a" }
|
||||
/* @endcond */
|
||||
};
|
||||
|
||||
private readonly string[][] vp9BinaryFilenames = {
|
||||
/* @cond excludele */
|
||||
new string[]{"PC", "PCx64", "CRI Vpx", "x86_64/cri_mana_vpx.dll"},
|
||||
new string[]{"PC", "PCx86", "CRI Vpx", "x86/cri_mana_vpx.dll"},
|
||||
new string[]{"MacOSX", "Mac_X86_64", "CRI Vpx", "cri_mana_vpx.bundle/Contents/MacOS/cri_mana_vpx"},
|
||||
new string[]{"MacOSX", "Mac_ARMv8_A64", "CRI Vpx", "cri_mana_vpx.bundle/Contents/MacOS/cri_mana_vpx"},
|
||||
new string[]{"Android", "Android", "CRI Vpx", "Android/libs/arm64-v8a/libcri_mana_vpx.so"},
|
||||
new string[]{"Android", "Android", "CRI Vpx", "Android/libs/armeabi-v7a/libcri_mana_vpx.so"},
|
||||
new string[]{"Android", "Android", "CRI Vpx", "Android/libs/x86/libcri_mana_vpx.so"},
|
||||
new string[]{"Android", "Android", "CRI Vpx", "Android/libs/x86_64/libcri_mana_vpx.so"},
|
||||
new string[]{"iOS", "iOS_ARMv7", "CRI Vpx", "iOS/libcri_mana_vpx.a"},
|
||||
new string[]{"iOS", "iOS_ARMv7s", "CRI Vpx", "iOS/libcri_mana_vpx.a"},
|
||||
new string[]{"iOS", "iOS_ARMv8_A64", "CRI Vpx", "iOS/libcri_mana_vpx.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86", "CRI Vpx", "iOS/libcri_mana_vpx.a"},
|
||||
new string[]{"iOS", "iOS_SIM_X86_64", "CRI Vpx", "iOS/libcri_mana_vpx.a"},
|
||||
new string[]{"tvOS", "iOS_ARMv8_A64", "CRI Vpx", "tvOS/libcri_mana_vpx.a"},
|
||||
new string[]{"tvOS", "iOS_SIM_X86_64", "CRI Vpx", "tvOS/libcri_mana_vpx.a"},
|
||||
new string[]{"XboxOne", "XboxOne", "CRI Vpx", "XboxOne/cri_mana_vpx.dll"},
|
||||
new string[]{"Scarlett", "Scarlett", "CRI Vpx", "Scarlett/cri_mana_vpx.dll" }
|
||||
/* @endcond */
|
||||
};
|
||||
|
||||
internal enum PluginType
|
||||
{
|
||||
CRIWARE = 0,
|
||||
LIPS,
|
||||
MCDSP,
|
||||
VP9
|
||||
}
|
||||
|
||||
private static readonly string[] pluginTypeName = {
|
||||
"CRIWARE",
|
||||
"LipSync",
|
||||
"McDSP",
|
||||
"VP9"
|
||||
};
|
||||
|
||||
[Serializable]
|
||||
internal class ModuleInfo
|
||||
{
|
||||
public string name;
|
||||
public string target;
|
||||
public string version;
|
||||
public string buildDate;
|
||||
public string appendix;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
internal class PluginInfo
|
||||
{
|
||||
public string platform;
|
||||
public string target;
|
||||
public string path;
|
||||
public ModuleInfo info;
|
||||
public List<ModuleInfo> moduleVersionInfos;
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private List<PluginInfo> pluginInfos;
|
||||
internal List<PluginInfo> PluginInfos {
|
||||
get { return pluginInfos; }
|
||||
}
|
||||
[SerializeField]
|
||||
private int selectedInfoIndex = 0;
|
||||
private string detailVersionsString = "";
|
||||
private string[] detailVersionsStrings = {""};
|
||||
private Vector2 detailViewScrollPosition = Vector2.zero;
|
||||
private PluginType currentPluginType = PluginType.CRIWARE;
|
||||
private string scriptVerionText = "";
|
||||
private bool asmDefSupport = true;
|
||||
private bool hasDoubleByteChar = true;
|
||||
|
||||
/* GUI用スタイル定義 */
|
||||
private readonly GUILayoutOption platformColumnWidth = GUILayout.Width(80);
|
||||
private readonly GUILayoutOption targetColumnWidth = GUILayout.Width(120);
|
||||
private readonly GUILayoutOption versionColumnWidth = GUILayout.Width(140);
|
||||
private readonly GUILayoutOption buildDateColumnWidth = GUILayout.Width(200);
|
||||
private readonly GUILayoutOption appendixColumnWidth = GUILayout.Width(200);
|
||||
private readonly GUILayoutOption[] pathColumnWidth = {GUILayout.MinWidth(400), GUILayout.ExpandWidth(true)};
|
||||
|
||||
/* 詳細バージョン表示用等幅フォント定義 */
|
||||
static private Font _detailFont;
|
||||
static private GUIStyle _detailStyle;
|
||||
static private GUIStyle detailStyle {
|
||||
get {
|
||||
if (_detailFont == null) {
|
||||
string fontname = "";
|
||||
#if UNITY_EDITOR_WIN
|
||||
fontname = "Consolas";
|
||||
#elif UNITY_EDITOR_OSX
|
||||
fontname = "Courier";
|
||||
#endif
|
||||
_detailFont = Font.CreateDynamicFontFromOSFont(fontname, 12);
|
||||
_detailStyle = null;
|
||||
}
|
||||
if (_detailStyle == null) {
|
||||
_detailStyle = new GUIStyle(EditorStyles.largeLabel);
|
||||
_detailStyle.font = _detailFont;
|
||||
}
|
||||
return _detailStyle;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetScriptVersion(PluginType type)
|
||||
{
|
||||
Assembly assembly = null;
|
||||
this.asmDefSupport = true;
|
||||
|
||||
try {
|
||||
switch (type) {
|
||||
case PluginType.CRIWARE: { assembly = Assembly.Load("CriMw.CriWare.Runtime"); break; }
|
||||
case PluginType.LIPS: { assembly = Assembly.Load("CriMw.CriWare.Adxlipsync.Runtime"); break; }
|
||||
case PluginType.MCDSP: { assembly = Assembly.Load("CriMw.CriWare.Mcdsp.Runtime"); break; }
|
||||
case PluginType.VP9: { assembly = Assembly.Load("CriMw.CriWare.Vp9.Runtime"); break; }
|
||||
default: break;
|
||||
}
|
||||
} catch {
|
||||
this.asmDefSupport = false;
|
||||
try {
|
||||
assembly = Assembly.Load("Assembly-CSharp-firstpass");
|
||||
} catch {
|
||||
try {
|
||||
assembly = Assembly.Load("Assembly-CSharp");
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
switch (type) {
|
||||
case PluginType.CRIWARE: return (string)assembly.GetType("CriWare.Common").GetField("scriptVersionString", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
|
||||
case PluginType.LIPS: return (string)assembly.GetType(asmDefSupport ? "CriWare.CriLipsPlugin" : "CriLipsPlugin").GetField("scriptVersionString", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
|
||||
case PluginType.MCDSP: return (string)assembly.GetType(asmDefSupport ? "CriWare.CriAfxMcDspInitializer" : "CriAfxMcDspInitializer").GetField("scriptVersionString", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
|
||||
case PluginType.VP9: return (string)assembly.GetType(asmDefSupport ? "CriWare.CriManaVp9" : "CriManaVp9").GetField("scriptVersionString", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
|
||||
default: return null;
|
||||
}
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private string ScriptVersionFullText {
|
||||
get {
|
||||
return "Ver." + (this.scriptVerionText ?? " (not available)") + " " + (asmDefSupport ? " (with Assembly Definition)" : "") + (hasDoubleByteChar ? " [J]" : " [E]");
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSearchRule(PluginType type)
|
||||
{
|
||||
switch(type) {
|
||||
case PluginType.CRIWARE: return "t:DefaultAsset cri_ware_unity";
|
||||
case PluginType.LIPS: return "t:DefaultAsset cri_lips_unity";
|
||||
case PluginType.MCDSP: return "t:DefaultAsset criafx_mcdsp";
|
||||
case PluginType.VP9: return "t:DefaultAsset cri_mana_vpx";
|
||||
default: return "t:DefaultAsset";
|
||||
}
|
||||
}
|
||||
|
||||
private string[][] GetSearchInfo(PluginType type)
|
||||
{
|
||||
switch(type) {
|
||||
case PluginType.CRIWARE: return pluginBinaryFilenames;
|
||||
case PluginType.LIPS: return lipsBinaryFilenames;
|
||||
case PluginType.MCDSP: return mcDspBinaryFilenames;
|
||||
case PluginType.VP9: return vp9BinaryFilenames;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasDoubleByteChar(PluginType type) {
|
||||
const bool DefaultResult = false;
|
||||
|
||||
string searchKeyword;
|
||||
switch (type) {
|
||||
case PluginType.CRIWARE: { searchKeyword = "CriWare"; break; }
|
||||
case PluginType.LIPS: { searchKeyword = "CriLips"; break; }
|
||||
case PluginType.MCDSP: { searchKeyword = "CriAfxMcDspInitializer"; break; }
|
||||
case PluginType.VP9: { searchKeyword = "CriManaVp9"; break; }
|
||||
default: { searchKeyword = "CriWare"; break; }
|
||||
}
|
||||
string exactRegEx = "[\\/]" + searchKeyword + ".cs";
|
||||
searchKeyword = "t:Script " + searchKeyword;
|
||||
|
||||
string[] searchResGuid = AssetDatabase.FindAssets(searchKeyword);
|
||||
if (searchResGuid == null || searchResGuid.Length <= 0) { return DefaultResult; }
|
||||
var exactResGuid = searchResGuid.Where(item => Regex.IsMatch(AssetDatabase.GUIDToAssetPath(item), exactRegEx));
|
||||
if (exactResGuid.Count() <= 0) { return DefaultResult; }
|
||||
|
||||
string filePath = AssetDatabase.GUIDToAssetPath(exactResGuid.First());
|
||||
var lines = File.ReadAllLines(filePath).Where(line => line.Contains("<summary>"));
|
||||
if (lines.Count() > 0) {
|
||||
return Regex.IsMatch(lines.First(), "[^\x01-\x7E]");
|
||||
} else {
|
||||
return DefaultResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[MenuItem("Window/CRIWARE/Version Information", false, 200)]
|
||||
static void OpenWindow()
|
||||
{
|
||||
EditorWindow.GetWindow<CriWareVersionWindow>(false, "CRI Versions");
|
||||
}
|
||||
|
||||
private struct TargetInfo
|
||||
{
|
||||
public TargetInfo(string Path, string[] Info)
|
||||
{
|
||||
path = Path;
|
||||
info = Info;
|
||||
}
|
||||
|
||||
public string path;
|
||||
public string[] info;
|
||||
}
|
||||
|
||||
private string[] GenerateStock(string libName)
|
||||
{
|
||||
return AssetDatabase.FindAssets(libName);
|
||||
}
|
||||
|
||||
private List<TargetInfo> SearchItem(string[] stock, string[][] targetList)
|
||||
{
|
||||
List<TargetInfo> result = new List<TargetInfo>();
|
||||
foreach (string[] target in targetList) {
|
||||
foreach (string path in stock) {
|
||||
string strPath = AssetDatabase.GUIDToAssetPath(path).Replace("\\", "/");
|
||||
if (strPath.Contains("/" + target[3])) {
|
||||
if (target[0] == "PC" && strPath.Contains("UWP")) {
|
||||
continue;
|
||||
}
|
||||
result.Add(new TargetInfo(strPath, target));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
Reload(currentPluginType);
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
using (var scope = new EditorGUILayout.HorizontalScope()) {
|
||||
currentPluginType = PluginType.CRIWARE;
|
||||
/* @cond excludele */
|
||||
currentPluginType = (PluginType)GUILayout.Toolbar((int)currentPluginType, pluginTypeName);
|
||||
/* @endcond */
|
||||
if (GUI.changed) {
|
||||
selectedInfoIndex = 0;
|
||||
Reload(currentPluginType, true);
|
||||
}
|
||||
EditorGUILayout.Space();
|
||||
if (GUILayout.Button("Copy to Clipboard", GUILayout.Width(180))) {
|
||||
var clipboardText = PluginVersionsString();
|
||||
if (string.IsNullOrEmpty(clipboardText) == false ) {
|
||||
EditorGUIUtility.systemCopyBuffer = clipboardText;
|
||||
Debug.Log("[CRIWARE] Plugin version informations have been copied to the clipboard.");
|
||||
GUI.FocusControl("");
|
||||
}
|
||||
}
|
||||
if (GUILayout.Button("Reload", GUILayout.Width(80))) {
|
||||
Reload(currentPluginType, true);
|
||||
GUI.FocusControl("");
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField(((int)currentPluginType > 0 ? pluginTypeName[(int)currentPluginType] + " Expansion " : "") + "Script Version");
|
||||
|
||||
/* スクリプトバージョン表示 */
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.LabelField(this.ScriptVersionFullText);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
/* バイナリバージョン表示 */
|
||||
EditorGUILayout.LabelField(((int)currentPluginType > 0 ? pluginTypeName[(int)currentPluginType] + " Expansion " : "") + "Binary Version");
|
||||
|
||||
/* プラットフォーム別プラグインバイナリバージョン表示 */
|
||||
if (pluginInfos != null) {
|
||||
for (int i = 0; i < pluginInfos.Count; ++i) {
|
||||
using (var scope = new EditorGUILayout.HorizontalScope()) {
|
||||
EditorGUILayout.LabelField("", GUILayout.Width(15));
|
||||
var tempColor = GUI.color;
|
||||
if (i == selectedInfoIndex) {
|
||||
GUI.color = Color.yellow;
|
||||
}
|
||||
if (GUILayout.Button(pluginInfos[i].platform, EditorStyles.miniButton, platformColumnWidth)) {
|
||||
/* 表示の制限のため表示可能な文字数で切り出す */
|
||||
detailVersionsString = ModuleInfosToAlignedString(pluginInfos[i].moduleVersionInfos);
|
||||
detailVersionsStrings = SplitTextAreaMaxLength(detailVersionsString);
|
||||
selectedInfoIndex = i;
|
||||
detailViewScrollPosition = new Vector2(0.0f, 0.0f);
|
||||
GUI.FocusControl("");
|
||||
}
|
||||
if (i == selectedInfoIndex) {
|
||||
GUI.color = tempColor;
|
||||
}
|
||||
|
||||
if (pluginInfos[i].info != null) {
|
||||
EditorGUILayout.LabelField((pluginInfos[i].target ?? "--"), targetColumnWidth);
|
||||
EditorGUILayout.LabelField((pluginInfos[i].info.version ?? "--"), versionColumnWidth);
|
||||
EditorGUILayout.LabelField((pluginInfos[i].info.buildDate ?? "--"), buildDateColumnWidth);
|
||||
EditorGUILayout.LabelField((pluginInfos[i].info.appendix ?? "--"), appendixColumnWidth);
|
||||
} else {
|
||||
EditorGUILayout.LabelField("--", targetColumnWidth);
|
||||
EditorGUILayout.LabelField("--", versionColumnWidth);
|
||||
EditorGUILayout.LabelField("--", buildDateColumnWidth);
|
||||
EditorGUILayout.LabelField("--", appendixColumnWidth);
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField(pluginInfos[i].path, pathColumnWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
/* 詳細バージョン情報表示 */
|
||||
using (var scope = new EditorGUILayout.HorizontalScope()) {
|
||||
EditorGUILayout.LabelField("Details [ " + (pluginInfos.Count > selectedInfoIndex ? pluginInfos[selectedInfoIndex].platform + " / " + pluginInfos[selectedInfoIndex].target : "") + " ]", GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("Copy Details to Clipboard", GUILayout.Width(180)) && string.IsNullOrEmpty(detailVersionsString) == false) {
|
||||
EditorGUIUtility.systemCopyBuffer = detailVersionsString;
|
||||
Debug.Log("[CRIWARE] Plugin version details have been copied to the clipboard.");
|
||||
GUI.FocusControl("");
|
||||
}
|
||||
}
|
||||
|
||||
using (var scope = new EditorGUILayout.ScrollViewScope(detailViewScrollPosition, EditorStyles.textArea)) {
|
||||
detailViewScrollPosition = scope.scrollPosition;
|
||||
if (pluginInfos.Count > selectedInfoIndex) {
|
||||
foreach (var item in detailVersionsStrings) {
|
||||
GUILayout.TextArea(item, detailStyle);
|
||||
}
|
||||
} else {
|
||||
GUILayout.TextArea("No library has been found. This plugin may not have been installed.\n", detailStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal void Reload(PluginType type, bool forceRefresh = false)
|
||||
{
|
||||
this.scriptVerionText = GetScriptVersion(currentPluginType);
|
||||
this.hasDoubleByteChar = HasDoubleByteChar(currentPluginType);
|
||||
|
||||
string[] searchedResultStock = GenerateStock(GetSearchRule(type));
|
||||
this.searchresult = SearchItem(searchedResultStock, GetSearchInfo(type));
|
||||
|
||||
if (forceRefresh == false && pluginInfos != null) { return; }
|
||||
|
||||
pluginInfos = LoadPluginInfos(searchresult);
|
||||
if (pluginInfos.Count > 0) {
|
||||
/* 表示の制限のため表示可能な文字数で切り出す */
|
||||
detailVersionsString = ModuleInfosToAlignedString(pluginInfos[0].moduleVersionInfos);
|
||||
detailVersionsStrings = SplitTextAreaMaxLength(detailVersionsString);
|
||||
} else {
|
||||
detailVersionsString = "";
|
||||
detailVersionsStrings = new string[]{""};
|
||||
}
|
||||
detailViewScrollPosition = new Vector2(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
|
||||
private string PluginVersionsString()
|
||||
{
|
||||
if (pluginInfos == null || pluginInfos.Count <= 0) { return null; }
|
||||
|
||||
string[] moduleInfoStrings;
|
||||
try {
|
||||
moduleInfoStrings = ModuleInfosToAlignedString(
|
||||
(from item in pluginInfos select item.info).ToList()
|
||||
).Split(new string[]{System.Environment.NewLine}, System.StringSplitOptions.None);
|
||||
} catch (Exception e) {
|
||||
Debug.LogError("[CRIWARE] Internal/VersionWindow: Exception on getting version strings for clipboard / Message: " + e.Message);
|
||||
return null;
|
||||
}
|
||||
|
||||
int platformLength = pluginInfos.Max(item => (item != null) ? item.platform.Length : 0);
|
||||
string platformFormat = string.Format("{{0,-{0}}} ", platformLength);
|
||||
|
||||
string s = "";
|
||||
s += ((int)currentPluginType > 0 ? pluginTypeName[(int)currentPluginType] + " Expansion" : "CRIWARE Unity Plugin") + " Script Version" + System.Environment.NewLine
|
||||
+ " " + this.ScriptVersionFullText
|
||||
+ System.Environment.NewLine + System.Environment.NewLine
|
||||
+ ((int)currentPluginType > 0 ? pluginTypeName[(int)currentPluginType] + " Expansion" : "CRIWARE Unity Plugin") + " Binary Version" + System.Environment.NewLine;
|
||||
for (int i = 0; i < pluginInfos.Count; i++) {
|
||||
s += " " + string.Format(platformFormat, pluginInfos[i].platform) + moduleInfoStrings[i] + System.Environment.NewLine;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
private static string ModuleInfosToAlignedString(List<ModuleInfo> infos)
|
||||
{
|
||||
int nameLength = 0;
|
||||
int targetLength = 0;
|
||||
int versionLength = 0;
|
||||
int buildDateLength = 0;
|
||||
int appendixLength = 0;
|
||||
foreach (var info in infos) {
|
||||
if (info != null) {
|
||||
nameLength = System.Math.Max(nameLength, ((info.name != null) ? info.name.Length : 0));
|
||||
targetLength = System.Math.Max(targetLength , ((info.target != null) ? info.target.Length : 0));
|
||||
versionLength = System.Math.Max(versionLength, ((info.version != null) ? info.version.Length : 0));
|
||||
buildDateLength = System.Math.Max(buildDateLength, ((info.buildDate != null) ? info.buildDate.Length : 0));
|
||||
appendixLength = System.Math.Max(appendixLength, ((info.appendix != null) ? info.appendix.Length : 0));
|
||||
}
|
||||
}
|
||||
string format = string.Format(
|
||||
"{{0,-{0}}} {{1,-{1}}} {{2,-{2}}} {{3,-{3}}} {{4,-{4}}}" + System.Environment.NewLine,
|
||||
nameLength, targetLength, versionLength, buildDateLength, appendixLength
|
||||
);
|
||||
string s = "";
|
||||
foreach (var info in infos) {
|
||||
if (info != null) {
|
||||
s += string.Format(format, info.name, info.target, info.version, info.buildDate, info.appendix);
|
||||
} else {
|
||||
s += string.Format(format, "--", "--", "--", "--", "--");
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
private static string[] SplitTextAreaMaxLength(string s)
|
||||
{
|
||||
const int textAreaMaxLength = 16000;
|
||||
|
||||
List<string> stringList = new List<string>();
|
||||
int currentPos = 0;
|
||||
while(currentPos < s.Length) {
|
||||
if (currentPos + textAreaMaxLength >= s.Length) {
|
||||
string subString = s.Substring(currentPos, s.Length - currentPos);
|
||||
stringList.Add(subString);
|
||||
break;
|
||||
} else {
|
||||
string subString = s.Substring(currentPos, textAreaMaxLength);
|
||||
int lineEnd = subString.LastIndexOf("\n", StringComparison.Ordinal);
|
||||
if (lineEnd >= 0) {
|
||||
subString = subString.Substring(0, lineEnd);
|
||||
currentPos++; // ignore last line end
|
||||
}
|
||||
stringList.Add(subString);
|
||||
currentPos += subString.Length;
|
||||
}
|
||||
}
|
||||
|
||||
return stringList.ToArray();
|
||||
}
|
||||
|
||||
|
||||
private static List<PluginInfo> LoadPluginInfos(List<TargetInfo> targetInfos)
|
||||
{
|
||||
var pluginInfos = new List<PluginInfo>();
|
||||
int itemCnt = targetInfos.Count;
|
||||
int currentCnt = 0;
|
||||
foreach (var item in targetInfos) {
|
||||
EditorUtility.DisplayProgressBar("Gathering Information", "Getting library information for " + item.info[1], currentCnt / (float)itemCnt);
|
||||
try {
|
||||
var path = item.path;
|
||||
var moduleVersionInfos = LoadModuleInfos(path, item.info);
|
||||
if (moduleVersionInfos != null) {
|
||||
var info = new PluginInfo();
|
||||
info.moduleVersionInfos = moduleVersionInfos;
|
||||
info.info = info.moduleVersionInfos.Find((minfo) => minfo.target.Contains(item.info[1]) && (minfo.name.Contains(item.info[2])));
|
||||
if (info.info != null) {
|
||||
info.platform = item.info[0];
|
||||
info.target = info.info.target;
|
||||
info.path = item.path;
|
||||
pluginInfos.Add(info);
|
||||
}
|
||||
}
|
||||
currentCnt++;
|
||||
} catch (Exception e) {
|
||||
Debug.LogError("[CRIWARE] Internal/VersionWindow: Exception on getting information from " + item.info[3] + " / Message: " + e.Message);
|
||||
}
|
||||
}
|
||||
EditorUtility.ClearProgressBar();
|
||||
return pluginInfos;
|
||||
}
|
||||
|
||||
|
||||
private static List<ModuleInfo> LoadModuleInfos(string path, string[] targetInfo)
|
||||
{
|
||||
if (!System.IO.File.Exists(path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var bytes = System.IO.File.ReadAllBytes(path);
|
||||
if (System.IO.Path.GetExtension(path) == ".bc") {
|
||||
return LoadModuleInfosWithBitShift(bytes, targetInfo);
|
||||
} else {
|
||||
return LoadModuleInfos(bytes, targetInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static List<ModuleInfo> LoadModuleInfos(byte[] bytes, string[] targetInfo)
|
||||
{
|
||||
var data = System.Text.Encoding.ASCII.GetString(bytes);
|
||||
var infos = new List<ModuleInfo>();
|
||||
|
||||
var versionRegex = new System.Text.RegularExpressions.Regex("^([^/]+)(?:/(.+))? (Ver\\..+) (Build:(?:.*))$");
|
||||
var versionAppendixRegex = new System.Text.RegularExpressions.Regex("^Append: (.*)$");
|
||||
|
||||
/* Get informations only if the target name is exactly the same. For libraries with multiple targets in a single file. */
|
||||
bool checkTargetEquality = targetInfo[0].Equals("iOS") || targetInfo[0].Equals("tvOS") || targetInfo[0].Equals("MacOSX");
|
||||
|
||||
int pos = 0;
|
||||
while (true) {
|
||||
pos = data.IndexOf(" Build:", pos, StringComparison.Ordinal);
|
||||
if (pos == -1) {
|
||||
break;
|
||||
}
|
||||
++pos;
|
||||
{
|
||||
int beginPos = FindNonPrintableCharBackward(data, pos);
|
||||
int endPos = FindNonPrintableCharFoward(data, pos);
|
||||
if ((data[beginPos] != '\n') || (data[endPos] != '\n')) {
|
||||
continue;
|
||||
}
|
||||
++beginPos;
|
||||
var s = data.Substring(beginPos, (endPos - beginPos));
|
||||
var match = versionRegex.Match(s);
|
||||
if (!match.Success) {
|
||||
continue;
|
||||
}
|
||||
var info = new ModuleInfo();
|
||||
info.name = match.Groups[1].Value;
|
||||
info.target = match.Groups[2].Value;
|
||||
info.version = match.Groups[3].Value;
|
||||
info.buildDate = match.Groups[4].Value;
|
||||
if (checkTargetEquality
|
||||
&& !info.target.Contains(' ')
|
||||
&& !info.target.Equals(targetInfo[1])) {
|
||||
continue;
|
||||
}
|
||||
/* Appendix */
|
||||
if ((endPos + 2) < data.Length) {
|
||||
int appendisBeginPos = endPos + 1;
|
||||
int appendixEndPos = FindNonPrintableCharFoward(data, appendisBeginPos + 1);
|
||||
if ((data[appendisBeginPos] != '\0') || (data[appendixEndPos] != '\n')) {
|
||||
} else {
|
||||
++appendisBeginPos;
|
||||
s = data.Substring(appendisBeginPos, (appendixEndPos - appendisBeginPos));
|
||||
match = versionAppendixRegex.Match(s);
|
||||
if (match.Success) {
|
||||
info.appendix = match.Groups[1].Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
infos.Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
/* モジュール情報をモジュール名順にソート */
|
||||
infos.Sort((x, y) => x.name.CompareTo(y.name) );
|
||||
|
||||
return infos;
|
||||
}
|
||||
|
||||
|
||||
private static List<ModuleInfo> LoadModuleInfosWithBitShift(byte[] bytes, string[] targetInfo)
|
||||
{
|
||||
var infos = LoadModuleInfos(bytes, targetInfo);
|
||||
|
||||
for (int shift = 1; shift <= 7; shift++) {
|
||||
int rshift = 8 - shift;
|
||||
byte[] shifted = new byte[bytes.Length + 1];
|
||||
for (int i = 0; i < bytes.Length; i++) {
|
||||
shifted[i] |= (byte)((bytes[i] << shift));
|
||||
shifted[i + 1] |= (byte)(bytes[i] >> rshift);
|
||||
}
|
||||
infos.AddRange(LoadModuleInfos(shifted, targetInfo));
|
||||
}
|
||||
|
||||
/* モジュール情報をモジュール名順にソート */
|
||||
infos.Sort((x, y) => x.name.CompareTo(y.name) );
|
||||
|
||||
return infos;
|
||||
}
|
||||
|
||||
|
||||
private static int FindNonPrintableCharBackward(string s, int index)
|
||||
{
|
||||
for (; index >= 0; --index) {
|
||||
if ((s[index] < 32) || (s[index] > 126)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
private static int FindNonPrintableCharFoward(string s, int index)
|
||||
{
|
||||
for (; index < s.Length; index++) {
|
||||
if ((s[index] < 32) || (s[index] > 126)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cb38bf522cf7074c8fdf1c88cf79463
|
||||
timeCreated: 1433816076
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6c0e84fa4127e24db13d5dab4398e7b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,46 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("CriMw.CriWare.Adxlipsync.Editor")]
|
||||
[assembly: InternalsVisibleTo("CriMw.CriWare.Assets.Editor")]
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
internal static class CriEditorUtilitiesInternal
|
||||
{
|
||||
public static float SingleReturnHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return EditorGUIUtility.singleLineHeight + 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public static string BackingFieldNameOf(string propertyName)
|
||||
{
|
||||
return "<" + propertyName + ">k__BackingField";
|
||||
}
|
||||
|
||||
static Dictionary<System.Type, List<System.Type>> typesCache = new Dictionary<System.Type, List<System.Type>>();
|
||||
public static List<System.Type> GetSubclassesOf(System.Type baseType)
|
||||
{
|
||||
if (typesCache.ContainsKey(baseType))
|
||||
return typesCache[baseType];
|
||||
|
||||
var types = System.AppDomain.CurrentDomain.GetAssemblies().SelectMany(assem => assem.GetTypes()).
|
||||
Where(t => baseType.IsAssignableFrom(t) && !(t == baseType)).ToList();
|
||||
typesCache.Add(baseType, types);
|
||||
return types;
|
||||
}
|
||||
}
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e42361bfebaaf4deabdbc39094e45f1d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0868a9b55b2e51a40bbc1ac416ae821e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.9 KiB |
@@ -1,92 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54b14f2540d554f4c9bafa3501e6dc9f
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,91 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 092d44bfa808b4645826d36c43846fa4
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,55 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7b655dd5eeac7b489f2ddd1304fb5f4
|
||||
timeCreated: 1433816082
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,55 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4c14449c19b8f346be66595b3db44ff
|
||||
timeCreated: 1433816082
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15971ef3a8b088e4f89db2ff3f82d0e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "CriMw.CriWare.Runtime",
|
||||
"references": [
|
||||
"Unity.Timeline"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "CRIWARE_TIMELINE_1_OR_NEWER"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 800597811bcc5d848b15e12807d6de45
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2aec2f381367b8e4897166bdbe92fb9b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0513e446cdd53d344b6394b88cec50fb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c1f75350d960914cb70909e86065ca3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 497dbcc8f29bc4f4491b76ffb68daeca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4f3b826ae7019f4cbc0122e140dda20
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-356
@@ -1,356 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2018 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !UNITY_EDITOR && UNITY_ANDROID
|
||||
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriMana.Detail
|
||||
{
|
||||
public static partial class AutoResisterRendererResourceFactories
|
||||
{
|
||||
[RendererResourceFactoryPriority(7000)]
|
||||
public class RendererResourceFactoryAndroidH264Rgb : RendererResourceFactory
|
||||
{
|
||||
public override RendererResource CreateRendererResource(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
bool isCodecSuitable = movieInfo.codecType == CodecType.H264 && !CriManaPlugin.criManaUnity_IsBufferOutputForH264Enabled_ANDROID();
|
||||
bool isGraphicsApiSuitable = (UnityEngine.SystemInfo.graphicsDeviceType != UnityEngine.Rendering.GraphicsDeviceType.Vulkan);
|
||||
bool isSuitable = isCodecSuitable && isGraphicsApiSuitable;
|
||||
return isSuitable
|
||||
? new RendererResourceAndroidH264Rgb(playerId, movieInfo, additive, userShader)
|
||||
: null;
|
||||
}
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class RendererResourceAndroidH264Rgb : RendererResource
|
||||
{
|
||||
private const int RenderEventAction_ATTACH = (int)Player.CriManaUnityPlayer_RenderEventAction.DESTROY + 1;
|
||||
|
||||
private int playerId;
|
||||
|
||||
private int width;
|
||||
private int height;
|
||||
private int dispWidth;
|
||||
private int dispHeight;
|
||||
private int alphaWidth;
|
||||
private int alphaHeight;
|
||||
private bool useUserShader;
|
||||
|
||||
private Vector4 movieTextureST = new Vector4(1, -1, 0, 1);
|
||||
private Vector4 alphaTextureST = Vector4.zero;
|
||||
private Texture2D[] textures;
|
||||
private System.IntPtr[] nativePtrs = new System.IntPtr[1];
|
||||
|
||||
private bool needsUpdateTexture = false;
|
||||
private bool needsToDetachInitTexture = false;
|
||||
private bool areTexturesUpdated = false;
|
||||
|
||||
private bool isStoppingForSeek = false;
|
||||
private bool isStartTriggered = true;
|
||||
private System.UInt32 nativeTextureId;
|
||||
|
||||
public RendererResourceAndroidH264Rgb(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
this.playerId = playerId;
|
||||
width = (int)movieInfo.width;
|
||||
height = (int)movieInfo.height;
|
||||
dispWidth = (int)movieInfo.dispWidth;
|
||||
dispHeight = (int)movieInfo.dispHeight;
|
||||
|
||||
hasAlpha = movieInfo.hasAlpha;
|
||||
if (hasAlpha) {
|
||||
alphaWidth = Ceiling32(Ceiling16(CeilingWith(width, 8)));
|
||||
alphaHeight = CeilingWith(height, 16);
|
||||
}
|
||||
this.additive = additive;
|
||||
useUserShader = userShader != null;
|
||||
|
||||
if (userShader != null) {
|
||||
shader = userShader;
|
||||
} else {
|
||||
string shaderName = "CriMana/AndroidH264Rgb";
|
||||
shader = Shader.Find(shaderName);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
DisposeTextures(textures);
|
||||
textures = null;
|
||||
}
|
||||
|
||||
public override bool IsPrepared()
|
||||
{ return true; }
|
||||
|
||||
public override bool ContinuePreparing()
|
||||
{ return true; }
|
||||
|
||||
public override bool IsSuitable(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
bool isPlayerSuitable = playerId == this.playerId;
|
||||
bool isCodecSuitable = movieInfo.codecType == CodecType.H264;
|
||||
bool isSizeSuitable = (width == (int)movieInfo.width) && (height == (int)movieInfo.height);
|
||||
bool isAlphaSuitable = hasAlpha == movieInfo.hasAlpha;
|
||||
bool isAdditiveSuitable = this.additive == additive;
|
||||
bool isShaderSuitable = this.useUserShader ? (userShader == shader) : true;
|
||||
return isPlayerSuitable && isCodecSuitable && isSizeSuitable && isAlphaSuitable && isAdditiveSuitable && isShaderSuitable;
|
||||
}
|
||||
|
||||
public override bool OnPlayerStopForSeek()
|
||||
{
|
||||
if (textures == null) {
|
||||
return true;
|
||||
}
|
||||
isStoppingForSeek = true;
|
||||
isStartTriggered = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnPlayerStart()
|
||||
{
|
||||
isStartTriggered = true;
|
||||
}
|
||||
|
||||
public override bool ShouldSkipDestroyOnStopForSeek()
|
||||
{ return true; }
|
||||
|
||||
private void forceUpdateMaterialTextures(Texture[] newTextures)
|
||||
{
|
||||
if (currentMaterial != null) {
|
||||
currentMaterial.mainTexture = newTextures[0];
|
||||
currentMaterial.SetTexture("_TextureRGB", newTextures[0]);
|
||||
if (hasAlpha) {
|
||||
currentMaterial.SetTexture("_TextureA", newTextures[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AttachToPlayer(int playerId)
|
||||
{
|
||||
if (!isStoppingForSeek) {
|
||||
nativeTextureId = 0xffffffff;
|
||||
}
|
||||
criManaUnityPlayer_MediaCodecAttachTexture_ANDROID(playerId, nativeTextureId);
|
||||
needsToDetachInitTexture = true;
|
||||
}
|
||||
|
||||
|
||||
public override bool UpdateFrame(int playerId, FrameInfo frameInfo, ref bool frameDrop)
|
||||
{
|
||||
if (needsToDetachInitTexture) { // only once
|
||||
needsToDetachInitTexture = false;
|
||||
criManaUnityPlayer_MediaCodecDetachTexture_ANDROID(playerId, 0xffffffff);
|
||||
}
|
||||
|
||||
bool isFrameUpdated = CRIWARE9061FF01(playerId, 0, null, frameInfo, ref frameDrop);
|
||||
if (isFrameUpdated && !frameDrop) {
|
||||
needsUpdateTexture = true;
|
||||
}
|
||||
|
||||
return isFrameUpdated;
|
||||
}
|
||||
|
||||
|
||||
public override bool UpdateMaterial(Material material)
|
||||
{
|
||||
if (!areTexturesUpdated) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (currentMaterial != material) {
|
||||
currentMaterial = material;
|
||||
SetupStaticMaterialProperties();
|
||||
}
|
||||
if (textures != null) {
|
||||
material.mainTexture = textures[0];
|
||||
material.SetTexture("_TextureRGB", textures[0]);
|
||||
if (hasAlpha && textures[1] != null) {
|
||||
material.SetTexture("_TextureA", textures[1]);
|
||||
}
|
||||
}
|
||||
material.SetVector("_MovieTexture_ST", movieTextureST);
|
||||
if (hasAlpha) {
|
||||
material.SetVector("_AlphaTexture_ST", alphaTextureST);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void UpdateMovieTextureST(float[] texCoords, float dispWidth, float dispHeight)
|
||||
{
|
||||
movieTextureST.x = texCoords[0];
|
||||
movieTextureST.y = texCoords[1];
|
||||
movieTextureST.z = texCoords[2];
|
||||
movieTextureST.w = texCoords[3];
|
||||
|
||||
float uScale = (dispWidth != alphaWidth) ? ((float)dispWidth - 0.5f) / (float)alphaWidth : 1.0f;
|
||||
float vScale = (dispHeight != alphaHeight) ? ((float)dispHeight - 0.5f) / (float)alphaHeight : 1.0f;
|
||||
alphaTextureST.x = uScale;
|
||||
alphaTextureST.y = -vScale;
|
||||
alphaTextureST.z = 0.0f;
|
||||
alphaTextureST.w = vScale;
|
||||
}
|
||||
|
||||
public override void UpdateTextures()
|
||||
{
|
||||
if (needsUpdateTexture) { // only once by frame (updates texture may be called multiple time because it is by object an camera
|
||||
int numTextures = hasAlpha ? 2 : 1;
|
||||
nativePtrs[0] = System.IntPtr.Zero;
|
||||
bool isTextureUpdated = CRIWAREDA63C3D7(playerId, numTextures, nativePtrs);
|
||||
areTexturesUpdated |= isTextureUpdated;
|
||||
|
||||
if (isTextureUpdated && nativePtrs[0] != System.IntPtr.Zero && isStartTriggered) {
|
||||
needsUpdateTexture = false;
|
||||
var nativeTexture = (NativeTexture)Marshal.PtrToStructure(nativePtrs[0], typeof(NativeTexture));
|
||||
|
||||
if (textures == null) {
|
||||
textures = new Texture2D[2];
|
||||
textures[0] = Texture2D.CreateExternalTexture(width, height, TextureFormat.ARGB32, false, false, new System.IntPtr(nativeTexture.nativePtrRGB));
|
||||
textures[0].wrapMode = TextureWrapMode.Clamp;
|
||||
if (hasAlpha) {
|
||||
#if !UNITY_5_6_OR_NEWER || UNITY_5_6_0 || UNITY_5_6_1
|
||||
TextureFormat format = TextureFormat.Alpha8;
|
||||
#else
|
||||
TextureFormat format = TextureFormat.R8;
|
||||
#endif
|
||||
textures[1] = Texture2D.CreateExternalTexture(alphaWidth, alphaHeight, format, false, false, new System.IntPtr(nativeTexture.nativePtrA));
|
||||
textures[1].wrapMode = TextureWrapMode.Clamp;
|
||||
}
|
||||
if (currentMaterial != null) {
|
||||
forceUpdateMaterialTextures(textures);
|
||||
}
|
||||
nativeTextureId = nativeTexture.nativePtrRGB;
|
||||
} else {
|
||||
textures[0].UpdateExternalTexture(new System.IntPtr(nativeTexture.nativePtrRGB));
|
||||
if (hasAlpha) {
|
||||
textures[1].UpdateExternalTexture(new System.IntPtr(nativeTexture.nativePtrA));
|
||||
}
|
||||
}
|
||||
|
||||
UpdateMovieTextureST(nativeTexture.texCoords, dispWidth, dispHeight);
|
||||
isStoppingForSeek = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct NativeTexture
|
||||
{
|
||||
public System.UInt32 nativePtrRGB; // opengl GLuint texture name
|
||||
public System.UInt32 nativePtrA; // opengl GLuint texture name
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public float[] texCoords; // texture coordinates
|
||||
}
|
||||
|
||||
public static bool IsSupported()
|
||||
{
|
||||
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Vulkan) {
|
||||
Debug.Log("[CRIWARE] Another RendererResource will be used for Vulkan. Please use CriManaPlugin.IsCodecSupported instead.");
|
||||
return true;
|
||||
}
|
||||
|
||||
/* check if native code for Android MediaCodec is supported by device */
|
||||
if (!criManaUnity_IsMediaCodecSupported_ANDROID((int)SystemInfo.graphicsDeviceType)) {
|
||||
Debug.Log("[CRIWARE] criManaUnity_IsMediaCodecSupported_ANDROID returned false.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If OpenGLES2, all devices can render h.264 videos */
|
||||
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Load a shader for rendering test */
|
||||
Shader shader = Shader.Find("CriMana/AndroidH264DummySupportCheck");
|
||||
|
||||
/* Check the compiled shader is supported(only works on old Unity) */
|
||||
if (!shader.isSupported) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Save current active RenderTexture */
|
||||
var current = RenderTexture.active;
|
||||
|
||||
/* Create textures for shader rendering test */
|
||||
Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
|
||||
RenderTexture renderTexture = new RenderTexture(1, 1, 0);
|
||||
renderTexture.Create();
|
||||
/* Create material with the shader */
|
||||
Material material = new Material(shader);
|
||||
/* Render on RenderTexture */
|
||||
Graphics.Blit(texture, renderTexture, material, 0);
|
||||
|
||||
/* Copy pixels of RenderTexture to Texture */
|
||||
RenderTexture.active = renderTexture;
|
||||
texture.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);
|
||||
texture.Apply();
|
||||
/* Check pixel color */
|
||||
var color = texture.GetPixel(0, 0);
|
||||
bool ret = (color.r == 1.0f) && (color.g == 1.0f) && (color.b == 1.0f);
|
||||
|
||||
/* Reset current active RenderTexture */
|
||||
RenderTexture.active = current;
|
||||
|
||||
/* Cleaning */
|
||||
Material.Destroy(material);
|
||||
Texture2D.Destroy(texture);
|
||||
Texture2D.Destroy(renderTexture);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#region DLL Import
|
||||
#if !CRIWARE_ENABLE_HEADLESS_MODE
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern bool criManaUnity_IsMediaCodecSupported_ANDROID(int device_type);
|
||||
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern System.UInt32 criManaUnity_MediaCodecCreateTexture_ANDROID();
|
||||
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern void criManaUnity_MediaCodecDeleteTexture_ANDROID(System.UInt32 oes_texture);
|
||||
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern bool criManaUnityPlayer_MediaCodecAttachTexture_ANDROID(int player_id, System.UInt32 oes_texture);
|
||||
|
||||
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
|
||||
private static extern void criManaUnityPlayer_MediaCodecDetachTexture_ANDROID(int player_id, System.UInt32 oes_texture);
|
||||
#else
|
||||
private static bool criManaUnity_IsMediaCodecSupported_ANDROID(int device_type) { return true; }
|
||||
private static System.UInt32 criManaUnity_MediaCodecCreateTexture_ANDROID() { return 0x0; }
|
||||
private static void criManaUnity_MediaCodecDeleteTexture_ANDROID(System.UInt32 oes_texture) { }
|
||||
private static bool criManaUnityPlayer_MediaCodecAttachTexture_ANDROID(int player_id, System.UInt32 oes_texture) { return true; }
|
||||
private static void criManaUnityPlayer_MediaCodecDetachTexture_ANDROID(int player_id, System.UInt32 oes_texture) { }
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d3185896891e4109a5d1e0802757b9e
|
||||
timeCreated: 1445063317
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-341
@@ -1,341 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015-2018 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !UNITY_EDITOR && UNITY_ANDROID
|
||||
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriMana.Detail
|
||||
{
|
||||
public static partial class AutoResisterRendererResourceFactories
|
||||
{
|
||||
[RendererResourceFactoryPriority(5050)]
|
||||
public class RendererResourceFactoryAndroidSofdecPrimeYuv : RendererResourceFactory
|
||||
{
|
||||
public override RendererResource CreateRendererResource(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
bool isCodecSuitable = movieInfo.codecType == CodecType.SofdecPrime ||
|
||||
movieInfo.codecType == CodecType.VP9 ||
|
||||
(CriManaPlugin.criManaUnity_IsBufferOutputForH264Enabled_ANDROID() && movieInfo.codecType == CodecType.H264);
|
||||
bool isGraphicsApiSuitable = (UnityEngine.SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES3);
|
||||
bool isSuitable = isCodecSuitable && isGraphicsApiSuitable;
|
||||
return isSuitable
|
||||
? new RendererResourceAndroidSofdecPrimeYuv(playerId, movieInfo, additive, userShader)
|
||||
: null;
|
||||
}
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class RendererResourceAndroidSofdecPrimeYuv : RendererResource
|
||||
{
|
||||
private int width, height;
|
||||
private int chromaWidth, chromaHeight;
|
||||
private int alphaWidth, alphaHeight;
|
||||
private bool useUserShader;
|
||||
private CodecType codecType;
|
||||
|
||||
private const TextureFormat format = TextureFormat.R8;
|
||||
private const TextureFormat formatUV = TextureFormat.RG16;
|
||||
|
||||
private Vector4 movieTextureST = Vector4.zero;
|
||||
private Vector4 movieChromaTextureST = Vector4.zero;
|
||||
private Vector4 movieAlphaTextureST = Vector4.zero;
|
||||
|
||||
private Texture2D[] textures;
|
||||
private int numImages = -1;
|
||||
private int numImagesForYUV = -1;
|
||||
System.IntPtr[] nativePtrs = new System.IntPtr[4];
|
||||
private RenderTexture[] renderTextures;
|
||||
|
||||
private Int32 playerID;
|
||||
private bool areTexturesUpdated = false;
|
||||
private bool isFrameUpdated = false;
|
||||
private bool isStoppingForSeek = false;
|
||||
private bool isStartTriggered = true;
|
||||
|
||||
|
||||
public RendererResourceAndroidSofdecPrimeYuv(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
CalculateTextureSize(ref width, ref height, (int)movieInfo.width, (int)movieInfo.height, movieInfo.codecType, false);
|
||||
CalculateTextureSize(ref chromaWidth, ref chromaHeight, (int)movieInfo.width, (int)movieInfo.height, movieInfo.codecType, true);
|
||||
|
||||
this.additive = additive;
|
||||
hasAlpha = movieInfo.hasAlpha;
|
||||
useUserShader = userShader != null;
|
||||
codecType = movieInfo.codecType;
|
||||
|
||||
if (userShader != null) {
|
||||
shader = userShader;
|
||||
} else {
|
||||
string shaderName = "CriMana/AndroidSofdecPrimeYuv";
|
||||
shader = Shader.Find(shaderName);
|
||||
}
|
||||
|
||||
if (hasAlpha) {
|
||||
CalculateTextureSize(ref alphaWidth, ref alphaHeight, (int)movieInfo.width, (int)movieInfo.height, movieInfo.alphaCodecType, false);
|
||||
}
|
||||
|
||||
UpdateMovieTextureST(movieInfo.dispWidth, movieInfo.dispHeight);
|
||||
|
||||
nativePtrs = new IntPtr[4];
|
||||
playerID = playerId;
|
||||
}
|
||||
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
DisposeTextures(textures);
|
||||
DisposeTextures(renderTextures);
|
||||
|
||||
textures = null;
|
||||
renderTextures = null;
|
||||
}
|
||||
|
||||
|
||||
public override bool IsPrepared()
|
||||
{
|
||||
return areTexturesUpdated && isFrameUpdated;
|
||||
}
|
||||
|
||||
|
||||
public override bool ContinuePreparing()
|
||||
{ return true; }
|
||||
|
||||
|
||||
public override bool IsSuitable(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
CalculateTextureSize(ref w, ref h, (int)movieInfo.width, (int)movieInfo.height, movieInfo.codecType, false);
|
||||
bool isCodecSuitable = movieInfo.codecType == codecType;
|
||||
bool isSizeSuitable = (width == w) && (height == h);
|
||||
bool isAlphaSuitable = hasAlpha == movieInfo.hasAlpha;
|
||||
bool isAdditiveSuitable = this.additive == additive;
|
||||
bool isShaderSuitable = this.useUserShader ? (userShader == shader) : true;
|
||||
return isCodecSuitable && isSizeSuitable && isAlphaSuitable && isAdditiveSuitable && isShaderSuitable;
|
||||
}
|
||||
|
||||
|
||||
public override bool OnPlayerStopForSeek()
|
||||
{
|
||||
isStoppingForSeek = true;
|
||||
isStartTriggered = false;
|
||||
|
||||
if (renderTextures != null || textures == null || textures[0] == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
renderTextures = new RenderTexture[hasAlpha ? 4 : 3];
|
||||
|
||||
for (int i = 0; i < renderTextures.Length; i++) {
|
||||
Texture2D baseTexture = textures[i];
|
||||
RenderTexture texture = new RenderTexture(baseTexture.width, baseTexture.height, 0, RenderTextureFormat.R8);
|
||||
texture.Create();
|
||||
|
||||
Graphics.Blit(baseTexture, texture);
|
||||
renderTextures[i] = texture;
|
||||
}
|
||||
|
||||
forceUpdateMaterialTextures(renderTextures);
|
||||
|
||||
DisposeTextures(textures);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override void OnPlayerStart() {
|
||||
isStartTriggered = true;
|
||||
}
|
||||
|
||||
|
||||
private void forceUpdateMaterialTextures(Texture[] newTextures) {
|
||||
if (currentMaterial != null) {
|
||||
currentMaterial.SetTexture("_TextureY", newTextures[0]);
|
||||
currentMaterial.SetTexture("_TextureU", newTextures[1]);
|
||||
currentMaterial.SetTexture("_TextureV", newTextures[2]);
|
||||
if (hasAlpha) {
|
||||
currentMaterial.SetTexture("_TextureA", newTextures[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void AttachToPlayer(int playerId)
|
||||
{
|
||||
DisposeTextures(textures);
|
||||
areTexturesUpdated = false;
|
||||
isFrameUpdated = false;
|
||||
}
|
||||
|
||||
|
||||
public override bool UpdateFrame(int playerId, FrameInfo frameInfo, ref bool frameDrop)
|
||||
{
|
||||
bool updated = CRIWARE9061FF01(playerId, 4, null, frameInfo, ref frameDrop);
|
||||
if (updated && !frameDrop) {
|
||||
UpdateMovieTextureST(frameInfo.dispWidth, frameInfo.dispHeight);
|
||||
}
|
||||
isFrameUpdated |= updated;
|
||||
if (isFrameUpdated) {
|
||||
numImages = (int)frameInfo.numImages;
|
||||
numImagesForYUV = hasAlpha ? numImages - 1 : numImages;
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
||||
|
||||
public override bool UpdateMaterial(Material material)
|
||||
{
|
||||
if (areTexturesUpdated) {
|
||||
if (textures != null && textures[0] != null) {
|
||||
if (currentMaterial != material) {
|
||||
currentMaterial = material;
|
||||
SetupStaticMaterialProperties();
|
||||
|
||||
if (numImagesForYUV == 3) {
|
||||
material.DisableKeyword("CRI_UV_FORMAT");
|
||||
} else {
|
||||
material.EnableKeyword("CRI_UV_FORMAT");
|
||||
}
|
||||
}
|
||||
material.SetVector("_MovieTexture_ST", movieTextureST);
|
||||
material.SetVector("_MovieChromaTexture_ST", movieChromaTextureST);
|
||||
|
||||
if (!isStoppingForSeek) {
|
||||
material.SetTexture("_TextureY", textures[0]);
|
||||
if (numImagesForYUV == 3) {
|
||||
material.SetTexture("_TextureU", textures[1]);
|
||||
material.SetTexture("_TextureV", textures[2]);
|
||||
} else {
|
||||
material.SetTexture("_TextureUV", textures[1]);
|
||||
}
|
||||
if (hasAlpha) {
|
||||
material.SetVector("_MovieAlphaTexture_ST", movieAlphaTextureST);
|
||||
material.SetTexture("_TextureA", textures[numImages - 1]);
|
||||
}
|
||||
DisposeTextures(renderTextures);
|
||||
renderTextures = null;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return renderTextures != null;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateMovieTextureST(System.UInt32 dispWidth, System.UInt32 dispHeight)
|
||||
{
|
||||
float uScale = (dispWidth != width) ? (float)(dispWidth - 1) / width : 1.0f;
|
||||
float vScale = (dispHeight != height) ? (float)(dispHeight - 1) / height : 1.0f;
|
||||
movieTextureST.x = uScale;
|
||||
movieTextureST.y = -vScale;
|
||||
movieTextureST.z = 0.0f;
|
||||
movieTextureST.w = vScale;
|
||||
|
||||
uScale = (dispWidth != chromaWidth * 2) ? (float)(dispWidth / 2 - 1) / (chromaWidth * 2) * 2 : 1.0f;
|
||||
vScale = (dispHeight != chromaHeight * 2) ? (float)(dispHeight / 2 - 1) / (chromaHeight * 2) * 2 : 1.0f;
|
||||
movieChromaTextureST.x = uScale;
|
||||
movieChromaTextureST.y = -vScale;
|
||||
movieChromaTextureST.z = 0.0f;
|
||||
movieChromaTextureST.w = vScale;
|
||||
|
||||
if (hasAlpha) {
|
||||
uScale = (dispWidth != alphaWidth) ? (float)(dispWidth - 1) / alphaWidth : 1.0f;
|
||||
vScale = (dispHeight != alphaHeight) ? (float)(dispHeight - 1) / alphaHeight : 1.0f;
|
||||
movieAlphaTextureST.x = uScale;
|
||||
movieAlphaTextureST.y = -vScale;
|
||||
movieAlphaTextureST.z = 0.0f;
|
||||
movieAlphaTextureST.w = vScale;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateTextures()
|
||||
{
|
||||
nativePtrs[0] = System.IntPtr.Zero;
|
||||
bool updated = CRIWAREDA63C3D7(playerID, numImages, nativePtrs);
|
||||
areTexturesUpdated |= updated;
|
||||
|
||||
if (updated && nativePtrs[0] != System.IntPtr.Zero && isStartTriggered) {
|
||||
if (textures == null || textures[0] == null) {
|
||||
textures = new Texture2D[numImages];
|
||||
textures[0] = Texture2D.CreateExternalTexture(width, height, format, false, false, nativePtrs[0]);
|
||||
textures[0].wrapMode = TextureWrapMode.Clamp;
|
||||
if (numImagesForYUV == 3) { /* Y/U/V */
|
||||
textures[1] = Texture2D.CreateExternalTexture(chromaWidth, chromaHeight, format, false, false, nativePtrs[1]);
|
||||
textures[1].wrapMode = TextureWrapMode.Clamp;
|
||||
textures[2] = Texture2D.CreateExternalTexture(chromaWidth, chromaHeight, format, false, false, nativePtrs[2]);
|
||||
textures[2].wrapMode = TextureWrapMode.Clamp;
|
||||
} else { /* Y/UV */
|
||||
textures[1] = Texture2D.CreateExternalTexture(chromaWidth, chromaHeight, formatUV, false, false, nativePtrs[1]);
|
||||
textures[1].wrapMode = TextureWrapMode.Clamp;
|
||||
}
|
||||
if (hasAlpha) {
|
||||
textures[numImages - 1] = Texture2D.CreateExternalTexture(alphaWidth, alphaHeight, format, false, false, nativePtrs[numImages - 1]);
|
||||
textures[numImages - 1].wrapMode = TextureWrapMode.Clamp;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < numImages; i++) {
|
||||
textures[i].UpdateExternalTexture(nativePtrs[i]);
|
||||
}
|
||||
}
|
||||
isStoppingForSeek = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void CalculateTextureSize(ref int w, ref int h, int videoWidth, int videoHeight, CodecType type, bool isChroma)
|
||||
{
|
||||
if (type == CodecType.SofdecPrime) {
|
||||
if (!isChroma) {
|
||||
w = Ceiling32(Ceiling16(CeilingWith(videoWidth, 8)));
|
||||
h = CeilingWith(videoHeight, 8);
|
||||
} else {
|
||||
w = Ceiling32(Ceiling16(CeilingWith(videoWidth, 8)) / 2);
|
||||
h = CeilingWith(videoHeight, 8) / 2;
|
||||
}
|
||||
|
||||
} else if (type == CodecType.VP9) {
|
||||
if (!isChroma) {
|
||||
w = CeilingWith(CeilingWith(videoWidth, 2), 8);
|
||||
h = CeilingWith(videoHeight, 2);
|
||||
} else {
|
||||
w = CeilingWith(CeilingWith(videoWidth, 2) / 2, 8);
|
||||
h = CeilingWith(videoHeight, 2) / 2;
|
||||
}
|
||||
} else if (type == CodecType.H264) {
|
||||
if (!isChroma) {
|
||||
w = Ceiling16(Ceiling16(CeilingWith(videoWidth, 8)));
|
||||
h = CeilingWith(videoHeight, 8);
|
||||
} else {
|
||||
w = Ceiling16(Ceiling16(CeilingWith(videoWidth, 8)) / 2);
|
||||
h = CeilingWith(videoHeight, 8) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // class
|
||||
} // namespace
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c1b5bfeca611e446ad85bec1af765ec
|
||||
timeCreated: 1504693376
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-303
@@ -1,303 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 CRI Middleware Co., Ltd.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !UNITY_EDITOR && UNITY_ANDROID
|
||||
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace CriWare {
|
||||
|
||||
namespace CriMana.Detail
|
||||
{
|
||||
public static partial class AutoResisterRendererResourceFactories
|
||||
{
|
||||
[RendererResourceFactoryPriority(5060)]
|
||||
public class RendererResourceFactoryAndroidSofdecPrimeYuvLegacyGles2 : RendererResourceFactory
|
||||
{
|
||||
public override RendererResource CreateRendererResource(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
bool isCodecSuitable = movieInfo.codecType == CodecType.SofdecPrime || movieInfo.codecType == CodecType.VP9 ||
|
||||
(CriManaPlugin.criManaUnity_IsBufferOutputForH264Enabled_ANDROID() && movieInfo.codecType == CodecType.H264);
|
||||
bool isGraphicsApiSuitable = (UnityEngine.SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2 ||
|
||||
UnityEngine.SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Vulkan);
|
||||
bool isSuitable = isCodecSuitable && isGraphicsApiSuitable;
|
||||
return isSuitable
|
||||
? new RendererResourceAndroidSofdecPrimeYuvLegacyGles2(playerId, movieInfo, additive, userShader)
|
||||
: null;
|
||||
}
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class RendererResourceAndroidSofdecPrimeYuvLegacyGles2 : RendererResource
|
||||
{
|
||||
private int width, height;
|
||||
private int chromaWidth, chromaHeight;
|
||||
private int alphaWidth, alphaHeight;
|
||||
private bool useUserShader;
|
||||
CodecType codecType;
|
||||
|
||||
private int movieWidth, movieHeight;
|
||||
|
||||
private const TextureFormat format = TextureFormat.Alpha8;
|
||||
private const TextureFormat formatUV = TextureFormat.RG16;
|
||||
|
||||
private Vector4 movieTextureST = Vector4.zero;
|
||||
private Vector4 movieChromaTextureST = Vector4.zero;
|
||||
private Vector4 movieAlphaTextureST = Vector4.zero;
|
||||
|
||||
private Texture2D[][] textures;
|
||||
private RenderTexture[] renderTextures;
|
||||
private IntPtr[][] nativeTextures;
|
||||
private int numImages = -1;
|
||||
private int numImagesForYUV = -1;
|
||||
|
||||
private Int32 numTextureSets = 2;
|
||||
private Int32 currentTextureSet = 0;
|
||||
private Int32 drawTextureSet = -1;
|
||||
private Int32 playerID;
|
||||
private bool isStoppingForSeek = false;
|
||||
|
||||
public RendererResourceAndroidSofdecPrimeYuvLegacyGles2(int playerId, MovieInfo movieInfo, bool additive, Shader userShader)
|
||||
{
|
||||
hasAlpha = movieInfo.hasAlpha;
|
||||
this.additive = additive;
|
||||
useUserShader = userShader != null;
|
||||
|
||||
movieWidth = (int)movieInfo.width;
|
||||
movieHeight = (int)movieInfo.height;
|
||||
|
||||
if (userShader != null) {
|
||||
shader = userShader;
|
||||
} else {
|
||||
string shaderName = "CriMana/AndroidSofdecPrimeYuvLegacy";
|
||||
shader = Shader.Find(shaderName);
|
||||
}
|
||||
|
||||
textures = new Texture2D[numTextureSets][];
|
||||
for (int i = 0; i < numTextureSets; i++) {
|
||||
textures[i] = new Texture2D[4];
|
||||
for (int j = 0; j < 4; j++) {
|
||||
textures[i][j] = null;
|
||||
}
|
||||
}
|
||||
nativeTextures = new IntPtr[numTextureSets][];
|
||||
|
||||
for (int i = 0; i < numTextureSets; i++) {
|
||||
nativeTextures[i] = new IntPtr[4];
|
||||
for (int j = 0; j < 4; j++) {
|
||||
nativeTextures[i][j] = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
codecType = movieInfo.codecType;
|
||||
playerID = playerId;
|
||||
}
|
||||
|
||||
|
||||
protected override void OnDisposeManaged()
|
||||
{}
|
||||
|
||||
|
||||
protected override void OnDisposeUnmanaged()
|
||||
{
|
||||
CRIWARE2676F2A5(playerID, 0 ,null);
|
||||
|
||||
for (int i = 0; i < numTextureSets; i++) {
|
||||
DisposeTextures(textures[i]);
|
||||
}
|
||||
textures = null;
|
||||
nativeTextures = null;
|
||||
}
|
||||
|
||||
public override bool IsPrepared()
|
||||
{ return true; }
|
||||
|
||||
|
||||
public override bool ContinuePreparing()
|
||||
{ return true; }
|
||||
|
||||
|
||||
public override bool IsSuitable(int playerId, MovieInfo movieInfo, bool additive, Shader userShader) {
|
||||
bool isCodecSuitable = movieInfo.codecType == codecType;
|
||||
bool isSizeSuitable = (movieWidth == (int)movieInfo.width) && (movieHeight == (int)movieInfo.height);
|
||||
bool isAlphaSuitable = hasAlpha == movieInfo.hasAlpha;
|
||||
bool isAdditiveSuitable = this.additive == additive;
|
||||
bool isShaderSuitable = this.useUserShader ? (userShader == shader) : true;
|
||||
return isCodecSuitable && isSizeSuitable && isAlphaSuitable && isAdditiveSuitable && isShaderSuitable;
|
||||
}
|
||||
|
||||
|
||||
public override bool OnPlayerStopForSeek() {
|
||||
isStoppingForSeek = (drawTextureSet >= 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AttachToPlayer(int playerId) {
|
||||
CRIWARE71A23DE1(playerID, 0, new IntPtr[1]);
|
||||
drawTextureSet = -1;
|
||||
}
|
||||
|
||||
public override bool UpdateFrame(int playerId, FrameInfo frameInfo, ref bool frameDrop) {
|
||||
bool isFrameUpdated = CRIWARE9061FF01(playerId, 0, null, frameInfo, ref frameDrop);
|
||||
if (isFrameUpdated && !frameDrop) {
|
||||
drawTextureSet = currentTextureSet;
|
||||
currentTextureSet = (currentTextureSet + 1) % numTextureSets;
|
||||
isStoppingForSeek = false;
|
||||
}
|
||||
|
||||
if (isFrameUpdated && textures[0][0] == null) {
|
||||
numImages = (int)frameInfo.numImages;
|
||||
numImagesForYUV = hasAlpha ? numImages - 1 : numImages;
|
||||
|
||||
CalculateTextureSize(ref width, ref height, (int)frameInfo.width, (int)frameInfo.height, codecType, false);
|
||||
CalculateTextureSize(ref chromaWidth, ref chromaHeight, (int)frameInfo.width, (int)frameInfo.height, codecType, true);
|
||||
if (hasAlpha) {
|
||||
CalculateTextureSize(ref alphaWidth, ref alphaHeight, (int)frameInfo.width, (int)frameInfo.height, CodecType.SofdecPrime, false);
|
||||
}
|
||||
UpdateMovieTextureST(frameInfo.dispWidth, frameInfo.dispHeight);
|
||||
|
||||
for (int i = 0; i < numTextureSets; i++) {
|
||||
textures[i][0] = new Texture2D(width, height, format, false, true);
|
||||
textures[i][0].wrapMode = TextureWrapMode.Clamp;
|
||||
if (numImagesForYUV == 3) {
|
||||
textures[i][1] = new Texture2D(chromaWidth, chromaHeight, format, false, true);
|
||||
textures[i][1].wrapMode = TextureWrapMode.Clamp;
|
||||
textures[i][2] = new Texture2D(chromaWidth, chromaHeight, format, false, true);
|
||||
textures[i][2].wrapMode = TextureWrapMode.Clamp;
|
||||
} else {
|
||||
textures[i][1] = new Texture2D(chromaWidth, chromaHeight, formatUV, false, true);
|
||||
textures[i][1].wrapMode = TextureWrapMode.Clamp;
|
||||
}
|
||||
for (int j = 0; j < numImagesForYUV; j++) {
|
||||
nativeTextures[i][j] = textures[i][j].GetNativeTexturePtr();
|
||||
}
|
||||
if (hasAlpha) {
|
||||
textures[i][numImages - 1] = new Texture2D(alphaWidth, alphaHeight, format, false, true);
|
||||
textures[i][numImages - 1].wrapMode = TextureWrapMode.Clamp;
|
||||
nativeTextures[i][numImages - 1] = textures[i][numImages - 1].GetNativeTexturePtr();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isFrameUpdated;
|
||||
}
|
||||
|
||||
public override bool UpdateMaterial(Material material) {
|
||||
if (isStoppingForSeek)
|
||||
return true;
|
||||
|
||||
if (drawTextureSet < 0)
|
||||
return false;
|
||||
|
||||
if (currentMaterial != material) {
|
||||
currentMaterial = material;
|
||||
SetupStaticMaterialProperties();
|
||||
|
||||
if (numImagesForYUV == 3) {
|
||||
material.DisableKeyword("CRI_UV_FORMAT");
|
||||
} else {
|
||||
material.EnableKeyword("CRI_UV_FORMAT");
|
||||
}
|
||||
}
|
||||
material.SetVector("_MovieTexture_ST", movieTextureST);
|
||||
material.SetVector("_MovieChromaTexture_ST", movieChromaTextureST);
|
||||
|
||||
material.SetTexture("_TextureY", textures[drawTextureSet][0]);
|
||||
if (numImagesForYUV == 3) {
|
||||
material.SetTexture("_TextureU", textures[drawTextureSet][1]);
|
||||
material.SetTexture("_TextureV", textures[drawTextureSet][2]);
|
||||
} else {
|
||||
material.SetTexture("_TextureUV", textures[drawTextureSet][1]);
|
||||
}
|
||||
if (hasAlpha) {
|
||||
material.SetVector("_MovieAlphaTexture_ST", movieAlphaTextureST);
|
||||
material.SetTexture("_TextureA", textures[drawTextureSet][numImages - 1]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void UpdateMovieTextureST(System.UInt32 dispWidth, System.UInt32 dispHeight) {
|
||||
float uScale = (dispWidth != width) ? (float)(dispWidth - 1) / width : 1.0f;
|
||||
float vScale = (dispHeight != height) ? (float)(dispHeight - 1) / height : 1.0f;
|
||||
movieTextureST.x = uScale;
|
||||
movieTextureST.y = -vScale;
|
||||
movieTextureST.z = 0.0f;
|
||||
movieTextureST.w = vScale;
|
||||
|
||||
uScale = (dispWidth != chromaWidth * 2) ?
|
||||
(float)(dispWidth / 2 - 1) / (chromaWidth * 2) * 2 :
|
||||
1.0f;
|
||||
vScale = (dispHeight != chromaHeight * 2) ?
|
||||
(float)(dispHeight / 2 - 1) / (chromaHeight * 2) * 2 :
|
||||
1.0f;
|
||||
movieChromaTextureST.x = uScale;
|
||||
movieChromaTextureST.y = -vScale;
|
||||
movieChromaTextureST.z = 0.0f;
|
||||
movieChromaTextureST.w = vScale;
|
||||
|
||||
if (hasAlpha) {
|
||||
uScale = (dispWidth != alphaWidth) ? (float)(dispWidth - 1) / alphaWidth : 1.0f;
|
||||
vScale = (dispHeight != alphaHeight) ? (float)(dispHeight - 1) / alphaHeight : 1.0f;
|
||||
movieAlphaTextureST.x = uScale;
|
||||
movieAlphaTextureST.y = -vScale;
|
||||
movieAlphaTextureST.z = 0.0f;
|
||||
movieAlphaTextureST.w = vScale;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateTextures()
|
||||
{
|
||||
if (drawTextureSet < 0)
|
||||
return;
|
||||
|
||||
CRIWAREDA63C3D7(playerID, numImages, nativeTextures[drawTextureSet]);
|
||||
}
|
||||
|
||||
private static void CalculateTextureSize(ref int w, ref int h, int videoWidth, int videoHeight, CodecType type, bool isChroma) {
|
||||
if (type == CodecType.SofdecPrime) {
|
||||
if (!isChroma) {
|
||||
w = Ceiling32(Ceiling16(CeilingWith(videoWidth, 8)));
|
||||
h = CeilingWith(videoHeight, 8);
|
||||
} else {
|
||||
w = Ceiling32(Ceiling16(CeilingWith(videoWidth, 8)) / 2);
|
||||
h = CeilingWith(videoHeight, 8) / 2;
|
||||
}
|
||||
|
||||
} else if (type == CodecType.VP9) {
|
||||
if (!isChroma) {
|
||||
w = CeilingWith(CeilingWith(videoWidth, 2), 8);
|
||||
h = CeilingWith(CeilingWith(videoHeight, 2), 8);
|
||||
} else {
|
||||
w = CeilingWith(CeilingWith(videoWidth, 2) / 2, 8);
|
||||
h = CeilingWith(CeilingWith(videoHeight, 2) / 2, 8);
|
||||
}
|
||||
} else if (type == CodecType.H264) {
|
||||
if (!isChroma) {
|
||||
w = videoWidth;
|
||||
h = videoHeight;
|
||||
} else {
|
||||
w = videoWidth / 2;
|
||||
h = videoHeight / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace CriWare
|
||||
|
||||
#endif
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0278ee25c85693943bd37be41852fa52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4a7bb2022b729345931dc907d6ab8a5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ecbb7559c822d94e9e5864caa40b65f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc89c6c3bcab4e148b1f6396cb7fd89f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
Shader "CriMana/AndroidH264Rgb"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[HideInInspector] _MovieTexture_ST ("MovieTexture_ST", Vector) = (1.0, 1.0, 0, 0)
|
||||
[HideInInspector] _AlphaTexture_ST("AlphaTexture_ST", Vector) = (1.0, 1.0, 0, 0)
|
||||
[HideInInspector] _TextureRGB ("TextureRGB", 2D) = "white" {}
|
||||
[HideInInspector] _TextureA ("TextureA", 2D) = "white" {}
|
||||
[HideInInspector] _SrcBlendMode ("SrcBlendMode", Int) = 0
|
||||
[HideInInspector] _DstBlendMode ("DstBlendMode", Int) = 0
|
||||
[HideInInspector] _CullMode("CullMode", Int) = 2
|
||||
[HideInInspector] _ZWriteMode("ZWriteMode", Int) = 1
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_SrcBlendMode] [_DstBlendMode]
|
||||
Cull [_CullMode]
|
||||
ZWrite [_ZWriteMode]
|
||||
ZTest [unity_GUIZTestMode]
|
||||
|
||||
GLSLPROGRAM
|
||||
#version 100 // this will be converted to 300 es when using OpenGLES3
|
||||
#pragma multi_compile _ CRI_ALPHA_MOVIE
|
||||
#pragma multi_compile _ CRI_APPLY_TARGET_ALPHA
|
||||
#pragma multi_compile _ CRI_LINEAR_COLORSPACE
|
||||
#ifdef VERTEX
|
||||
attribute vec4 _glesVertex;
|
||||
attribute vec4 _glesMultiTexCoord0;
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
attribute vec4 _glesColor;
|
||||
varying lowp float alpha;
|
||||
#endif
|
||||
uniform highp vec4 _MainTex_ST;
|
||||
uniform highp vec4 _MovieTexture_ST;
|
||||
varying mediump vec2 xlv_TEXCOORD0;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
uniform highp vec4 _AlphaTexture_ST;
|
||||
varying mediump vec2 xlv_TEXCOORD1;
|
||||
#endif
|
||||
void main ()
|
||||
{
|
||||
highp vec4 tmpvar;
|
||||
tmpvar.w = 1.0;
|
||||
tmpvar.xyz = _glesVertex.xyz;
|
||||
gl_Position = (unity_MatrixVP * (unity_ObjectToWorld * tmpvar)); // UnityObjectToClipPos(*)
|
||||
xlv_TEXCOORD0 = (((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw) * _MovieTexture_ST.xy) + _MovieTexture_ST.zw;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
xlv_TEXCOORD1 = (((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw) * _AlphaTexture_ST.xy) + _AlphaTexture_ST.zw;
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
alpha = _glesColor.w;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef FRAGMENT
|
||||
#extension GL_OES_EGL_image_external : enable
|
||||
#extension GL_OES_EGL_image_external_essl3 : enable
|
||||
#if (defined(SHADER_API_GLES3) && defined(GL_OES_EGL_image_external_essl3)) || defined(GL_OES_EGL_image_external) && !defined(SHADER_API_GLCORE)
|
||||
uniform samplerExternalOES _TextureRGB;
|
||||
#else
|
||||
uniform sampler2D _TextureRGB;
|
||||
#endif
|
||||
varying mediump vec2 xlv_TEXCOORD0;
|
||||
uniform lowp float _Transparency;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
uniform sampler2D _TextureA;
|
||||
varying mediump vec2 xlv_TEXCOORD1;
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
varying lowp float alpha;
|
||||
#endif
|
||||
void main ()
|
||||
{
|
||||
#if (defined(SHADER_API_GLES3) && defined(GL_OES_EGL_image_external_essl3)) || defined(GL_OES_EGL_image_external) && !defined(SHADER_API_GLCORE)
|
||||
gl_FragData[0] = texture2D(_TextureRGB, xlv_TEXCOORD0);
|
||||
#else
|
||||
gl_FragData[0].x = gl_FragData[0].y = gl_FragData[0].z = 0.0f;
|
||||
#endif
|
||||
#ifdef CRI_LINEAR_COLORSPACE
|
||||
gl_FragData[0].x = pow(max(gl_FragData[0].x, 0.001), 2.2);
|
||||
gl_FragData[0].y = pow(max(gl_FragData[0].y, 0.001), 2.2);
|
||||
gl_FragData[0].z = pow(max(gl_FragData[0].z, 0.001), 2.2);
|
||||
#endif
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
gl_FragData[0].w = texture2D(_TextureA, xlv_TEXCOORD1).x;
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
gl_FragData[0].w *= alpha;
|
||||
#endif
|
||||
gl_FragData[0].w *= 1.0 - _Transparency;
|
||||
}
|
||||
#endif
|
||||
ENDGLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01205c74879764ae9b7e3fe90473f53f
|
||||
timeCreated: 1445063687
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
Shader "CriMana/AndroidH264DummySupportCheck"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
ZTest Always
|
||||
Cull Off
|
||||
Zwrite Off
|
||||
Blend One Zero
|
||||
|
||||
GLSLPROGRAM
|
||||
#version 100 // this will be converted to 300 es when using OpenGLES3
|
||||
#ifdef VERTEX
|
||||
attribute vec4 _glesVertex;
|
||||
void main()
|
||||
{
|
||||
highp vec4 tmpvar;
|
||||
tmpvar.w = 1.0;
|
||||
tmpvar.xyz = _glesVertex.xyz;
|
||||
gl_Position = (unity_MatrixVP * (unity_ObjectToWorld * tmpvar)); // UnityObjectToClipPos(*)
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef FRAGMENT
|
||||
#extension GL_OES_EGL_image_external : enable
|
||||
#extension GL_OES_EGL_image_external_essl3 : enable
|
||||
void main()
|
||||
{
|
||||
#if (defined(SHADER_API_GLES3) && defined(GL_OES_EGL_image_external_essl3)) || defined(GL_OES_EGL_image_external)
|
||||
gl_FragData[0].x = gl_FragData[0].y = gl_FragData[0].z = 1.0f;
|
||||
#else
|
||||
gl_FragData[0].x = gl_FragData[0].y = gl_FragData[0].z = 0.0f;
|
||||
Dummy code for shader compilation failure.
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
ENDGLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51ee31cd511ac614ea39aa4dd7841c15
|
||||
timeCreated: 1510192307
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-144
@@ -1,144 +0,0 @@
|
||||
Shader "CriMana/AndroidSofdecPrimeYuv"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[HideInInspector] _MovieTexture_ST ("MovieTexture_ST", Vector) = (1.0, 1.0, 0, 0)
|
||||
[HideInInspector] _MovieChromaTexture_ST("MovieChromaTexture_ST", Vector) = (1.0, 1.0, 0, 0)
|
||||
[HideInInspector] _MovieAlphaTexture_ST("MovieAlphaTexture_ST", Vector) = (1.0, 1.0, 0, 0)
|
||||
[HideInInspector] _TextureY ("TextureY", 2D) = "white" {}
|
||||
[HideInInspector] _TextureU ("TextureU", 2D) = "white" {}
|
||||
[HideInInspector] _TextureV ("TextureV", 2D) = "white" {}
|
||||
[HideInInspector] _TextureUV ("TextureUV", 2D) = "white" {}
|
||||
[HideInInspector] _TextureA ("TextureA", 2D) = "white" {}
|
||||
[HideInInspector] _SrcBlendMode ("SrcBlendMode", Int) = 0
|
||||
[HideInInspector] _DstBlendMode ("DstBlendMode", Int) = 0
|
||||
[HideInInspector] _CullMode("CullMode", Int) = 2
|
||||
[HideInInspector] _ZWriteMode("ZWriteMode", Int) = 1
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_SrcBlendMode] [_DstBlendMode]
|
||||
Cull [_CullMode]
|
||||
ZWrite [_ZWriteMode]
|
||||
ZTest [unity_GUIZTestMode]
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#if defined(SHADER_API_PSP2) || defined(SHADER_API_PS3)
|
||||
// seems that ARB_precision_hint_fastest is not supported on these platforms.
|
||||
#else
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
#pragma multi_compile _ CRI_UV_FORMAT
|
||||
#pragma multi_compile _ CRI_ALPHA_MOVIE
|
||||
#pragma multi_compile _ CRI_APPLY_TARGET_ALPHA
|
||||
#pragma multi_compile _ CRI_LINEAR_COLORSPACE
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
float4 color : COLOR;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
half2 uv : TEXCOORD0;
|
||||
half2 uv2 : TEXCOORD1;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
half2 uv3 : TEXCOORD2;
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
float4 color : COLOR;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
float4 _MovieTexture_ST;
|
||||
float4 _MovieChromaTexture_ST;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
float4 _MovieAlphaTexture_ST;
|
||||
#endif
|
||||
|
||||
v2f vert(appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = (TRANSFORM_TEX(v.texcoord, _MainTex) * _MovieTexture_ST.xy) + _MovieTexture_ST.zw;
|
||||
o.uv2 = (TRANSFORM_TEX(v.texcoord, _MainTex) * _MovieChromaTexture_ST.xy) + _MovieChromaTexture_ST.zw;
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
o.uv3 = (TRANSFORM_TEX(v.texcoord, _MainTex) * _MovieAlphaTexture_ST.xy) + _MovieAlphaTexture_ST.zw;
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
o.color = v.color;
|
||||
#endif
|
||||
return o;
|
||||
}
|
||||
|
||||
static const fixed3x3 yuv_to_rgb = {
|
||||
{1.16438, 0.0, 1.59603},
|
||||
{1.16438, -0.39176, -0.81297},
|
||||
{1.16438, 2.01723, 0.0}
|
||||
};
|
||||
|
||||
sampler2D _TextureY;
|
||||
#ifdef CRI_UV_FORMAT
|
||||
sampler2D _TextureUV;
|
||||
#else
|
||||
sampler2D _TextureU;
|
||||
sampler2D _TextureV;
|
||||
#endif
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
sampler2D _TextureA;
|
||||
#endif
|
||||
fixed _Transparency;
|
||||
|
||||
fixed4 frag(v2f i) : COLOR
|
||||
{
|
||||
fixed4 color;
|
||||
color.r = tex2D(_TextureY, i.uv).r;
|
||||
#ifdef CRI_UV_FORMAT
|
||||
color.g = tex2D(_TextureUV, i.uv2).r;
|
||||
color.b = tex2D(_TextureUV, i.uv2).a;
|
||||
#else
|
||||
color.g = tex2D(_TextureU, i.uv2).r;
|
||||
color.b = tex2D(_TextureV, i.uv2).r;
|
||||
#endif
|
||||
#ifdef CRI_ALPHA_MOVIE
|
||||
color.a = tex2D(_TextureA, i.uv3).r;
|
||||
#else
|
||||
color.a = 1.0;
|
||||
#endif
|
||||
color.rgb = color.rgb + fixed3(-0.06275, -0.50196, -0.50196);
|
||||
color.rgb = mul(yuv_to_rgb, color.rgb);
|
||||
#ifdef CRI_LINEAR_COLORSPACE
|
||||
color.rgb = pow(max(color.rgb, 0), 2.2);
|
||||
#endif
|
||||
#ifdef CRI_APPLY_TARGET_ALPHA
|
||||
color.a = color.a * i.color.a;
|
||||
#endif
|
||||
color.a *= 1 - _Transparency;
|
||||
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user