public static void Init() { id = -1; cost = -1; map_id = -1; Mode = ePlayMode.None; listUnitInfos = null; }
public void SetParas(GameObject go, int delay, int duration, ePlayMode playMode) { _tweenGo = go; _delay = delay; _duration = duration; _curTime = 0; _dFactor = duration <= 0 ? 1f :1f / _duration; _playMode = playMode; // 初始化 _factor = 0f; _curTime = 0; _isFinish = false; _isEnable = true; }
static void HandlePlayModeSwitches() { #if UNITY_2017_3_OR_NEWER EditorApplication.playModeStateChanged += (a) => #else EditorApplication.playmodeStateChanged += () => #endif { var previousMode = PlayMode; if (EditorApplication.isPaused) { PlayMode = ePlayMode.Paused; } else { if (EditorApplication.isPlaying) { PlayMode = ePlayMode.Playing; } else { PlayMode = ePlayMode.Stopped; } } if (PlayMode == previousMode) { return; } if (PlayMode == ePlayMode.Paused) { return; } if (previousMode != ePlayMode.Paused) { var containers = GameObject.FindObjectsOfType <UIObject3DContainer>().ToList(); // Error check - if, somehow, we have multiple scene containers, // cleanup and then continue if (containers.Count > 1) { DestroySceneContainers(); CleanupAllObjects(); } } }; }
private void ComboMediaFiles_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_cmbFilesList.SelectedItem is MediaFileInfo info) { if (info != null && !string.IsNullOrWhiteSpace(info.FileName)) { Retry: if (!File.Exists(info.FileName)) { var res = PopUp.MessageBox("File Not Found: \n" + info.FileName, "Open Media File", MessageBoxImage.Exclamation, TextAlignment.Left, new PopUp.PopUpButtons("_Skip to Next", "Re_move & Next", "Re_try", PopUp.PopUpResult.Btn3)); if (res == PopUp.PopUpResult.Btn3) { goto Retry; } ePlayMode playMode = MediaDB.SelectedPlayList.PlayMode; bool bResetPositionAndPlayNext = false; if (playMode == ePlayMode.PlayAll || playMode == ePlayMode.RepeatAll) { bResetPositionAndPlayNext = true; } bool bRemoveFromList = (res == PopUp.PopUpResult.Btn2); RemoveMediaFileAndSelectNext(info, bResetPositionAndPlayNext, bRemoveFromList); return; } MediaDB.SelectedMediaFileIndex = _cmbFilesList.SelectedIndex; PlayerVM.Open(info); } else { PlayerVM.SaveAndClear(); } } else { PlayerVM.SaveAndClear(); } }