コード例 #1
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
コード例 #2
0
    void Start()
    {
        anim = GetComponent <Animator> ();
        playerAudioSource = GetComponent <AudioSource> ();

        bulletPool  = GameObject.Find("PlayerBulletPool").GetComponent <PlayerBulletPool> ();
        gameManager = GameObject.Find("Game Manager").GetComponent <GameManager> ();
    }
コード例 #3
0
    PlayerBulletPool playerBulletPool; //PlayerBulletPoolのスクリプト


    // Start is called before the first frame update
    void Start()
    {
        rb2d             = GetComponent <Rigidbody2D>();                                          //Rigidbody2Dコンポーネント取得
        anim             = GetComponent <Animator>();                                             //Animatorコンポーネント取得
        groundCheck      = GameObject.Find("GroundCheck").GetComponent <GroundCheck>();           //GroundCheckコンポーネント取得
        playerBulletPool = GameObject.Find("PlayerBulletPool").GetComponent <PlayerBulletPool>(); //PlayerBulletPoolスクリプトを取得
        bullet_count     = magazine_size;
    }
コード例 #4
0
        public void SetupPool()
        {
            GameObject playerPool = new GameObject();

            playerPool.AddComponent <PlayerBulletPool>();

            pool = playerPool.GetComponent <PlayerBulletPool>();
            pool.SetNewPrefab(Resources.Load <DefaultBullet>("PlayerBullet"));
        }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     //rb2d = GetComponent<Rigidbody2D>();
     shields          = transform.GetChild(0);
     startingRotation = shields.transform.rotation;
     pool             = GetComponent <PlayerBulletPool>();
     ammoGUI          = FindObjectOfType(typeof(AmmoGUIScript)) as AmmoGUIScript;
     energyBar        = FindObjectOfType(typeof(EnergyBarScript)) as EnergyBarScript;
     actualAmmo       = ammoCount;
 }
コード例 #6
0
 private void Awake()
 {
     bulletPoolInstance = this;
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     //rb2d = GetComponent<Rigidbody2D>();
     shields = transform.GetChild(0);
     startingRotation = shields.transform.rotation;
     pool = GetComponent<PlayerBulletPool>();
     ammoGUI = FindObjectOfType(typeof (AmmoGUIScript)) as AmmoGUIScript;
     energyBar = FindObjectOfType(typeof(EnergyBarScript)) as EnergyBarScript;
     actualAmmo = ammoCount;
 }
コード例 #8
0
 void Awake()
 {
     instance = this;
 }
コード例 #9
0
 public void Awake()
 {
     pointsToFireFrom = new List<Vector3>();
     pointsToFireFrom.Add(Vector3.up);
     BulletPool = GetComponent<PlayerBulletPool>();
 }
コード例 #10
0
 private void Awake()
 {
     instance = this;
 }
コード例 #11
0
 void Awake()
 {
     current = this;
 }