Compare commits
2 Commits
660a6f5d68
...
598e00c0b5
| Author | SHA1 | Date |
|---|---|---|
|
|
598e00c0b5 | |
|
|
1f4d4a7c1a |
|
|
@ -1,5 +1,5 @@
|
|||
#if UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_5 || UNITY_5_4_OR_NEWER
|
||||
#define UNITY_FEATURE_UGUI
|
||||
#define UNITY_FEATURE_UGUI
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
|
|
@ -14,367 +14,407 @@ using RenderHeads.Media.AVProVideo;
|
|||
|
||||
namespace RenderHeads.Media.AVProVideo.Demos
|
||||
{
|
||||
/// <summary>
|
||||
/// A demo of a simple video player using uGUI for display
|
||||
/// Uses two MediaPlayer components, with one displaying the current video
|
||||
/// while the other loads the next video. MediaPlayers are then swapped
|
||||
/// once the video is loaded and has a frame available for display.
|
||||
/// This gives a more seamless display than simply using a single MediaPlayer
|
||||
/// as its texture will be destroyed when it loads a new video
|
||||
/// </summary>
|
||||
public class VCR : MonoBehaviour
|
||||
{
|
||||
public MediaPlayer _mediaPlayer;
|
||||
public MediaPlayer _mediaPlayerB;
|
||||
public DisplayUGUI _mediaDisplay;
|
||||
public RectTransform _bufferedSliderRect;
|
||||
/// <summary>
|
||||
/// A demo of a simple video player using uGUI for display
|
||||
/// Uses two MediaPlayer components, with one displaying the current video
|
||||
/// while the other loads the next video. MediaPlayers are then swapped
|
||||
/// once the video is loaded and has a frame available for display.
|
||||
/// This gives a more seamless display than simply using a single MediaPlayer
|
||||
/// as its texture will be destroyed when it loads a new video
|
||||
/// </summary>
|
||||
public class VCR : MonoBehaviour
|
||||
{
|
||||
public MediaPlayer _mediaPlayer;
|
||||
public MediaPlayer _mediaPlayerB;
|
||||
public DisplayUGUI _mediaDisplay;
|
||||
public RectTransform _bufferedSliderRect;
|
||||
|
||||
public Slider _videoSeekSlider;
|
||||
private float _setVideoSeekSliderValue;
|
||||
private bool _wasPlayingOnScrub;
|
||||
public Slider _videoSeekSlider;
|
||||
private float _setVideoSeekSliderValue;
|
||||
private bool _wasPlayingOnScrub;
|
||||
|
||||
public Slider _audioVolumeSlider;
|
||||
private float _setAudioVolumeSliderValue;
|
||||
public Slider _audioVolumeSlider;
|
||||
private float _setAudioVolumeSliderValue;
|
||||
|
||||
public Toggle _AutoStartToggle;
|
||||
public Toggle _MuteToggle;
|
||||
public Toggle _AutoStartToggle;
|
||||
public Toggle _MuteToggle;
|
||||
|
||||
public MediaPlayer.FileLocation _location = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
|
||||
public string _folder = "AVProVideoDemos/";
|
||||
public string[] _videoFiles = { "BigBuckBunny_720p30.mp4", "SampleSphere.mp4" };
|
||||
public MediaPlayer.FileLocation _location = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
|
||||
public string _folder = "AVProVideoDemos/";
|
||||
public string[] _videoFiles = { "BigBuckBunny_720p30.mp4", "SampleSphere.mp4" };
|
||||
|
||||
private int _VideoIndex = 0;
|
||||
private Image _bufferedSliderImage;
|
||||
private int _VideoIndex = 0;
|
||||
private Image _bufferedSliderImage;
|
||||
|
||||
private MediaPlayer _loadingPlayer;
|
||||
private MediaPlayer _loadingPlayer;
|
||||
|
||||
public MediaPlayer PlayingPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LoadingPlayer == _mediaPlayer)
|
||||
{
|
||||
return _mediaPlayerB;
|
||||
}
|
||||
return _mediaPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
public MediaPlayer LoadingPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
return _loadingPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
private void SwapPlayers()
|
||||
{
|
||||
// Pause the previously playing video
|
||||
PlayingPlayer.Control.Pause();
|
||||
public MediaPlayer PlayingPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LoadingPlayer == _mediaPlayer)
|
||||
{
|
||||
return _mediaPlayerB;
|
||||
}
|
||||
return _mediaPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
// Swap the videos
|
||||
if (LoadingPlayer == _mediaPlayer)
|
||||
{
|
||||
_loadingPlayer = _mediaPlayerB;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loadingPlayer = _mediaPlayer;
|
||||
}
|
||||
public MediaPlayer LoadingPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
return _loadingPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
// Change the displaying video
|
||||
_mediaDisplay.CurrentMediaPlayer = PlayingPlayer;
|
||||
}
|
||||
private void SwapPlayers()
|
||||
{
|
||||
// Pause the previously playing video
|
||||
PlayingPlayer.Control.Pause();
|
||||
|
||||
public void OnOpenVideoFile()
|
||||
{
|
||||
LoadingPlayer.m_VideoPath = System.IO.Path.Combine(_folder, _videoFiles[_VideoIndex]);
|
||||
_VideoIndex = (_VideoIndex + 1) % (_videoFiles.Length);
|
||||
if (string.IsNullOrEmpty(LoadingPlayer.m_VideoPath))
|
||||
{
|
||||
LoadingPlayer.CloseVideo();
|
||||
_VideoIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingPlayer.OpenVideoFromFile(_location, LoadingPlayer.m_VideoPath, _AutoStartToggle.isOn);
|
||||
// SetButtonEnabled( "PlayButton", !_mediaPlayer.m_AutoStart );
|
||||
// SetButtonEnabled( "PauseButton", _mediaPlayer.m_AutoStart );
|
||||
}
|
||||
// Swap the videos
|
||||
if (LoadingPlayer == _mediaPlayer)
|
||||
{
|
||||
_loadingPlayer = _mediaPlayerB;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loadingPlayer = _mediaPlayer;
|
||||
}
|
||||
|
||||
if (_bufferedSliderRect != null)
|
||||
{
|
||||
_bufferedSliderImage = _bufferedSliderRect.GetComponent<Image>();
|
||||
}
|
||||
}
|
||||
// Change the displaying video
|
||||
_mediaDisplay.CurrentMediaPlayer = PlayingPlayer;
|
||||
}
|
||||
|
||||
public void OnAutoStartChange()
|
||||
{
|
||||
if(PlayingPlayer &&
|
||||
_AutoStartToggle && _AutoStartToggle.enabled &&
|
||||
PlayingPlayer.m_AutoStart != _AutoStartToggle.isOn )
|
||||
{
|
||||
PlayingPlayer.m_AutoStart = _AutoStartToggle.isOn;
|
||||
}
|
||||
if (LoadingPlayer &&
|
||||
_AutoStartToggle && _AutoStartToggle.enabled &&
|
||||
LoadingPlayer.m_AutoStart != _AutoStartToggle.isOn)
|
||||
{
|
||||
LoadingPlayer.m_AutoStart = _AutoStartToggle.isOn;
|
||||
}
|
||||
}
|
||||
public void OnOpenVideoFile()
|
||||
{
|
||||
Debug.Log(System.IO.Path.Combine(_folder, _videoFiles[_VideoIndex]));
|
||||
LoadingPlayer.m_VideoPath = System.IO.Path.Combine(_folder, _videoFiles[_VideoIndex]);
|
||||
_VideoIndex = (_VideoIndex + 1) % (_videoFiles.Length);
|
||||
if (string.IsNullOrEmpty(LoadingPlayer.m_VideoPath))
|
||||
{
|
||||
LoadingPlayer.CloseVideo();
|
||||
_VideoIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingPlayer.OpenVideoFromFile(_location, LoadingPlayer.m_VideoPath, _AutoStartToggle.isOn);
|
||||
// SetButtonEnabled( "PlayButton", !_mediaPlayer.m_AutoStart );
|
||||
// SetButtonEnabled( "PauseButton", _mediaPlayer.m_AutoStart );
|
||||
}
|
||||
|
||||
public void OnMuteChange()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.MuteAudio(_MuteToggle.isOn);
|
||||
}
|
||||
if (LoadingPlayer)
|
||||
{
|
||||
LoadingPlayer.Control.MuteAudio(_MuteToggle.isOn);
|
||||
}
|
||||
}
|
||||
if (_bufferedSliderRect != null)
|
||||
{
|
||||
_bufferedSliderImage = _bufferedSliderRect.GetComponent<Image>();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPlayButton()
|
||||
{
|
||||
if(PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Play();
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", true );
|
||||
}
|
||||
}
|
||||
public void OnPauseButton()
|
||||
{
|
||||
if(PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Pause();
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
// SetButtonEnabled( "PlayButton", true );
|
||||
}
|
||||
}
|
||||
public void OnAutoStartChange()
|
||||
{
|
||||
if (PlayingPlayer &&
|
||||
_AutoStartToggle && _AutoStartToggle.enabled &&
|
||||
PlayingPlayer.m_AutoStart != _AutoStartToggle.isOn)
|
||||
{
|
||||
PlayingPlayer.m_AutoStart = _AutoStartToggle.isOn;
|
||||
}
|
||||
if (LoadingPlayer &&
|
||||
_AutoStartToggle && _AutoStartToggle.enabled &&
|
||||
LoadingPlayer.m_AutoStart != _AutoStartToggle.isOn)
|
||||
{
|
||||
LoadingPlayer.m_AutoStart = _AutoStartToggle.isOn;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnVideoSeekSlider()
|
||||
{
|
||||
if (PlayingPlayer && _videoSeekSlider && _videoSeekSlider.value != _setVideoSeekSliderValue)
|
||||
{
|
||||
PlayingPlayer.Control.Seek(_videoSeekSlider.value * PlayingPlayer.Info.GetDurationMs());
|
||||
}
|
||||
}
|
||||
public void OnMuteChange()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.MuteAudio(_MuteToggle.isOn);
|
||||
}
|
||||
if (LoadingPlayer)
|
||||
{
|
||||
LoadingPlayer.Control.MuteAudio(_MuteToggle.isOn);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnVideoSliderDown()
|
||||
{
|
||||
if(PlayingPlayer)
|
||||
{
|
||||
_wasPlayingOnScrub = PlayingPlayer.Control.IsPlaying();
|
||||
if( _wasPlayingOnScrub )
|
||||
{
|
||||
PlayingPlayer.Control.Pause();
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
// SetButtonEnabled( "PlayButton", true );
|
||||
}
|
||||
OnVideoSeekSlider();
|
||||
}
|
||||
}
|
||||
public void OnVideoSliderUp()
|
||||
{
|
||||
if(PlayingPlayer && _wasPlayingOnScrub )
|
||||
{
|
||||
PlayingPlayer.Control.Play();
|
||||
_wasPlayingOnScrub = false;
|
||||
public void OnPlayButton()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Play();
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", true );
|
||||
}
|
||||
}
|
||||
public void OnPauseButton()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Pause();
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
// SetButtonEnabled( "PlayButton", true );
|
||||
}
|
||||
}
|
||||
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", true );
|
||||
}
|
||||
}
|
||||
public void OnVideoSeekSlider()
|
||||
{
|
||||
if (PlayingPlayer && _videoSeekSlider && _videoSeekSlider.value != _setVideoSeekSliderValue)
|
||||
{
|
||||
PlayingPlayer.Control.Seek(_videoSeekSlider.value * PlayingPlayer.Info.GetDurationMs());
|
||||
}
|
||||
}
|
||||
|
||||
public void OnAudioVolumeSlider()
|
||||
{
|
||||
if (PlayingPlayer && _audioVolumeSlider && _audioVolumeSlider.value != _setAudioVolumeSliderValue)
|
||||
{
|
||||
PlayingPlayer.Control.SetVolume(_audioVolumeSlider.value);
|
||||
}
|
||||
if (LoadingPlayer && _audioVolumeSlider && _audioVolumeSlider.value != _setAudioVolumeSliderValue)
|
||||
{
|
||||
LoadingPlayer.Control.SetVolume(_audioVolumeSlider.value);
|
||||
}
|
||||
}
|
||||
// public void OnMuteAudioButton()
|
||||
// {
|
||||
// if( _mediaPlayer )
|
||||
// {
|
||||
// _mediaPlayer.Control.MuteAudio( true );
|
||||
// SetButtonEnabled( "MuteButton", false );
|
||||
// SetButtonEnabled( "UnmuteButton", true );
|
||||
// }
|
||||
// }
|
||||
// public void OnUnmuteAudioButton()
|
||||
// {
|
||||
// if( _mediaPlayer )
|
||||
// {
|
||||
// _mediaPlayer.Control.MuteAudio( false );
|
||||
// SetButtonEnabled( "UnmuteButton", false );
|
||||
// SetButtonEnabled( "MuteButton", true );
|
||||
// }
|
||||
// }
|
||||
public void OnVideoSliderDown()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
_wasPlayingOnScrub = PlayingPlayer.Control.IsPlaying();
|
||||
if (_wasPlayingOnScrub)
|
||||
{
|
||||
PlayingPlayer.Control.Pause();
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
// SetButtonEnabled( "PlayButton", true );
|
||||
}
|
||||
OnVideoSeekSlider();
|
||||
}
|
||||
}
|
||||
public void OnVideoSliderUp()
|
||||
{
|
||||
if (PlayingPlayer && _wasPlayingOnScrub)
|
||||
{
|
||||
PlayingPlayer.Control.Play();
|
||||
_wasPlayingOnScrub = false;
|
||||
|
||||
public void OnRewindButton()
|
||||
{
|
||||
if(PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Rewind();
|
||||
}
|
||||
}
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", true );
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_loadingPlayer = _mediaPlayerB;
|
||||
}
|
||||
public void OnAudioVolumeSlider()
|
||||
{
|
||||
if (PlayingPlayer && _audioVolumeSlider && _audioVolumeSlider.value != _setAudioVolumeSliderValue)
|
||||
{
|
||||
PlayingPlayer.Control.SetVolume(_audioVolumeSlider.value);
|
||||
}
|
||||
if (LoadingPlayer && _audioVolumeSlider && _audioVolumeSlider.value != _setAudioVolumeSliderValue)
|
||||
{
|
||||
LoadingPlayer.Control.SetVolume(_audioVolumeSlider.value);
|
||||
}
|
||||
}
|
||||
// public void OnMuteAudioButton()
|
||||
// {
|
||||
// if( _mediaPlayer )
|
||||
// {
|
||||
// _mediaPlayer.Control.MuteAudio( true );
|
||||
// SetButtonEnabled( "MuteButton", false );
|
||||
// SetButtonEnabled( "UnmuteButton", true );
|
||||
// }
|
||||
// }
|
||||
// public void OnUnmuteAudioButton()
|
||||
// {
|
||||
// if( _mediaPlayer )
|
||||
// {
|
||||
// _mediaPlayer.Control.MuteAudio( false );
|
||||
// SetButtonEnabled( "UnmuteButton", false );
|
||||
// SetButtonEnabled( "MuteButton", true );
|
||||
// }
|
||||
// }
|
||||
|
||||
void Start()
|
||||
{
|
||||
if(PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Events.AddListener(OnVideoEvent);
|
||||
public void OnRewindButton()
|
||||
{
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Control.Rewind();
|
||||
}
|
||||
}
|
||||
|
||||
if (LoadingPlayer)
|
||||
{
|
||||
LoadingPlayer.Events.AddListener(OnVideoEvent);
|
||||
}
|
||||
|
||||
if ( _audioVolumeSlider )
|
||||
{
|
||||
// Volume
|
||||
if (PlayingPlayer.Control != null)
|
||||
{
|
||||
float volume = PlayingPlayer.Control.GetVolume();
|
||||
_setAudioVolumeSliderValue = volume;
|
||||
_audioVolumeSlider.value = volume;
|
||||
}
|
||||
}
|
||||
public Button multiplyPlaybackBtn;
|
||||
public Button[] multiplyButtons;
|
||||
public GameObject multiplyTogglesParents;
|
||||
public bool isMultiplyOn = false;
|
||||
|
||||
// Auto start toggle
|
||||
_AutoStartToggle.isOn = PlayingPlayer.m_AutoStart;
|
||||
public void ResetPlayState()
|
||||
{
|
||||
isMultiplyOn = false;
|
||||
multiplyTogglesParents.SetActive(false);
|
||||
multiplyPlaybackBtn.transform.GetChild(0).GetComponent<Text>().text = "×1";
|
||||
}
|
||||
/// <summary>
|
||||
/// 倍数播放
|
||||
/// </summary>
|
||||
|
||||
if(PlayingPlayer.m_AutoOpen )
|
||||
{
|
||||
// RemoveOpenVideoButton();
|
||||
private void Awake()
|
||||
{
|
||||
_loadingPlayer = _mediaPlayerB;
|
||||
}
|
||||
|
||||
// SetButtonEnabled( "PlayButton", !_mediaPlayer.m_AutoStart );
|
||||
// SetButtonEnabled( "PauseButton", _mediaPlayer.m_AutoStart );
|
||||
}
|
||||
else
|
||||
{
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
multiplyPlaybackBtn.onClick.AddListener(() =>
|
||||
{
|
||||
isMultiplyOn = !isMultiplyOn;
|
||||
multiplyTogglesParents.SetActive(isMultiplyOn);
|
||||
});
|
||||
|
||||
// SetButtonEnabled( "MuteButton", !_mediaPlayer.m_Muted );
|
||||
// SetButtonEnabled( "UnmuteButton", _mediaPlayer.m_Muted );
|
||||
for (int i = 0; i < multiplyButtons.Length; i++)
|
||||
{
|
||||
int index = i;
|
||||
multiplyButtons[index].onClick.AddListener(() =>
|
||||
{
|
||||
multiplyPlaybackBtn.transform.GetChild(0).GetComponent<Text>().text = "×" + multiplyButtons[index].name;
|
||||
float temp = float.Parse(multiplyButtons[index].name);
|
||||
if (PlayingPlayer)
|
||||
PlayingPlayer.Control.SetPlaybackRate(temp);
|
||||
isMultiplyOn = false;
|
||||
multiplyTogglesParents.SetActive(false);
|
||||
});
|
||||
|
||||
OnOpenVideoFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
ResetPlayState();
|
||||
if (PlayingPlayer)
|
||||
{
|
||||
PlayingPlayer.Events.AddListener(OnVideoEvent);
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (PlayingPlayer && PlayingPlayer.Info != null && PlayingPlayer.Info.GetDurationMs() > 0f)
|
||||
{
|
||||
float time = PlayingPlayer.Control.GetCurrentTimeMs();
|
||||
float duration = PlayingPlayer.Info.GetDurationMs();
|
||||
float d = Mathf.Clamp(time / duration, 0.0f, 1.0f);
|
||||
if (LoadingPlayer)
|
||||
{
|
||||
LoadingPlayer.Events.AddListener(OnVideoEvent);
|
||||
}
|
||||
|
||||
// Debug.Log(string.Format("time: {0}, duration: {1}, d: {2}", time, duration, d));
|
||||
if (_audioVolumeSlider)
|
||||
{
|
||||
// Volume
|
||||
if (PlayingPlayer.Control != null)
|
||||
{
|
||||
float volume = PlayingPlayer.Control.GetVolume();
|
||||
_setAudioVolumeSliderValue = volume;
|
||||
_audioVolumeSlider.value = volume;
|
||||
}
|
||||
}
|
||||
|
||||
_setVideoSeekSliderValue = d;
|
||||
_videoSeekSlider.value = d;
|
||||
// Auto start toggle
|
||||
_AutoStartToggle.isOn = PlayingPlayer.m_AutoStart;
|
||||
|
||||
if (_bufferedSliderRect != null)
|
||||
{
|
||||
float t1 = 0f;
|
||||
float t2 = PlayingPlayer.Control.GetBufferingProgress();
|
||||
if (t2 <= 0f)
|
||||
{
|
||||
if (PlayingPlayer.Control.GetBufferedTimeRangeCount() > 0)
|
||||
{
|
||||
PlayingPlayer.Control.GetBufferedTimeRange(0, ref t1, ref t2);
|
||||
t1 /= PlayingPlayer.Info.GetDurationMs();
|
||||
t2 /= PlayingPlayer.Info.GetDurationMs();
|
||||
}
|
||||
}
|
||||
if (PlayingPlayer.m_AutoOpen)
|
||||
{
|
||||
// RemoveOpenVideoButton();
|
||||
|
||||
Vector2 anchorMin = Vector2.zero;
|
||||
Vector2 anchorMax = Vector2.one;
|
||||
|
||||
if (_bufferedSliderImage != null &&
|
||||
_bufferedSliderImage.type == Image.Type.Filled)
|
||||
{
|
||||
_bufferedSliderImage.fillAmount = d;
|
||||
}
|
||||
else
|
||||
{
|
||||
anchorMin[0] = t1;
|
||||
anchorMax[0] = t2;
|
||||
}
|
||||
|
||||
_bufferedSliderRect.anchorMin = anchorMin;
|
||||
_bufferedSliderRect.anchorMax = anchorMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
// SetButtonEnabled( "PlayButton", !_mediaPlayer.m_AutoStart );
|
||||
// SetButtonEnabled( "PauseButton", _mediaPlayer.m_AutoStart );
|
||||
}
|
||||
else
|
||||
{
|
||||
// SetButtonEnabled( "PlayButton", false );
|
||||
// SetButtonEnabled( "PauseButton", false );
|
||||
}
|
||||
|
||||
// Callback function to handle events
|
||||
public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
|
||||
{
|
||||
switch (et)
|
||||
{
|
||||
case MediaPlayerEvent.EventType.ReadyToPlay:
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.Started:
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.FirstFrameReady:
|
||||
SwapPlayers();
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.FinishedPlaying:
|
||||
break;
|
||||
}
|
||||
// SetButtonEnabled( "MuteButton", !_mediaPlayer.m_Muted );
|
||||
// SetButtonEnabled( "UnmuteButton", _mediaPlayer.m_Muted );
|
||||
|
||||
Debug.Log("Event: " + et.ToString());
|
||||
}
|
||||
OnOpenVideoFile();
|
||||
}
|
||||
}
|
||||
|
||||
// private void SetButtonEnabled( string objectName, bool bEnabled )
|
||||
// {
|
||||
// Button button = GameObject.Find( objectName ).GetComponent<Button>();
|
||||
// if( button )
|
||||
// {
|
||||
// button.enabled = bEnabled;
|
||||
// button.GetComponentInChildren<CanvasRenderer>().SetAlpha( bEnabled ? 1.0f : 0.4f );
|
||||
// button.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// }
|
||||
// }
|
||||
void Update()
|
||||
{
|
||||
if (PlayingPlayer && PlayingPlayer.Info != null && PlayingPlayer.Info.GetDurationMs() > 0f)
|
||||
{
|
||||
float time = PlayingPlayer.Control.GetCurrentTimeMs();
|
||||
float duration = PlayingPlayer.Info.GetDurationMs();
|
||||
float d = Mathf.Clamp(time / duration, 0.0f, 1.0f);
|
||||
|
||||
// private void RemoveOpenVideoButton()
|
||||
// {
|
||||
// Button openVideoButton = GameObject.Find( "OpenVideoButton" ).GetComponent<Button>();
|
||||
// if( openVideoButton )
|
||||
// {
|
||||
// openVideoButton.enabled = false;
|
||||
// openVideoButton.GetComponentInChildren<CanvasRenderer>().SetAlpha( 0.0f );
|
||||
// openVideoButton.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// }
|
||||
//
|
||||
// if( _AutoStartToggle )
|
||||
// {
|
||||
// _AutoStartToggle.enabled = false;
|
||||
// _AutoStartToggle.isOn = false;
|
||||
// _AutoStartToggle.GetComponentInChildren<CanvasRenderer>().SetAlpha( 0.0f );
|
||||
// _AutoStartToggle.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// _AutoStartToggle.GetComponentInChildren<Image>().enabled = false;
|
||||
// _AutoStartToggle.GetComponentInChildren<Image>().color = Color.clear;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// Debug.Log(string.Format("time: {0}, duration: {1}, d: {2}", time, duration, d));
|
||||
|
||||
_setVideoSeekSliderValue = d;
|
||||
_videoSeekSlider.value = d;
|
||||
|
||||
if (_bufferedSliderRect != null)
|
||||
{
|
||||
float t1 = 0f;
|
||||
float t2 = PlayingPlayer.Control.GetBufferingProgress();
|
||||
if (t2 <= 0f)
|
||||
{
|
||||
if (PlayingPlayer.Control.GetBufferedTimeRangeCount() > 0)
|
||||
{
|
||||
PlayingPlayer.Control.GetBufferedTimeRange(0, ref t1, ref t2);
|
||||
t1 /= PlayingPlayer.Info.GetDurationMs();
|
||||
t2 /= PlayingPlayer.Info.GetDurationMs();
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 anchorMin = Vector2.zero;
|
||||
Vector2 anchorMax = Vector2.one;
|
||||
|
||||
if (_bufferedSliderImage != null &&
|
||||
_bufferedSliderImage.type == Image.Type.Filled)
|
||||
{
|
||||
_bufferedSliderImage.fillAmount = d;
|
||||
}
|
||||
else
|
||||
{
|
||||
anchorMin[0] = t1;
|
||||
anchorMax[0] = t2;
|
||||
}
|
||||
|
||||
_bufferedSliderRect.anchorMin = anchorMin;
|
||||
_bufferedSliderRect.anchorMax = anchorMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Callback function to handle events
|
||||
public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
|
||||
{
|
||||
switch (et)
|
||||
{
|
||||
case MediaPlayerEvent.EventType.ReadyToPlay:
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.Started:
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.FirstFrameReady:
|
||||
SwapPlayers();
|
||||
break;
|
||||
case MediaPlayerEvent.EventType.FinishedPlaying:
|
||||
break;
|
||||
}
|
||||
|
||||
Debug.Log("Event: " + et.ToString());
|
||||
}
|
||||
|
||||
// private void SetButtonEnabled( string objectName, bool bEnabled )
|
||||
// {
|
||||
// Button button = GameObject.Find( objectName ).GetComponent<Button>();
|
||||
// if( button )
|
||||
// {
|
||||
// button.enabled = bEnabled;
|
||||
// button.GetComponentInChildren<CanvasRenderer>().SetAlpha( bEnabled ? 1.0f : 0.4f );
|
||||
// button.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void RemoveOpenVideoButton()
|
||||
// {
|
||||
// Button openVideoButton = GameObject.Find( "OpenVideoButton" ).GetComponent<Button>();
|
||||
// if( openVideoButton )
|
||||
// {
|
||||
// openVideoButton.enabled = false;
|
||||
// openVideoButton.GetComponentInChildren<CanvasRenderer>().SetAlpha( 0.0f );
|
||||
// openVideoButton.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// }
|
||||
//
|
||||
// if( _AutoStartToggle )
|
||||
// {
|
||||
// _AutoStartToggle.enabled = false;
|
||||
// _AutoStartToggle.isOn = false;
|
||||
// _AutoStartToggle.GetComponentInChildren<CanvasRenderer>().SetAlpha( 0.0f );
|
||||
// _AutoStartToggle.GetComponentInChildren<Text>().color = Color.clear;
|
||||
// _AutoStartToggle.GetComponentInChildren<Image>().enabled = false;
|
||||
// _AutoStartToggle.GetComponentInChildren<Image>().color = Color.clear;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -79,7 +79,7 @@ TextMesh:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 114525537}
|
||||
m_Text:
|
||||
m_Text: "\u7535\u5B50\u4FA6\u5BDF\u65E0\u4EBA\u673A"
|
||||
m_OffsetZ: 0
|
||||
m_CharacterSize: 1
|
||||
m_LineSpacing: 1
|
||||
|
|
@ -142,7 +142,7 @@ MonoBehaviour:
|
|||
isEnableVertical: 1
|
||||
isEnableLerp: 0
|
||||
lerpTime: 1
|
||||
_distance: 10
|
||||
_distance: 6
|
||||
--- !u!1 &1868832759
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -768,6 +768,11 @@ MonoBehaviour:
|
|||
SurveillanceFrequencyBand: {fileID: 6513129680526216908}
|
||||
gamePos: {fileID: 392167392884716949}
|
||||
gamemap: {fileID: 6311100753636855780}
|
||||
reveal: 0
|
||||
Ground:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
boisp: 1
|
||||
attackColliders1: []
|
||||
currentCollider: {fileID: 0}
|
||||
layerMask:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -12,6 +12,7 @@ public class Main_interface_Panel : XUIPanel
|
|||
public Button train;
|
||||
public Button replay;
|
||||
public Button appQuet;
|
||||
public Text accountName;
|
||||
public Main_interface_Panel() : base(UIType.Fixed, UIMode.None, UICollider.None)
|
||||
{
|
||||
uiPath = "UIPanel/Main_interface_Panel";
|
||||
|
|
@ -34,6 +35,8 @@ public class Main_interface_Panel : XUIPanel
|
|||
appQuet.onClick.AddListener(() => { Application.Quit();
|
||||
//Debug.Log("退出");
|
||||
});
|
||||
accountName = this.transform.Find("UPBG/avatar_btn/Text").GetComponent<Text>();
|
||||
accountName.text = GlobalFlag.currentUser.login_name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -369,10 +369,10 @@ public class Scenariopage : MonoBehaviour
|
|||
caodi = GameObject.Find("Background");
|
||||
|
||||
//调用接口
|
||||
Debug.Log("Url_Action..:" + Url_Action);
|
||||
//Debug.Log("Url_Action..:" + Url_Action);
|
||||
StartCoroutine(Post1(Url_Action, (bol, str) =>
|
||||
{
|
||||
Debug.Log(str);
|
||||
//Debug.Log(str);
|
||||
Scenario(bol, str);
|
||||
}));
|
||||
Scenario();//想定文件
|
||||
|
|
@ -382,7 +382,8 @@ public class Scenariopage : MonoBehaviour
|
|||
send_back_btn.onClick.AddListener(() =>
|
||||
{
|
||||
GameMain.tiao = false;
|
||||
SceneManager.LoadScene("SampleScene");
|
||||
SceneLoad.Instance.SceneChange("SampleScene");
|
||||
//SceneManager.LoadScene("SampleScene");
|
||||
});
|
||||
//SetLightValue(1f);
|
||||
queding.onClick.AddListener(() =>
|
||||
|
|
@ -1558,7 +1559,7 @@ public class Scenariopage : MonoBehaviour
|
|||
{
|
||||
if (bol)
|
||||
{
|
||||
Debug.LogError(str);
|
||||
//Debug.LogError(str);
|
||||
scen = JsonMapper.ToObject<Editinformation>(str);//解析最外层的想定名称json文件
|
||||
for (int i = 0; i < scen.data.Count; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,9 +38,10 @@ public class Taskpanel : MonoBehaviour
|
|||
public Button fanhuiBtn;
|
||||
public Button fanhui;
|
||||
private bool isp = true;
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
this.transform.Find("UPBG/avatar_botn/Text").GetComponent<Text>().text = GlobalFlag.currentUser.login_name;
|
||||
fanhui.onClick.AddListener(() =>
|
||||
{
|
||||
GameMain.tiao = false;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ public class View_Panel2 : XUIPanel
|
|||
public List<string> rootlist = new List<string>();//存入房间的名字
|
||||
public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮
|
||||
|
||||
|
||||
//public string roomUrl = Url_RoomList;
|
||||
//public string userUrl = Url_StudentList;
|
||||
public RoomData roomdata = new RoomData();
|
||||
|
|
@ -90,8 +89,11 @@ public class View_Panel2 : XUIPanel
|
|||
public Button entering_key_btn;//进入导调按钮
|
||||
public Button scenario_btn;//想定编辑
|
||||
public Button refresh_btn;//刷新房间按钮
|
||||
public Button playback_btn;//复盘回访按钮
|
||||
|
||||
/// <summary>
|
||||
/// 房间科目标题
|
||||
/// </summary>
|
||||
public Text roomSubjectTitle;
|
||||
|
||||
public View_Panel2() : base(UIType.Normal, UIMode.HideOther, UICollider.Normal)
|
||||
{
|
||||
|
|
@ -102,7 +104,6 @@ public class View_Panel2 : XUIPanel
|
|||
roomModelDropdown = this.transform.Find("append_room_panl/roomModelDropdown").GetComponent<Dropdown>();
|
||||
thinkingDropdown = this.transform.Find("append_room_panl/thinkingDropdown").GetComponent<Dropdown>();
|
||||
refresh_btn = this.transform.Find("UPBG/Refresh_btn").GetComponent<Button>();
|
||||
|
||||
append_room_panl = GameObject.Find("View_Panel2(Clone)").transform.GetChild(2).GetComponent<Image>();
|
||||
Fork_off_btn = GameObject.Find("View_Panel2(Clone)").transform.GetChild(2).transform.GetChild(1).GetComponent<Button>();
|
||||
room_input = GameObject.Find("View_Panel2(Clone)").transform.GetChild(2).transform.GetChild(3).GetComponent<InputField>();
|
||||
|
|
@ -116,8 +117,9 @@ public class View_Panel2 : XUIPanel
|
|||
off3_btn = GameObject.Find("View_Panel2(Clone)").transform.GetChild(4).transform.GetChild(1).GetComponent<Button>();
|
||||
place = GameObject.Find("View_Panel2(Clone)").transform.GetChild(1).transform.GetChild(0).transform.GetChild(0).GetComponent<Transform>();
|
||||
//Storm_and_capture_panl
|
||||
playback_btn = GameObject.Find("Main_interface_Panel(Clone)/UPBG/double_quotation_btn").GetComponent<Button>();
|
||||
|
||||
Storm_and_capture_panl = this.transform.Find("Storm_and_capture_panl").gameObject;
|
||||
roomSubjectTitle = Storm_and_capture_panl.transform.Find("red_green_iamg/Title").GetComponent<Text>();
|
||||
submitView = Storm_and_capture_panl.transform.Find("SubmitView").gameObject;
|
||||
submitInstruct = submitView.transform.Find("Bg/Instruct").GetComponent<Text>();
|
||||
svSubmitBtn = submitView.transform.Find("SubmitBtn").GetComponent<Button>();
|
||||
|
|
@ -158,7 +160,8 @@ public class View_Panel2 : XUIPanel
|
|||
jobInputField = selector_panl.transform.Find("JobInputField").GetComponent<InputField>();
|
||||
userItem = userConent.GetChild(0).gameObject;
|
||||
thinkingDropdown.options.Clear();
|
||||
|
||||
|
||||
|
||||
tijiao_btn.onClick.AddListener(() =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(currentAccount))
|
||||
|
|
@ -208,7 +211,7 @@ public class View_Panel2 : XUIPanel
|
|||
{
|
||||
Debug.Log("onEndEdit" + info);
|
||||
});
|
||||
|
||||
|
||||
Forkoffbtn();
|
||||
Verify();
|
||||
Submit();
|
||||
|
|
@ -237,15 +240,12 @@ public class View_Panel2 : XUIPanel
|
|||
break;
|
||||
case "02":
|
||||
start_training_btn.gameObject.SetActive(false);
|
||||
playback_btn.gameObject.SetActive(false);
|
||||
break;
|
||||
case "03":
|
||||
start_training_btn.gameObject.SetActive(false);
|
||||
playback_btn.gameObject.SetActive(false);
|
||||
break;
|
||||
case "04":
|
||||
case "05":
|
||||
playback_btn.gameObject.SetActive(false);
|
||||
entering_key_btn.gameObject.SetActive(false);
|
||||
//append_btn.interactable = false;
|
||||
append_btn.gameObject.SetActive(false);
|
||||
|
|
@ -253,10 +253,6 @@ public class View_Panel2 : XUIPanel
|
|||
scenario_btn.gameObject.SetActive(false);
|
||||
break;
|
||||
}
|
||||
if (GameMain.visit)
|
||||
{
|
||||
playback_btn.gameObject.SetActive(true);
|
||||
}
|
||||
OnRegisterFunction();
|
||||
}
|
||||
|
||||
|
|
@ -273,17 +269,20 @@ public class View_Panel2 : XUIPanel
|
|||
MyNetMQClient.instance._netMqListener.SubTopic(GlobalFlag.roomID);
|
||||
if (GlobalFlag.field_Char1 == "学校")
|
||||
{
|
||||
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||
SceneLoad.Instance.SceneChange("AdamTraining_pilot_terminal_panl 1");
|
||||
|
||||
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||
//CoroutineHandler.StartCoroutine(Loadscene());
|
||||
//View_Panel2Attatch.view_Panel2Attatch.StartCoroutine(View_Panel2Attatch.view_Panel2Attatch.Loadscene("AdamTraining_pilot_terminal_panl 1"));
|
||||
}
|
||||
else if(GlobalFlag.field_Char1 == "山地")
|
||||
else if (GlobalFlag.field_Char1 == "山地")
|
||||
{
|
||||
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 3");
|
||||
SceneLoad.Instance.SceneChange("AdamTraining_pilot_terminal_panl 3");
|
||||
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 3");
|
||||
//View_Panel2Attatch.view_Panel2Attatch.StartCoroutine(View_Panel2Attatch.view_Panel2Attatch.Loadscene("AdamTraining_pilot_terminal_panl 3"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async void GetAllRoomData()
|
||||
{
|
||||
|
|
@ -307,6 +306,7 @@ public class View_Panel2 : XUIPanel
|
|||
public List<GameObject> currentAllAccount = new List<GameObject>();
|
||||
public void CreateAllUser(List<DataItem> userInfo)
|
||||
{
|
||||
currentAccount = "";
|
||||
if (userConent.childCount > 1)
|
||||
{
|
||||
for (int i = 1; i < userConent.childCount; i++)
|
||||
|
|
@ -341,6 +341,10 @@ public class View_Panel2 : XUIPanel
|
|||
currentAllAccount.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除已经被分配的账号信息,在选择页面不显示已经被分配过的学员
|
||||
/// </summary>
|
||||
public void EliminateAccount()
|
||||
{
|
||||
if (currentEditorAccounts.Count > 0 && currentAllAccount.Count > 0)
|
||||
|
|
@ -357,12 +361,26 @@ public class View_Panel2 : XUIPanel
|
|||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 取消分配
|
||||
/// </summary>
|
||||
public void DeleteAssignedAccount(string subjectID, string seatID)
|
||||
{
|
||||
for (int i = 0; i < currentEditorAccounts.Count; i++)
|
||||
{
|
||||
if (currentEditorAccounts[i].subjectID.Equals(subjectID) && currentEditorAccounts[i].SeatID.Equals(seatID))
|
||||
{
|
||||
currentEditorAccounts.Remove(currentEditorAccounts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 席位分配提交按钮
|
||||
/// 选择人员界面提交按钮
|
||||
/// </summary>
|
||||
public void TiJiaoBtn()
|
||||
{
|
||||
if (string.IsNullOrEmpty(currentAccount) || currentAccount == "") return;
|
||||
CurrentEditorAccount ced = new CurrentEditorAccount();
|
||||
if (currentEditorAccounts.Count > 0)
|
||||
{
|
||||
|
|
@ -460,7 +478,7 @@ public class View_Panel2 : XUIPanel
|
|||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 新建房间 想定编辑里的科目信息
|
||||
/// 新建房间 想定编辑里的科目信息 席位分配界面
|
||||
/// </summary>
|
||||
/// <param name="indexI"></param>
|
||||
/// <param name="indexJ"></param>
|
||||
|
|
@ -485,6 +503,13 @@ public class View_Panel2 : XUIPanel
|
|||
EliminateAccount();
|
||||
//Debug.Log($"currentSubjectID+currentSeatID={ currentSubjectID }={currentSeatID}");
|
||||
});
|
||||
seatTemp.transform.GetChild(4).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
if (seatTemp.transform.GetChild(2).GetComponent<Text>().text == "xxxx") return;
|
||||
DeleteAssignedAccount(subjectName, seatTemp.name);
|
||||
seatTemp.transform.GetChild(2).GetComponent<Text>().text = "xxxx";
|
||||
Debug.Log("删除分配信息");
|
||||
});
|
||||
if (GlobalFlag.currentUser.role_code.Equals("04") || GlobalFlag.currentUser.role_code.Equals("05") || GlobalFlag.currentUser.role_code.Equals("02"))
|
||||
{
|
||||
seatTemp.transform.GetChild(3).GetComponent<Button>().interactable = false;
|
||||
|
|
@ -529,7 +554,8 @@ public class View_Panel2 : XUIPanel
|
|||
///想定编辑
|
||||
scenario_btn.onClick.AddListener(() =>
|
||||
{
|
||||
SceneManager.LoadScene("Contingenc_yediting_panl");
|
||||
SceneLoad.Instance.SceneChange("Contingenc_yediting_panl");
|
||||
//SceneManager.LoadScene("Contingenc_yediting_panl");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -579,7 +605,7 @@ public class View_Panel2 : XUIPanel
|
|||
//Debug.Log(" roomItem.nameID==" + roomItem.name);
|
||||
CreateSubjectItem(currentRoomData.data);
|
||||
});
|
||||
|
||||
|
||||
roomItem.transform.Find("close_btn").GetComponent<Button>().onClick.AddListener(async () =>
|
||||
{
|
||||
string url = Url_Practice + roomItem.name;
|
||||
|
|
@ -612,9 +638,11 @@ public class View_Panel2 : XUIPanel
|
|||
GameObject subjectTemp = GameObject.Instantiate(currentRoomSubjectItem, currentRoomSubjectItemConnect);
|
||||
subjectTemp.SetActive(true);
|
||||
subjectTemp.name = di[index].Id;
|
||||
subjectTemp.transform.GetChild(0).GetComponent<Text>().text = di[index].Name;
|
||||
string roomSubjectTitleTemp = di[index].Name;
|
||||
subjectTemp.transform.GetChild(0).GetComponent<Text>().text = roomSubjectTitleTemp;
|
||||
subjectTemp.GetComponent<Button>().onClick.AddListener(async () =>
|
||||
{
|
||||
roomSubjectTitle.text = roomSubjectTitleTemp;
|
||||
currentDIPracticeID = di[index].PracticeId;
|
||||
currentDISubjectID = subjectTemp.name;
|
||||
GlobalFlag.practiceSubjectID = subjectTemp.name;
|
||||
|
|
@ -622,11 +650,19 @@ public class View_Panel2 : XUIPanel
|
|||
CreateSubjectInfo(currentSubjectInfo.data);
|
||||
});
|
||||
}
|
||||
UIBootstrap.Instance.WaitForT(WaitSubjectItemClick);
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新科目列表里面的席位信息
|
||||
/// </summary>
|
||||
private void WaitSubjectItemClick()
|
||||
{
|
||||
if (currentRoomSubjectItemConnect.childCount > 1)
|
||||
{
|
||||
currentRoomSubjectItemConnect.GetChild(1).GetComponent<Button>().onClick.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除科目席位信息
|
||||
/// </summary>
|
||||
|
|
@ -784,14 +820,14 @@ public class View_Panel2 : XUIPanel
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// 分配面板提交按钮和取消人员选择按钮
|
||||
/// 席位分配面板提交按钮和取消人员选择按钮
|
||||
/// </summary>
|
||||
private void Submit()
|
||||
{
|
||||
seatSubmit_btn.onClick.AddListener(() =>
|
||||
{
|
||||
//UIBootstrap.Instance.CheckShowLoad(WaitShow);
|
||||
WaitShow();
|
||||
//UIBootstrap.Instance.CheckShowLoad(WaitShow);
|
||||
WaitShow();
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -801,7 +837,7 @@ public class View_Panel2 : XUIPanel
|
|||
});
|
||||
quxiao_btn.onClick.AddListener(() =>
|
||||
{
|
||||
selector_panl.gameObject.SetActive(false);
|
||||
selector_panl.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -810,6 +846,7 @@ public class View_Panel2 : XUIPanel
|
|||
append_room_panl.gameObject.SetActive(false);
|
||||
distribution_panl.gameObject.SetActive(false);
|
||||
selector_panl.gameObject.SetActive(false);
|
||||
|
||||
string accountInfo = AccountsInfo();
|
||||
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>(Url_GetRoomID + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
||||
if (returnRoomId.state)
|
||||
|
|
@ -823,6 +860,7 @@ public class View_Panel2 : XUIPanel
|
|||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
||||
refresh_btn.onClick?.Invoke();
|
||||
}
|
||||
currentEditorAccounts.Clear();
|
||||
string RoomName = "createroom " + returnRoomId.data;
|
||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||
}
|
||||
|
|
@ -849,7 +887,6 @@ public class View_Panel2 : XUIPanel
|
|||
/// </summary>
|
||||
private void Verify()
|
||||
{
|
||||
|
||||
verify_btn.onClick.AddListener(() =>
|
||||
{
|
||||
if (room_input.text.Length >= 1)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -46,8 +46,8 @@ public class Face2Camera : MonoBehaviour
|
|||
|
||||
float distance = Vector3.Distance(Camera.main.transform.position, transform.position);//不断变化的距离
|
||||
float scale = distance / _distance;
|
||||
if (scale > 10f)
|
||||
scale = 10f;
|
||||
if (scale > 3f)
|
||||
scale = 3f;
|
||||
transform.localScale = initScale * scale;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue