本文整理汇总了C#中LoadState类的典型用法代码示例。如果您正苦于以下问题:C# LoadState类的具体用法?C# LoadState怎么用?C# LoadState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadState类属于命名空间,在下文中一共展示了LoadState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadMem
public static object LoadMem(LoadState S, Type t, int n)
{
ArrayList array = new ArrayList();
for (int i=0; i<n; i++)
array.Add(LoadMem(S, t));
return array.ToArray(t);
}
示例2: Init
public static void Init ()
{
curLoadState = LoadState.Loading;
LoadTextureFolders ();
LoadXMLPaths ();
curLoadState = LoadState.Finished;
}
示例3: LoadNextScene
public void LoadNextScene()
{
int currLevelIndex = previousLevelIndex = Application.loadedLevel;
loadState = LoadState.loading;
currLevelIndex++;
Application.LoadLevel(currLevelIndex);
}
示例4: Awake
void Awake ()
{
/*
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
objPath = "file://" + Application.streamingAssetsPath + "/model2.obj";
#else
#if UNITY_ANDROID
FileInfo fi = new FileInfo("/sdcard/model.obj");
if (fi.Exists)
objPath = "file://" +"/sdcard/model.obj";
else
objPath = Application.streamingAssetsPath + "/model2.obj";
#endif
#endif
*/
#if STANDALONE_DEBUG
IPAddress ip = IPAddress.Parse("127.0.0.1");
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
serverSocket.Bind(new IPEndPoint(ip, myPort));
serverSocket.Listen(5);
clientSocket = new List<Socket>();
#endif
load_state = LoadState.IDLE;
move_para = new MovePara();
show_envelop = false;
show_joint = false;
show_body = true;
gameObject.AddComponent<Animation>();
animation.AddClip(move_para.create_move(Movement.RUN), "run");
animation.AddClip(move_para.create_move(Movement.JUMP), "jump");
animation.AddClip(move_para.create_move(Movement.SLIDE), "slide");
}
示例5: RenderWareFile
/// <summary>
/// Create RenderWareFile from byte data<para/>
/// Создание RenderWareFile из массива байт
/// </summary>
/// <param name="data">File content<para/>Содержимое файла</param>
/// <param name="readNow">Read file immediately instead of threaded reading<para/>Прочитать файл сейчас же, не полагаясь на потоковый загрузчик</param>
public RenderWareFile(byte[] data, bool readNow = false) {
QueuedStream = new MemoryStream(data, false);
State = LoadState.None;
if (readNow) {
ReadData();
}
}
示例6: LoadMainMenu
public void LoadMainMenu()
{
previousLevelIndex = Application.loadedLevel;
loadState = LoadState.loading;
DestroyPersistantObjects();
Application.LoadLevel(0);
}
示例7: ChosenCode
private void ChosenCode(Toon [] Character, Toon ChosenOne, Toon OpponentToon, Extras extra)
{
TransferAttributes(Character, ChosenOne, OnToon);
int OpponentNum = rand.Next(0, extra.NumOfToons);
if (OpponentNum != OnToon)
{
TransferAttributes(Character, OpponentToon, OpponentNum);
extra.State = Extras.GameState.FIGHT;
State = LoadState.Initialize;
}
}
示例8: EnsureLoaded
internal void EnsureLoaded() {
#if FALSE
// If we're fully loaded, just return.
if (_loadState == LoadState.Loaded) {
return;
}
// If we're loading or not loaded, we need to take this lock.
if (!_typeDb.BeginModuleLoad(this, 10000)) {
Debug.Fail("Timeout loading {0}", _modName);
//throw new InvalidOperationException("Cannot load module at this time");
return;
}
try {
// Ensure we haven't started/finished loading while waiting
if (_loadState != LoadState.NotLoaded) {
return;
}
// Mark as loading now (before it completes), if we have circular
// references we'll fix them up after loading
// completes.
_loadState = LoadState.Loading;
using (var stream = new FileStream(_dbFile, FileMode.Open, FileAccess.Read, FileShare.Read)) {
Dictionary<string, object> contents = null;
try {
contents = (Dictionary<string, object>)Unpickle.Load(stream);
} catch (ArgumentException) {
_typeDb.OnDatabaseCorrupt();
} catch (InvalidOperationException) {
// Bug 511 - http://pytools.codeplex.com/workitem/511
// Ignore a corrupt database file.
_typeDb.OnDatabaseCorrupt();
}
if (contents != null) {
LoadModule(contents);
}
}
} catch (FileNotFoundException) {
// if the file got deleted before we've loaded it don't crash...
} catch (IOException) {
// or if someone has locked the file for some reason, also don't crash...
} finally {
// Regardless of how we finish, mark us as loaded so we don't
// try again.
_loadState = LoadState.Loaded;
_typeDb.EndModuleLoad(this);
}
#endif
}
示例9: LoadMem
//#endif
public static object LoadMem(LoadState S, Type t)
{
int size = Marshal.SizeOf(t);
CharPtr str = new char[size];
LoadBlock(S, str, size);
byte[] bytes = new byte[str.chars.Length];
for (int i = 0; i < str.chars.Length; i++)
bytes[i] = (byte)str.chars[i];
GCHandle pinnedPacket = GCHandle.Alloc(bytes, GCHandleType.Pinned);
object b = Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), t);
pinnedPacket.Free();
return b;
}
示例10: Cancel
public static void Cancel()
{
if (activeSaveSlot != -1)
{
if (state == LoadState.Normal)
{
state = LoadState.ConfirmClear;
}
else
{
state = LoadState.Normal;
}
}
}
示例11: MainToolbarViewModel
public MainToolbarViewModel(SongLoader songLoader, CurrentSongService currentSongService, PrintService printService, ExportImageService saveService)
{
LoadState = new LoadState();
this.printService = printService;
this.saveService = saveService;
this.currentSongService = currentSongService;
SelectedGuitarPath = currentSongService.GuitarPath.Name;
OpenFileCommand = new RelayCommand(songLoader.OpenFile);
LoadDiskTracksCommand = new RelayCommand(songLoader.LoadDiskTracks);
LoadDLCTracksCommand = new RelayCommand(songLoader.LoadDLCTracks);
PrintCommand = new RelayCommand<TabControl>(PrintTab);
SaveCommand = new RelayCommand<TabControl>(SaveTabImage);
Messenger.Default.Register<SongChange>(this, (SongChange c) => { if (c == SongChange.Score) RaisePropertyChanged("IsATrackLoaded"); });
}
示例12: LoadDetail
internal async Task LoadDetail(string url)
{
base.SetProgressIndicator("LoadDetail", true, "Loading detail...");
if (this.isLoadDetailAndChaper == LoadState.None)
{
this.isLoadDetailAndChaper = LoadState.Loading;
var jsonDetail = await Config.GetDetail(url);
if (jsonDetail.error_code == 0)
{
bool isFavorite = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlMangaFavorite>(t => t.Url == url) != null;
bool isRead = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlHistoryRead>(t => t.UrlManga == url) != null;
ItemDetail.NameManga = jsonDetail.data._detailNameManga;
ItemDetail.UrlCover = jsonDetail.data._detailUrlCover;
ItemDetail.Description = jsonDetail.data._detailDescription;
//ItemDetail.Description = @"";
ItemDetail.Rating = jsonDetail.data._rating;
ItemDetail.IsFavorite = isFavorite;
ItemDetail.IsRead = isRead;
ItemDetail.UrlManga = url;
var listHistoryChaperRead = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlHistoryRead>().Where(t => t.UrlManga == url);
var listHistoryDownload = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlDownload>();
var listChaperBookmask = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlChaperBookmask>().Where(t => t.Sever == App.NewSever);
foreach (var itemChaper in jsonDetail.data.listChap)
{
bool isRead2 = listHistoryChaperRead.FirstOrDefault(t => t.UrlChaper == itemChaper._urlChap) != null;
bool isDownload = listHistoryDownload.FirstOrDefault(t => t.Url == itemChaper._urlChap) != null;
bool isFavorite2 = listChaperBookmask.FirstOrDefault(t => t.Url == itemChaper._urlChap) != null;
this.Chapers.Add(new Chaper(itemChaper._chap, itemChaper._urlChap, DateTime.Now.ToString(MangaCore.Comon.FormatDateTime), isRead2, false, isDownload, isFavorite2, "", false));
}
}
else
{
Utils.ShowMessage("Error: " + jsonDetail.msg, "Error", 0);
}
}
base.SetProgressIndicator("LoadDetail", false, "Loading...");
}
示例13: LoadString
private static TString LoadString(LoadState S)
{
uint size = (uint)LoadVar(S, typeof(uint));
if (size==0)
return null;
else
{
CharPtr s=luaZ_openspace(S.L,S.b,size);
LoadBlock(S, s, (int)size);
return luaS_newlstr(S.L,s,size-1); /* remove trailing '\0' */
}
}
示例14: LoadNumber
private static lua_Number LoadNumber(LoadState S)
{
return (lua_Number)LoadVar(S, typeof(lua_Number));
}
示例15: LoadInt
private static int LoadInt(LoadState S)
{
int x = (int)LoadVar(S, typeof(int));
IF (x<0, "bad integer");
return x;
}