Last active
August 29, 2015 13:56
-
-
Save baba-s/9288917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Component型の拡張メソッドを管理するクラス | |
/// </summary> | |
public static class ComponentExtensions | |
{ | |
/// <summary> | |
/// X座標を設定します | |
/// </summary> | |
public static void SetPositionX(this Component component, float x) | |
{ | |
component.transform.SetPositionX(x); | |
} | |
/// <summary> | |
/// Y座標を設定します | |
/// </summary> | |
public static void SetPositionY(this Component component, float y) | |
{ | |
component.transform.SetPositionY(y); | |
} | |
/// <summary> | |
/// Z座標を設定します | |
/// </summary> | |
public static void SetPositionZ(this Component component, float z) | |
{ | |
component.transform.SetPositionZ(z); | |
} | |
/// <summary> | |
/// X座標に加算します | |
/// </summary> | |
public static void AddPositionX(this Component component, float x) | |
{ | |
component.transform.AddPositionX(x); | |
} | |
/// <summary> | |
/// Y座標に加算します | |
/// </summary> | |
public static void AddPositionY(this Component component, float y) | |
{ | |
component.transform.AddPositionY(y); | |
} | |
/// <summary> | |
/// Z座標に加算します | |
/// </summary> | |
public static void AddPositionZ(this Component component, float z) | |
{ | |
component.transform.AddPositionZ(z); | |
} | |
/// <summary> | |
/// ローカルのX座標を設定します | |
/// </summary> | |
public static void SetLocalPositionX(this Component component, float x) | |
{ | |
component.transform.SetLocalPositionX(x); | |
} | |
/// <summary> | |
/// ローカルのY座標を設定します | |
/// </summary> | |
public static void SetLocalPositionY(this Component component, float y) | |
{ | |
component.transform.SetLocalPositionY(y); | |
} | |
/// <summary> | |
/// ローカルのZ座標を設定します | |
/// </summary> | |
public static void SetLocalPositionZ(this Component component, float z) | |
{ | |
component.transform.SetLocalPositionZ(z); | |
} | |
/// <summary> | |
/// ローカルのX座標に加算します | |
/// </summary> | |
public static void AddLocalPositionX(this Component component, float x) | |
{ | |
component.transform.AddLocalPositionX(x); | |
} | |
/// <summary> | |
/// ローカルのY座標に加算します | |
/// </summary> | |
public static void AddLocalPositionY(this Component component, float y) | |
{ | |
component.transform.AddLocalPositionY(y); | |
} | |
/// <summary> | |
/// ローカルのZ座標に加算します | |
/// </summary> | |
public static void AddLocalPositionZ(this Component component, float z) | |
{ | |
component.transform.AddLocalPositionZ(z); | |
} | |
/// <summary> | |
/// X軸方向の回転角を設定します | |
/// </summary> | |
public static void SetEulerAngleX(this Component component, float x) | |
{ | |
component.transform.SetEulerAngleX(x); | |
} | |
/// <summary> | |
/// Y軸方向の回転角を設定します | |
/// </summary> | |
public static void SetEulerAngleY(this Component component, float y) | |
{ | |
component.transform.SetEulerAngleY(y); | |
} | |
/// <summary> | |
/// Z軸方向の回転角を設定します | |
/// </summary> | |
public static void SetEulerAngleZ(this Component component, float z) | |
{ | |
component.transform.SetEulerAngleZ(z); | |
} | |
/// <summary> | |
/// X軸方向の回転角を加算します | |
/// </summary> | |
public static void AddEulerAngleX(this Component component, float x) | |
{ | |
component.transform.AddEulerAngleX(x); | |
} | |
/// <summary> | |
/// Y軸方向の回転角を加算します | |
/// </summary> | |
public static void AddEulerAngleY(this Component component, float y) | |
{ | |
component.transform.AddEulerAngleY(y); | |
} | |
/// <summary> | |
/// Z軸方向の回転角を加算します | |
/// </summary> | |
public static void AddEulerAngleZ(this Component component, float z) | |
{ | |
component.transform.AddEulerAngleZ(z); | |
} | |
/// <summary> | |
/// ローカルのX軸方向の回転角を設定します | |
/// </summary> | |
public static void SetLocalEulerAngleX(this Component component, float x) | |
{ | |
component.transform.SetLocalEulerAngleX(x); | |
} | |
/// <summary> | |
/// ローカルのY軸方向の回転角を設定します | |
/// </summary> | |
public static void SetLocalEulerAngleY(this Component component, float y) | |
{ | |
component.transform.SetLocalEulerAngleY(y); | |
} | |
/// <summary> | |
/// ローカルのZ軸方向の回転角を設定します | |
/// </summary> | |
public static void SetLocalEulerAngleZ(this Component component, float z) | |
{ | |
component.transform.SetLocalEulerAngleZ(z); | |
} | |
/// <summary> | |
/// ローカルのX軸方向の回転角を加算します | |
/// </summary> | |
public static void AddLocalEulerAngleX(this Component component, float x) | |
{ | |
component.transform.AddLocalEulerAngleX(x); | |
} | |
/// <summary> | |
/// ローカルのY軸方向の回転角を加算します | |
/// </summary> | |
public static void AddLocalEulerAngleY(this Component component, float y) | |
{ | |
component.transform.AddLocalEulerAngleY(y); | |
} | |
/// <summary> | |
/// ローカルのX軸方向の回転角を加算します | |
/// </summary> | |
public static void AddLocalEulerAngleZ(this Component component, float z) | |
{ | |
component.transform.AddLocalEulerAngleZ(z); | |
} | |
/// <summary> | |
/// X軸方向のローカル座標系のスケーリング値を設定します | |
/// </summary> | |
public static void SetLocalScaleX(this Component component, float x) | |
{ | |
component.transform.SetLocalScaleX(x); | |
} | |
/// <summary> | |
/// Y軸方向のローカル座標系のスケーリング値を設定します | |
/// </summary> | |
public static void SetLocalScaleY(this Component component, float y) | |
{ | |
component.transform.SetLocalScaleY(y); | |
} | |
/// <summary> | |
/// Z軸方向のローカル座標系のスケーリング値を設定します | |
/// </summary> | |
public static void SetLocalScaleZ(this Component component, float z) | |
{ | |
component.transform.SetLocalScaleZ(z); | |
} | |
/// <summary> | |
/// X軸方向のローカル座標系のスケーリング値を加算します | |
/// </summary> | |
public static void AddLocalScaleX(this Component component, float x) | |
{ | |
component.transform.AddLocalScaleX(x); | |
} | |
/// <summary> | |
/// Y軸方向のローカル座標系のスケーリング値を加算します | |
/// </summary> | |
public static void AddLocalScaleY(this Component component, float y) | |
{ | |
component.transform.AddLocalScaleY(y); | |
} | |
/// <summary> | |
/// Z軸方向のローカル座標系のスケーリング値を加算します | |
/// </summary> | |
public static void AddLocalScaleZ(this Component component, float z) | |
{ | |
component.transform.AddLocalScaleZ(z); | |
} | |
/// <summary> | |
/// 親オブジェクトを設定します | |
/// </summary> | |
public static void SetParent(this Component component, Transform parent) | |
{ | |
component.transform.parent = parent; | |
} | |
/// <summary> | |
/// 親オブジェクトを設定します | |
/// </summary> | |
public static void SetParent(this Component component, GameObject parent) | |
{ | |
component.transform.parent = parent.transform; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment