UNITY_EDITOR 编辑器调用。
UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义。
UNITY_DASHBOARD_WIDGET Mac OS Dashboard widget (Mac OS仪表板小部件)。
public class SingletonBase<T> where T : new() | |
{ | |
private static T instance; | |
public static T GetInstance() | |
{ | |
if (instance == null) | |
instance = new T(); | |
return instance; | |
} |
// include the basic windows header files and the Direct3D header files | |
#include <windows.h> | |
#include <windowsx.h> | |
#include <d3d11.h> | |
#include <d3dx11.h> | |
#include <d3dx10.h> | |
// include the Direct3D Library file | |
#pragma comment (lib, "d3d11.lib") | |
#pragma comment (lib, "d3dx11.lib") |
#include "precomp.h" | |
#include "util.h" | |
using namespace Microsoft::WRL; | |
using namespace WEX::TestExecution; | |
PCWSTR StringFromFeatureLevel (D3D_FEATURE_LEVEL FeatureLevel) | |
{ | |
switch (FeatureLevel) { | |
case D3D_FEATURE_LEVEL_12_1: return L"12.1"; |
// 重写事件 | |
bool event(QEvent *event) | |
{ | |
if (event->type() == QEvent::ActivationChange) | |
{ | |
if (QApplication::activeWindow() != this) | |
{ | |
this->hide(); | |
} | |
} |
#include<iostream> | |
#include<time.h> | |
using namespace std; | |
int main() | |
{ | |
clock_t startTime,endTime; | |
startTime = clock(); | |
for (int i = 0; i < 1000000; i++) |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Screenshot : MonoBehaviour | |
{ | |
private int index = 0; | |
// Start is called before the first frame update | |
void Start() |
// <http://wiki.unity3d.com/index.php?title=TakeScreenshot> | |
// ****** Notice : It doesn't works in Wep Player environment. ****** | |
// ****** It works in PC environment. ****** | |
// Default method have some problem, when you take a Screen shot for your game. | |
// So add this script. | |
// CF Page : http://technology.blurst.com/unity-jpg-encoding-javascript/ | |
// made by Jerry ( sdragoon@nate.com ) | |
using UnityEngine; |
// <http://wiki.unity3d.com/index.php?title=TakeScreenshot> | |
// TODO: | |
// By default, screenshot files are placed next to the executable bundle -- we don't want this in a | |
// shipping game, as it will fail if the user doesn't have write access to the Applications folder. | |
// Instead we should place the screenshots on the user's desktop. However, the ~/ notation doesn't | |
// work, and Unity doesn't have a mechanism to return special paths. Therefore, the correct way to | |
// solve this is probably with a plug-in to return OS specific special paths. | |
// Mono/.NET has functions to get special paths... see discussion page. --Aarku |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SQLite; | |
/// <summary> | |
/// 数据库操作类 | |
/// </summary> | |
public sealed class SQLiteHelper | |
{ |
UNITY_EDITOR 编辑器调用。
UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义。
UNITY_DASHBOARD_WIDGET Mac OS Dashboard widget (Mac OS仪表板小部件)。