public override void OnUpdate(OnUpdateProperties onUpdateProperties) { base.OnUpdate(onUpdateProperties); HandleRotation(); HandleMovement(); HandleOpenMenu(); }
public override void OnUpdate(OnUpdateProperties onUpdateProperties) { base.OnUpdate(onUpdateProperties); if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.L)) { ExtensionFilter objFilter = new ExtensionFilter("3D files", "3D", "3DS", "3MF", "AC", "AC3D", "ACC", "AMF", "AMJ", "ASE", "ASK", "B3D", "BLEND", "BVH", "COB", "DAE", "DXF", "ENFF", "FBX", "IRR", "LWO", "LWS", "LXO", "MD2", "MD3", "MD5", "MDC", "MDL", "MESH", "MOT", "MS3D", "NDO", "NFF", "OBJ", "OFF", "OGEX", "PLY", "PMX", "PRJ", "Q3O", "Q3S", "RAW", "SCN", "SIB", "SMD", "STL", "TER", "UC", "VTA", "X", "X3D", "XGL", "ZGL"); ExtensionFilter imageFilter = new ExtensionFilter("Image files", "png", "jpg", "jpeg"); StandaloneFileBrowser.OpenFilePanelAsync("Load File", "", new ExtensionFilter[] { objFilter, imageFilter }, true, (string[] paths) => { paths.ToList().ForEach(path => { string name = new FileInfo(path).Name; string[] split = name.Split('.'); string nameWOext = split[0]; string ext = split[1]; if (objFilter.Extensions.Contains(ext.ToUpper())) { byte[] data = File.ReadAllBytes(path); Main.campaign.AddObject(name, data); //TODO: actually do this } else { } }); }); } }
void Update() { OnUpdateProperties props = new OnUpdateProperties { DeltaTime = Time.deltaTime, }; // run all the functions asked to be run on main thread, and clear them from the list while (invokeFunctionList.Count != 0) { invokeFunctionList[0].Key(); invokeFunctionList[0].Value.SetResult(props); invokeFunctionList.RemoveAt(0); } // run the OnUpdate OnUpdate(props); }
/// <summary> /// overwrite this for a method that is runs each frame /// </summary> /// <param name="onUpdateProperties">properties for updating</param> public virtual void OnUpdate(OnUpdateProperties onUpdateProperties) { }
public override void OnUpdate(OnUpdateProperties onUpdateProperties) { base.OnUpdate(onUpdateProperties); }
public override void OnUpdate(OnUpdateProperties onUpdateProperties) { base.OnUpdate(onUpdateProperties); discord.RunCallbacks(); }