Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created March 22, 2014 10:03
Show Gist options
  • Select an option

  • Save baba-s/9704072 to your computer and use it in GitHub Desktop.

Select an option

Save baba-s/9704072 to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
/// <summary>
/// Transform型の拡張メソッドを管理するクラス
/// </summary>
public static partial class TransformExtensions
{
/// <summary>
/// 子となっているオブジェクトをゲームオブジェクトの名前から取得します
/// </summary>
/// <param name="transform">Transform型のインスタンス</param>
/// <param name="name">ゲームオブジェクトの名前</param>
/// <returns>子となっているオブジェクト</returns>
public static GameObject FindGameObject(this Transform transform, string name)
{
return transform.Find(name).gameObject;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment