Skip to content

Instantly share code, notes, and snippets.

@binocchi
Created September 15, 2015 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binocchi/d2c7ea0d5689d97415e2 to your computer and use it in GitHub Desktop.
Save binocchi/d2c7ea0d5689d97415e2 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour
{
public GameObject playerObject01;
public GameObject playerObject02;
void Awake()
{
// ゲームオブジェクト名でシーン内を検索
playerObject01 = GameObject.Find("Player");
// タグ名でシーン内を検索
playerObject02 = GameObject.FindGameObjectsWithTag("Player");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment