Unicessing  0.16T
Unicessing is an asset for writing a code like 'Processing' in Unity.
Unicessing.UGraphics クラス
+ Unicessing.UGraphics の継承関係図

クラス

struct  SystemObject
 
class  UStyle
 

公開メンバ関数

void size (float width, float height, AxisMode mode=U3D, float scale=1.0f)
 widthとheightの大きさ、座標系モード、全体のスケールを指定 [詳解]
 
void loop ()
 描画ループを許可
 
void noLoop ()
 描画ループを止める
 
void clear ()
 一時オブジェクトを消す
 
float red (Color col)
 色の赤色成分を返す
 
float green (Color col)
 色の緑色成分を返す
 
float blue (Color col)
 色の青色成分を返す
 
float alpha (Color col)
 色の透明色成分を返す
 
float gray (Color col)
 色のグレイスケール成分を返す
 
Color lerpColor (Color c1, Color c2, float amt)
 2つの色の補間した色を返す
 
void fill ()
 塗りつぶす
 
void fill (float gray, float alpha=255)
 塗りつぶし色を指定
 
void fill (float r, float g, float b, float a=255)
 
void fill (Color col)
 
void noFill ()
 塗りつぶさない
 
void stroke ()
 線を描く
 
void stroke (float gray, float alpha=255)
 線の色を指定
 
void stroke (float r, float g, float b, float a=255)
 
void stroke (Color col)
 
void noStroke ()
 線を描かない
 
void pushStyle ()
 現在のスタイルをスタックに積んで保存
 
void popStyle ()
 保存したスタイルをスタックから降ろして反映
 
UStyle getStyle ()
 現在のスタイルクラスを直接参照する
 
void setStyle (UStyle style)
 現在のスタイルクラスを変更する
 
void style (UStyle style)
 
void pushMatrix ()
 現在の行列(姿勢、位置、スケール)をスタックに積んで保存
 
void popMatrix ()
 現在の行列(姿勢、位置、スケール)をスタックから降ろして反映
 
void push ()
 現在のスタイルと行列(姿勢、位置、スケール)をスタックに積んで保存
 
void pop ()
 現在のスタイルと行列(姿勢、位置、スケール)をスタックから降ろして反映
 
UMatrix getMatrix ()
 現在のローカル行列(姿勢、位置、スケール)を取得する
 
Matrix4x4 getWorldMatrix ()
 現在のワールド行列(姿勢、位置、スケール)を取得する
 
Matrix4x4 getLocalMatrix ()
 現在のローカル行列(姿勢、位置、スケール)を取得する
 
void applyMatrix (UMatrix matrix)
 現在のローカル行列(姿勢、位置、スケール)を上書きする
 
void applyWorldMatrix (Matrix4x4 matrix)
 現在のワールド行列(姿勢、位置、スケール)を上書きする
 
void applyLocalMatrix (Matrix4x4 matrix)
 現在のローカル行列(姿勢、位置、スケール)を上書きする
 
void translate (float x, float y, float z=0.0f)
 位置を移動する
 
void translate (Vector3 pos)
 
void rotate (float angle)
 姿勢を回転させる(Z軸)
 
void rotate (float xAngle, float yAngle, float zAngle)
 姿勢を回転させる(3軸)
 
void rotate (Vector3 angles)
 
void rotate (float angle, float x, float y, float z)
 姿勢を回転させる(指定の軸)
 
void rotateX (float angle)
 姿勢を回転させる(X軸)
 
void rotateY (float angle)
 姿勢を回転させる(Y軸)
 
void rotateZ (float angle)
 姿勢を回転させる(Z軸)
 
void scale (float s)
 
void scale (float x, float y, float z=1.0f)
 
void scale (Vector3 s)
 
float modelX ()
 現在ワールド位置のX座標を返す
 
float modelY ()
 現在ワールド位置のY座標を返す
 
float modelZ ()
 現在ワールド位置のZ座標を返す
 
UShape createShape ()
 新しいシェイプを作成する
 
UShape createShape (UShape.ShapeKind kind, params float[] p)
 基本形状のシェイプを作成する [詳解]
 
UShape createPoint (float x, float y, float z)
 点のシェイプを作成する
 
UShape createLine (float x1, float y1, float x2, float y2)
 線のシェイプを作成する
 
UShape createLine (float x1, float y1, float z1, float x2, float y2, float z2)
 
UShape createRect (float x, float y, float w, float h)
 四角のシェイプを作成する
 
UShape createEllipse (float x, float y, float w, float h)
 円のシェイプを作成する
 
UShape createBox (float w, float h, float d)
 箱のシェイプを作成する
 
UShape createSphere (float w, float h, float d, int ures=30, int vres=30)
 球のシェイプを作成する
 
void point (float x, float y, float z=0.0f)
 点を描く
 
void point (Vector3 pos)
 
void line (float x1, float y1, float x2, float y2)
 線を描く
 
void line (float x1, float y1, float z1, float x2, float y2, float z2)
 
void line (Vector3 v1, Vector3 v2)
 
void curve (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 曲線を描く
 
void curve (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
 
void curve (Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4)
 
void rectMode (int mode)
 rect()で四角形を描くときの基準位置を設定する。CORNER、CENTER、CORNER_P5
 
void rect (float x, float y, float w, float h)
 四角を描く
 
void ellipseMode (int mode)
 ellipse()で円を描くときの基準位置を設定する。CORNER、CENTER、CORNER_P5
 
void ellipse (float x, float y, float w, float h)
 円を描く
 
void triangle (float x1, float y1, float x2, float y2, float x3, float y3)
 三角を描く
 
void box (float whd)
 箱を描く
 
void box (float w, float h, float d)
 
void box (float x, float y, float z, float w, float h, float d)
 
void box (Vector3 pos, Vector3 scale)
 
void box (Vector3 scale)
 
void sphere (float r)
 球を描く
 
void sphere (float w, float h, float d)
 
void sphere (float x, float y, float z, float w, float h, float d)
 
void sphere (Vector3 pos, Vector3 scale)
 
void sphere (Vector3 scale)
 
void sphereDetail (int res)
 sphere()で描くときの球の面の分割数を設定する
 
void sphereDetail (int ures, int vres)
 
void beginShape (UShape.VertexType type=UShape.VertexType.LINE_STRIP)
 独自のシェイプをbeginShape()で作成開始し、endShape()で描く [詳解]
 
void endShape (UShape.CloseType closeType=UShape.CloseType.NONE)
 endShape()はbeginShape()のあとに使い、その間で指定した頂点の図形を描く。CLOSEで図形を最初の頂点につなげて閉じる
 
void endShape (int closeType)
 
void endShapeClose ()
 
void vertex (float x, float y, float z=0.0f)
 頂点を追加する。beginShape()とendShape()の間で使うこと
 
void vertex (float x, float y, float u, float v)
 
void vertex (float x, float y, float z, float u, float v)
 
void vertex (Vector3 pos)
 
void vertex (Vector3 pos, Vector3 uv)
 
void curveVertex (float x, float y, float z=0.0f)
 曲線の頂点を追加する。beginShape()とendShape()の間で使うこと。CURVE_LINES、CURVE_LINE_STRIPのときのみ使用可能
 
void curveVertex (Vector3 pos)
 
void draw (UShape shape, float x, float y)
 シェイプを描く
 
void draw (UShape shape, float x, float y, float w, float h)
 
void draw (UShape shape, float x, float y, float z)
 
void draw (UShape shape, float x, float y, float z, float w, float h, float d)
 
void draw (UShape shape)
 
void textSize (float size)
 テキストの大きさを設定する
 
void textAlign (int alignX, int alignY=BASELINE)
 テキストの縦横の基準位置を設定する [詳解]
 
Font loadFont (string fontname)
 フォントを読み込む。リソースフォルダにない場合、OSのシステムフォントから同名フォントを探す
 
string [] fontList ()
 OSのシステムフォント名一覧を取得する
 
void textFont (Font font)
 テキスト描画に使うフォントを設定する
 
void textFont (string fontname)
 
GameObject createText (string str, float x, float y, float z=0.0f)
 テキストのシェイプを作成する
 
void text (string str, float x=0.0f, float y=0.0f, float z=0.0f)
 テキストを描く
 
void noLights ()
 ライトを使わないようにする(unlitシェーダー)
 
void lights ()
 ライトを使うようにする(通常のシェーダー)※別途Lightの配置や設定は必要
 
void ambientLight (int r, int g, int b)
 環境光を設定する(シーン全体)
 
Light createDirectionalLight (int r, int g, int b, float nx, float ny, float nz)
 ディレクショナルライトを作る
 
Light directionalLight (Light light, int r, int g, int b, float nx, float ny, float nz)
 ディレクショナルライトを設定する。lightがnullの場合はシーンに新しく追加する
 
void add (UShape shape)
 描画リストにシェイプを追加
 
void remove (UShape shape)
 描画リストからシェイプを削除
 
void rotateRadians ()
 rotate()の回転モードをラジアン単位にする
 
void rotateDegrees ()
 rotate()の回転モードを度単位にする
 
void rotateDegrees (float xAngle, float yAngle, float zAngle)
 
void rotateDegrees (Vector3 eulerAngles)
 
void sphereRadius (bool on)
 sphere()で指定した値をonで半径、offで直径と解釈する
 
void textScale (float s)
 テキストのスケールを設定する
 
void textQuality (float level)
 テキストの品質を設定する
 
Transform getTransform ()
 Unicessing内で座標変換した現在のTransformを返す
 
Vector3 modelPos ()
 現在のワールド位置を返す(getWorldPos()の別名)
 
Vector3 getWorldPos ()
 ワールド座標系での位置を返す
 
Vector3 getLocalPos ()
 ローカル座標系での位置を返す
 
void setWorldPos (float x, float y, float z)
 ワールド座標系で位置を設定する
 
void setWorldPos (Vector3 pos)
 
void setLocalPos (float x, float y, float z)
 ローカル座標系で位置を設定する
 
void setLocalPos (Vector3 pos)
 
Vector3 localToWorldPos (float x, float y, float z=0.0f)
 ローカル座標系での位置を、ワールド座標系での位置に変換する
 
Vector3 localToWorldPos (Vector3 localPos)
 
Vector3 wordlToLocalPos (float x, float y, float z=0.0f)
 ワールド座標系での位置を、ローカル座標系での位置に変換する
 
Vector3 wordlToLocalPos (Vector3 worldPos)
 
Vector3 localToWorldDir (Vector3 localDir)
 ローカル座標系での方向をワールド座標系に変換する
 
Vector3 worldToLocalDir (Vector3 woldDir)
 ワールド座標系での方向をローカル座標系に変換する
 
void setWorldRot (float xAngle, float yAngle, float zAngle)
 ワールド座標系で姿勢を設定する
 
void setWorldRot (Quaternion quat)
 
void setLocalRot (float xAngle, float yAngle, float zAngle)
 ローカル座標系で姿勢を設定する
 
void setLocalRot (Quaternion quat)
 
void lookAtCamera ()
 カメラの方を向かせる
 
void lookAt (float x, float y, float z)
 任意の点の方を向かせる
 
void lookAt (Vector3 worldPosition)
 
void lookAt (Vector3 worldPosition, Vector3 worldUp)
 
void layerAndMask (int layerIndex)
 指定のレイヤーとレイヤーマスクを設定
 
void layerAndMask (string layerName)
 
void layer (int layerIndex)
 レイヤーを設定
 
void layer (string layerName)
 
void beginLayer (string layerName)
 レイヤーを設定を開始。endLayer()で元に戻す
 
void beginLayer (int layerIndex)
 
void endLayer ()
 レイヤーを設定を元に戻す
 
void layerMask (int layerBits)
 レイヤーマスクを設定
 
void layerMask (string layerName)
 
void layerMaskEverything ()
 
void addLayerMask (int layerIndex)
 レイヤーマスクに追加するレイヤーを設定
 
void addLayerMask (string layerName)
 
void removeLayerMask (int layerIndex)
 レイヤーマスクから削除するレイヤーを設定
 
void removeLayerMask (string layerName)
 
void sceneLights ()
 シーンのライトをEnableにする
 
void noSceneLights ()
 シーンのライトをDisableにする
 
void depthStep ()
 DepthStepをデフォルト値に戻す
 
void depthStep (float step)
 DepthStepを設定する
 
void noDepthStep ()
 DepthStepを0にして、描画の重ねあわせの深さを自動的に変えないようにする
 
GameObject loadPrefab (string path)
 プレハブをリソースフォルダから読み込む
 
GameObject createObj (GameObject prefabObj)
 プレハブからGameObjectを作成(Instantiate)し、いったん非アクティブにする
 
void dispObj (GameObject createdObj)
 createObj()していたGameObjectをアクティブにして表示する
 
void dispObj (GameObject createdObj, float x, float y, float z=0.0f, float sx=1.0f, float sy=1.0f, float sz=1.0f)
 
void dispObj (GameObject createdObj, Vector3 pos, Vector3 scale)
 
GameObject entryObj (GameObject prefabObj)
 プレハブからこのフレームだけ一時的にオブジェクトを作成して描く
 
GameObject entryObj (GameObject prefabObj, float x, float y, float z=0.0f, float sx=1.0f, float sy=1.0f, float sz=1.0f)
 
GameObject entryObj (GameObject prefabObj, Vector3 pos, Vector3 scale)
 
GameObject draw (GameObject obj)
 GameObjectを描く。渡したオブジェクトが非アクティブならdipsObj()を、アクティブならentryObj()を呼ぶ
 
GameObject draw (GameObject obj, float x, float y, float z=0.0f, float sx=1.0f, float sy=1.0f, float sz=1.0f)
 
GameObject draw (GameObject obj, Vector3 pos, Vector3 scale)
 
void destroyObj (GameObject obj)
 GameObjectを破棄する
 
void mesh (Mesh mesh, float x, float y, float z=0.0f, float sx=1.0f, float sy=1.0f, float sz=1.0f, bool enableMaterial=true)
 メッシュを描く
 
void mesh (Mesh mesh, Vector3 pos, Vector3 scale, bool enableMaterial=true)
 
void mesh (GameObject inMeshObj, float x, float y, float z=0.0f, float sx=1.0f, float sy=1.0f, float sz=1.0f, bool enableMaterial=true)
 GameObjectが持つメッシュを描く
 
void mesh (GameObject inMeshObj, Vector3 pos, Vector3 scale, bool enableMaterial=true)
 
void flushSystemShapes ()
 システムでまとめているシェイプを描き出す
 
void add (USubGraphics sg)
 USubGraphicsをリストに追加する。※USubGraphicsはStart()時に自動的にこの処理を行うので、独自に呼ぶ必要はない
 
void remove (USubGraphics sg)
 USubGraphicsをリストから削除する。※USubGraphicsはOnDestroy()時に自動的にこの処理を行うので、独自に呼ぶ必要はない
 
USubGraphics createSubGraphics (System.Action< UGraphics > customDraw=null)
 UGprahicsを共有して描画できるUSubGraphicsを作成する
 
USubGraphics createSubGraphics (string name="SubGraphics", System.Action< GameObject > preInit=null, System.Action< USubGraphics > postInit=null, System.Action< UGraphics > customDraw=null)
 
createSubGraphics< T > (string name="SubGraphics", System.Action< GameObject > preInit=null, System.Action< T > postInit=null, System.Action< UGraphics > customDraw=null)
 UGprahicsを共有して描画できるUSubGraphicsを作成する [詳解]
 
- 基底クラス Unicessing.UResource に属する継承公開メンバ関数
string getResourceName (string path)
 
string loadTextFromResources (string path)
 
delegate void OnLoadCompleteStringArray (string[] text)
 
void loadTextFromURL (string url, OnLoadCompleteStringArray onComplete)
 
void loadTextFromURL (string url, Action< string > onComplete)
 
IEnumerator loadTextFromURL_corutine (string url, Action< string > onCompleate)
 
string loadTextFromLocalFile (string path)
 
string loadStringText (string filename, Action< string > onComplete=null)
 
void saveTextToLocalFile (string path, string[] data)
 
void saveStringText (string path, string data)
 
void loadScene (string name)
 
void addScene (string name)
 
- 基底クラス Unicessing.UInput に属する継承公開メンバ関数
bool isKey (KeyCode keyCode)
 
bool isKeyDown (KeyCode keyCode)
 
bool isKeyUp (KeyCode keyCode)
 
bool isKey (string keyName)
 
bool isKeyDown (string keyName)
 
bool isKeyUp (string keyName)
 
float inputAxis (string name)
 
Vector2 touch (int index)
 
bool isButton (string name)
 
bool isButtonDown (string name)
 
bool isButtonUp (string name)
 
RaycastHit raycastScreen (float distance=INFINITY, int layerMask=-1)
 
RaycastHit raycastScreen (float x, float y, float distance=INFINITY, int layerMask=-1)
 
void updateMouse3D ()
 
Vector3 planeMousePos (float x, float y, float z)
 
Vector3 planeMousePos (Vector3 planePos)
 
Vector3 planeMousePos (Vector3 planePos, Vector3 planeNormal)
 
Vector3 planeHitPos (Vector3 rayOrigin, Vector3 rayDirection, Vector3 planePos, Vector3 planeNormal)
 
- 基底クラス Unicessing.UCamera に属する継承公開メンバ関数
void InitCamera ()
 
void background (float gray)
 
void background (float r, float g, float b)
 
void background (Color col)
 
void backgroundFlags (CameraClearFlags flags)
 
void backgroundSkybox ()
 
RaycastHit raycast (Vector3 origin, Vector3 direction, float distance=INFINITY, int layerMask=-1)
 
RaycastHit2D raycast (Vector2 origin, Vector2 direction, float distance=INFINITY, int layerMask=-1)
 
- 基底クラス Unicessing.UMath に属する継承公開メンバ関数
void frameRate (int fps)
 
int day ()
 
int hour ()
 
int millis ()
 
int minute ()
 
int month ()
 
int second ()
 
int year ()
 
float abs (float f)
 
int ceil (float f)
 
float constrain (float amt, float low, float high)
 
float dist (float x1, float y1, float x2, float y2)
 
float dist (float x1, float y1, float z1, float x2, float y2, float z2)
 
float exp (float f)
 
int floor (float f)
 
float lerp (float start, float stop, float amt)
 
float log (float f)
 
float min (float a, float b)
 
float min (float a, float b, float c)
 
float min (params float[] values)
 
float max (float a, float b)
 
float max (float a, float b, float c)
 
float max (params float[] values)
 
int min (int a, int b)
 
int min (int a, int b, int c)
 
int max (int a, int b)
 
int max (int a, int b, int c)
 
float sq (float f)
 
float sqrt (float f)
 
float acos (float f)
 
float asin (float f)
 
float atan (float f)
 
float atan2 (float y, float x)
 
float cos (float f)
 
float sin (float f)
 
float tan (float f)
 
float degrees (float rad)
 
float radians (float deg)
 
float noise (float x)
 
float noise (float x, float y)
 
float random (float low, float high)
 
float random (float high)
 
void randomSeed (int seed)
 
int random (int high)
 
int random (int low, int high)
 
string nf (int num, int digits)
 
string nf (float num, int left, int right)
 
string nfs (int num, int digits)
 
string nfs (float num, int left, int right)
 
string nfp (int num, int digits)
 
string nfp (float num, int left, int right)
 
string nfc (int num)
 
string nfc (int num, int right)
 
string [] split (string value, char delim)
 
string [] splitTokens (string value, string delim="¥t¥n¥r¥f ")
 
string trim (string value)
 
string join (string[] stringArray, string separator)
 
float modulo (float a, float b)
 
Vector3 randomVec2 ()
 
Vector3 randomVec3 ()
 
Vector3 randomUnitVec3 ()
 
Vector3 randomScaleVec3 (float r)
 
Vector3 curvePos (Vector3 v0, Vector3 v1, Vector3 v2, Vector3 v3, float t)
 
- 基底クラス Unicessing.UConstants に属する継承公開メンバ関数
Color color (Color baseColor, float alpha=255)
 
Color color (float gray, float alpha=255)
 
Color color (float r, float g, float b, float a=255)
 
bool editorDialog (string title, string message, string ok="OK", string cancel=null)
 

公開変数類

float width = 1.0f
 
float height = 1.0f
 
- 基底クラス Unicessing.UInput に属する継承公開変数類
Transform mousePlane
 
- 基底クラス Unicessing.UCamera に属する継承公開変数類
Camera targetCamera
 
- 基底クラス Unicessing.UConstants に属する継承公開変数類
const int CORNER = -7
 
const int CORNER_P5 = -6
 
const int CENTER = -5
 
const int TOP = -4
 
const int BOTTOM = -3
 
const int BASELINE = -2
 
const int CODED = -1
 
const int NONE = 0
 
const int UP = 1
 
const int DOWN = 2
 
const int LEFT = 3
 
const int RIGHT = 4
 
const int MIDDLE = 5
 
const int SHIFT = 10
 
const int CTRL = 11
 
const int BACKSPACE = 20
 
const int TAB = 21
 
const int ENTER = 22
 
const int RETURN = ENTER
 
const int ESC = 23
 
const int DELETE = 24
 
const AxisMode U3D = AxisMode.U3D
 
const AxisMode P2D = AxisMode.P2D
 
const AxisMode P3D = AxisMode.P3D
 
const UShape.VertexType POINTS = UShape.VertexType.POINTS
 
const UShape.VertexType LINES = UShape.VertexType.LINES
 
const UShape.VertexType LINE_STRIP = UShape.VertexType.LINE_STRIP
 
const UShape.VertexType TRIANGLES = UShape.VertexType.TRIANGLES
 
const UShape.VertexType TRIANGLE_FAN = UShape.VertexType.TRIANGLE_FAN
 
const UShape.VertexType TRIANGLE_STRIP = UShape.VertexType.TRIANGLE_STRIP
 
const UShape.VertexType QUADS = UShape.VertexType.QUADS
 
const UShape.VertexType QUAD_STRIP = UShape.VertexType.QUAD_STRIP
 
const UShape.CloseType CLOSE = UShape.CloseType.CLOSE
 
const ColorMode RGB = ColorMode.RGB
 
const ColorMode HSB = ColorMode.HSB
 
const float INFINITY = Mathf.Infinity
 

限定公開メンバ関数

virtual void Awake ()
 
virtual void Start ()
 
override Vector3 OnUpdateMouse3D (Vector3 pos)
 
virtual void Update ()
 
virtual void Setup ()
 
virtual void Draw ()
 
override Color convertColorSpace (float r, float g, float b, float a)
 色空間モードにあわせて色を変換する
 
- 基底クラス Unicessing.UInput に属する継承限定公開メンバ関数
void InitInput ()
 
virtual void OnMousePressed ()
 
virtual void OnMouseReleased ()
 
virtual void OnMouseMoved ()
 
virtual void OnMouseDragged ()
 
virtual void OnKeyPressed ()
 
virtual void OnKeyTyped ()
 
virtual void UpdateInput ()
 
- 基底クラス Unicessing.UMath に属する継承限定公開メンバ関数
void InitMath ()
 

限定公開変数類

SystemObject system
 

プロパティ

Vector2 axis2D [get]
 現在の座標系モードの軸、スケール
 
Vector3 axis3D [get]
 
bool isP5 [get]
 Processingの座標系モードか?
 
Transform uniTransfrom [get]
 Unicessing内で座標変換した現在のTransform
 
- 基底クラス Unicessing.UInput に属する継承プロパティ
bool mousePressed [get]
 
int mouseButton [get]
 
Vector3 mouse3D [get]
 
Vector3 pmouse3D [get]
 
int cursorX [get]
 
int cursorY [get]
 
float mouseX [get]
 
float mouseY [get]
 
float mouseZ [get]
 
float pmouseX [get]
 
float pmouseY [get]
 
float pmouseZ [get]
 
bool keyPressed [get]
 
float moveMouseX [get]
 
float moveMouseY [get]
 
float dragMouseX [get]
 
float dragMouseY [get]
 
float beginDragMouseX [get]
 
float beginDragMouseY [get]
 
float endDragMouseX [get]
 
float endDragMouseY [get]
 
bool mouseReleased [get]
 
int mouseButtonUp [get]
 
int mouseButtonDown [get]
 
float inputX [get]
 
float inputY [get]
 
bool touchPressed [get]
 
bool touchReleased [get]
 
bool touchDown [get]
 
int touchCount [get]
 
string B_FIRE1 [get]
 
string B_FIRE2 [get]
 
string B_FIRE3 [get]
 
string B_JUMP [get]
 
- 基底クラス Unicessing.UCamera に属する継承プロパティ
int displayWidth [get]
 
int displayHeight [get]
 
static float displayAspectW [get]
 
static float displayAspectH [get]
 
- 基底クラス Unicessing.UMath に属する継承プロパティ
int frameCount [get]
 
float PI [get]
 
float HALF_PI [get]
 
float QUATER_PI [get]
 
float TWO_PI [get]
 
float DEG_TO_RAD [get]
 
float RAD_TO_DEG [get]
 
float frameSec [get]
 
float frameCount60 [get]
 
- 基底クラス Unicessing.UConstants に属する継承プロパティ
static float deltaTime [get]
 
static bool isVR [get]
 

その他の継承メンバ

- 基底クラス Unicessing.UConstants に属する継承公開型
enum  AxisMode { U3D, P2D, P3D }
 
enum  ColorMode { RGB, HSB }
 
- 基底クラス Unicessing.UMath に属する継承静的公開メンバ関数
static float mag (float x, float y)
 
static float mag (float x, float y, float z)
 
static float map (float value, float start1, float stop1, float start2, float stop2)
 
static float norm (float value, float start, float stop)
 
static float pow (float n, float e)
 
static int round (float f)
 
- 基底クラス Unicessing.UConstants に属する継承静的公開メンバ関数
static void println (object message)
 
static void debuglog (object message)
 
static void debuglogWaring (object message)
 
static void debuglogError (object message)
 
static void assert (bool condition, string message=null)
 

詳解


Unicessingによる描画の基本クラス

メソッド詳解

§ beginShape()

void Unicessing.UGraphics.beginShape ( UShape.VertexType  type = UShape.VertexType.LINE_STRIP)

独自のシェイプをbeginShape()で作成開始し、endShape()で描く


beginShape()からendShape()の間に、vertex()またはcurveVertex()を使って頂点を指定し、独自のシェイプを描ける。

引数
kindUShape.ShapeKindのPOINT、LINE、RECT、ELLIPSE、BOX、SPHEREいずれかのシェイプ種別
参照
UShape.ShapeKind

§ createShape()

UShape Unicessing.UGraphics.createShape ( UShape.ShapeKind  kind,
params float []  p 
)

基本形状のシェイプを作成する


kindで指定した基本形状のシェイプを作成する。

引数
kindUShape.ShapeKindのPOINT、LINE、RECT、ELLIPSE、BOX、SPHEREいずれかのシェイプ種別
pシェイプの頂点位置
参照
UShape.ShapeKind

§ createSubGraphics< T >()

T Unicessing.UGraphics.createSubGraphics< T > ( string  name = "SubGraphics",
System.Action< GameObject >  preInit = null,
System.Action< T >  postInit = null,
System.Action< UGraphics customDraw = null 
)

UGprahicsを共有して描画できるUSubGraphicsを作成する


テンプレート引数
TUSubGraphicsまたはその派生クラス
引数
nameGameObjectの名前
preInitGameObject生成時に行いたい処理
postInitUSubGraphicsコンポーネント生成後に行いたい処理
customDrawUSubGraphics描画時に行いたい処理
// Unicessing/Scripts/Samples/UnicessingMenu.cs addButton()
createSubGraphics<UnicessingMenuButton>(name,
obj => {
BoxCollider collider = obj.AddComponent<BoxCollider>();
collider.center = new Vector3(x, y, 0);
collider.size = new Vector3(8, 0.9f, 0.1f);
},
button => {
button.buttonName = name;
button.buttonColor = buttonColor;
button.fontColor = fontColor;
buttonList.Add(button);
}
);
参照
USubGraphics
型制約
T :USubGraphics 

§ scale()

void Unicessing.UGraphics.scale ( float  s)

姿勢を回転させる(現在のrotateModeに関係なく、3軸オイラー角を度単位で回転) 大きさをスケール倍する)

§ size()

void Unicessing.UGraphics.size ( float  width,
float  height,
AxisMode  mode = U3D,
float  scale = 1.0f 
)

widthとheightの大きさ、座標系モード、全体のスケールを指定


UnicessingではCameraを自分でシーンに配置して使うため、size()を省略できる。

引数
widthwidthを参照したときに返したい値。カメラには影響しない
heightheightを参照したときに返したい値。カメラには影響しない
modeデフォルトはU3D。P2D、P3DにするとProcessingの座標系(yとzが逆方向)になる。P2DはnoLights()でスタートする
scaleUnicessingで描画する各種オブジェクトにかかるスケール値
参照
AxisMode

§ textAlign()

void Unicessing.UGraphics.textAlign ( int  alignX,
int  alignY = BASELINE 
)

テキストの縦横の基準位置を設定する


引数
alignX横の基準位置 LEFT, CENTER, RIGHT
alignY縦の基準位置 BASELINE, TOP, CENTER, BOTTOM

このクラス詳解は次のファイルから抽出されました: