Created
November 27, 2013 14:10
-
-
Save yumehachi/7676274 to your computer and use it in GitHub Desktop.
Transformの設定
This file contains 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; | |
using System.Collections; | |
/// <summary> | |
/// Utility | |
/// </summary> | |
/// <author> | |
/// Create by yumehachi on 2013/11/27 | |
/// </author> | |
public static class Utility | |
{ | |
public static void SetTransformPositionX (this Transform transform, float x) | |
{ | |
Vector3 newPosition = new Vector3 (x, transform.position.y, transform.position.z); | |
transform.position = newPosition; | |
} | |
public static void SetTransformPositionY (this Transform transform, float y) | |
{ | |
Vector3 newPosition = new Vector3 (transform.position.x, y, transform.position.z); | |
transform.position = newPosition; | |
} | |
public static void SetTransformPositionZ (this Transform transform, float z) | |
{ | |
Vector3 newPosition = new Vector3 (transform.position.x, transform.position.y, z); | |
transform.position = newPosition; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment