2017-10-22 3 views
1

私はC#で新しくなったので、このエラーの意味を理解できません。 playVideo' does not implement interface member Vuforia.ITrackableEventHandler.OnTrackableStateChanged(Vuforia.TrackableBehaviour.Status、Vuforia.TrackableBehaviour.Status「) ここに私のコードです:`playVideo 'はインターフェイスメンバを実装していません

using System.Collections; 
using System.Collections.Generic; 
using UnityEngine; 
using UnityEngine.Video; 
using Vuforia; 

public class playVideo : MonoBehaviour, ITrackableEventHandler{ 

    public VideoClip videoToPlay; 
    public GameObject cubeObject; 
    private VideoPlayer videoPlayer; 
    private VideoSource videoSource; 
    private AudioSource audioSource; 

    public void OnTrackableStateChanged (TrackableBehaviour.Status newStatus) { 
     Debug.Log (newStatus); 
     if (newStatus == TrackableBehaviour.Status.DETECTED|| 
      newStatus == TrackableBehaviour.Status.TRACKED || 
      newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) 
     { 
      Debug.Log ("Status Changed"); 
      videoPlayer = gameObject.AddComponent<VideoPlayer>(); 
      audioSource = gameObject.AddComponent<AudioSource>(); 

      videoPlayer.playOnAwake = false; 
      audioSource.playOnAwake = false; 

      videoPlayer.source = VideoSource.VideoClip; 

      videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource; 

      videoPlayer.EnableAudioTrack (0, true); 
      videoPlayer.SetTargetAudioSource (0, audioSource); 

      videoPlayer.clip = videoToPlay; 
      videoPlayer.Prepare(); 


      videoPlayer.Play(); 
      audioSource.Play(); 
     } 
    } 
} 

答えて

0

あなたがITrackableEventHandlerインターフェイスを実装する場合、実装するための関数は、2つのパラメータではないものを取ります。

public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) 

public void OnTrackableStateChanged (TrackableBehaviour.Status newStatus) 

を交換して詳細情報をITrackableEventHandlerインタフェースsource codeを参照してください。

関連する問題