Commit 67c85389 authored by Tommé Nöll's avatar Tommé Nöll
Browse files

changed structure, added examples

parent 1c5dd9ff
%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: 614e8a5273c3faf5ca1c757762551768, type: 3}
m_Name: DifferentSong
m_EditorClassIdentifier:
targets: []
clip: {fileID: 0}
loop: 0
fileFormatVersion: 2
guid: aa99b94ea8f43f2c998a46b067410b70
MonoImporter:
guid: 144ec059eee15b6b5b5ae05f72a452ad
NativeFormatImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%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: 614e8a5273c3faf5ca1c757762551768, type: 3}
m_Name: Tutorial
m_EditorClassIdentifier:
targets: []
clip: {fileID: 0}
loop: 0
fileFormatVersion: 2
guid: 3eb8edf3d8c19076596510947a8e59ec
MonoImporter:
guid: 29defdc3037909aeea8f424af3271eae
NativeFormatImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -55,7 +55,7 @@ public class BackgroundMusic : MonoBehaviour {
AS[current].clip = music.clip;
AS[current].PlayScheduled(exitTime);
AS[current].timeSamples = targetEntrySample;
AS[current].loop = music.loop;
AS[current].loop = music.isLoop;
currentMusic = music;
AS[1-current].SetScheduledEndTime(exitTime);
......
using UnityEngine;
using System;
[CreateAssetMenu(fileName = "MusicObject", menuName = "Music/MusicObject")]
[Serializable]
public class MusicTransitionObject {
public double exitTime, targetEntryTime;
}
[Serializable]
public class MusicTransitionTargetObject {
public MusicObject musicObject;
public MusicTransitionObject[] transitions;
}
[CreateAssetMenu(fileName = "MusicObject", menuName = "Custom/MusicObject")]
public class MusicObject : ScriptableObject {
public MusicTransitionTargetObject[] targets;
public AudioClip clip;
public bool loop = false;
[Tooltip("If not a loop, the song can be tranisitioned into any other song at its end, or from any other song at its beginning")]
public bool isLoop = false;
[Tooltip("The non-looped version if this song is looped (required), the looped version otherwise (optional).")]
public MusicTransitionTargetObject loopCounterpiece;
}
using UnityEngine;
[CreateAssetMenu(fileName = "MusicTransitionObject", menuName = "Music/MusicTransitionObject")]
public class MusicTransitionObject : ScriptableObject {
public double exitTime, targetEntryTime;
}
using UnityEngine;
[CreateAssetMenu(fileName = "MusicTransitionTargetObject", menuName = "Music/MusicTransitionTargetObject")]
public class MusicTransitionTargetObject : ScriptableObject {
public MusicObject musicObject;
public MusicTransitionObject[] transitions;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment