瀏覽代碼

【+】添加播放音频功能

lxd 5 月之前
父節點
當前提交
fc52580874

+ 53 - 0
Framework/SimulationToolDev/AnimationDriver/AnimationDriver-Example/AniDriver_PlayAudioClip.cs

@@ -0,0 +1,53 @@
+using ChivaXR;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AniDriver_PlayAudioClip : AnimationDriverBase
+{
+    public AudioClip m_AudioClip;
+
+    public override void FinishedState()
+    {
+        
+    }
+
+    public override void InitState()
+    {
+        
+    }
+
+    public override void StartPlay(Action finishedCallBack = null)
+    {
+        if (m_AudioClip == null)
+        {
+            finishedCallBack();
+        }
+        else
+        {
+            StartAniCoroutine(WaitAudioClipLength(finishedCallBack));
+        }
+    }
+
+
+    IEnumerator WaitAudioClipLength(Action finishedCallBack = null)
+    {
+        GameObject tmpObj = new GameObject();
+
+        AudioSource tmpAudioSource = tmpObj.AddComponent<AudioSource>();
+        
+        tmpAudioSource.playOnAwake = false;
+
+        tmpAudioSource.clip = m_AudioClip;
+
+        tmpAudioSource.Play();
+
+        yield return new WaitForSeconds(m_AudioClip.length);
+
+        tmpAudioSource.Stop();
+
+        finishedCallBack?.Invoke();
+    }
+
+}

+ 11 - 0
Framework/SimulationToolDev/AnimationDriver/AnimationDriver-Example/AniDriver_PlayAudioClip.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fe2e682794c07314587b420575fe1c94
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 5
OperationUIFrame/OperationUIFrameV1/Model/famen/Tex/FangShuiBu_Normal.tga.meta

@@ -1,13 +1,13 @@
 fileFormatVersion: 2
 guid: ce710c52e9d90aa4b978a7c02f06eb57
 TextureImporter:
-  fileIDToRecycleName: {}
+  internalIDToNameTable: []
   externalObjects: {}
-  serializedVersion: 9
+  serializedVersion: 11
   mipmaps:
     mipMapMode: 0
     enableMipMap: 1
-    sRGBTexture: 1
+    sRGBTexture: 0
     linearTexture: 0
     fadeOut: 0
     borderMipMap: 0
@@ -51,14 +51,15 @@ TextureImporter:
   alphaUsage: 1
   alphaIsTransparency: 0
   spriteTessellationDetail: -1
-  textureType: 0
+  textureType: 1
   textureShape: 1
   singleChannelComponent: 0
   maxTextureSizeSet: 0
   compressionQualitySet: 0
   textureFormatSet: 0
+  applyGammaDecoding: 1
   platformSettings:
-  - serializedVersion: 2
+  - serializedVersion: 3
     buildTarget: DefaultTexturePlatform
     maxTextureSize: 2048
     resizeAlgorithm: 0
@@ -69,6 +70,7 @@ TextureImporter:
     allowsAlphaSplitting: 0
     overridden: 0
     androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 1
   spriteSheet:
     serializedVersion: 2
     sprites: []
@@ -76,10 +78,12 @@ TextureImporter:
     physicsShape: []
     bones: []
     spriteID: 
+    internalID: 0
     vertices: []
     indices: 
     edges: []
     weights: []
+    secondaryTextures: []
   spritePackingTag: 
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0