Exemplo n.º 1
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        anim = GetComponent <Animator> ();
        playerAudioSource = GetComponent <AudioSource> ();

        bulletPool  = GameObject.Find("PlayerBulletPool").GetComponent <PlayerBulletPool> ();
        gameManager = GameObject.Find("Game Manager").GetComponent <GameManager> ();
    }
Exemplo n.º 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;
    }
Exemplo n.º 4
0
        public void SetupPool()
        {
            GameObject playerPool = new GameObject();

            playerPool.AddComponent <PlayerBulletPool>();

            pool = playerPool.GetComponent <PlayerBulletPool>();
            pool.SetNewPrefab(Resources.Load <DefaultBullet>("PlayerBullet"));
        }
Exemplo n.º 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;
 }
 private void Awake()
 {
     bulletPoolInstance = this;
 }
Exemplo n.º 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;
 }
Exemplo n.º 8
0
 void Awake()
 {
     instance = this;
 }
Exemplo n.º 9
0
 public void Awake()
 {
     pointsToFireFrom = new List<Vector3>();
     pointsToFireFrom.Add(Vector3.up);
     BulletPool = GetComponent<PlayerBulletPool>();
 }
Exemplo n.º 10
0
 private void Awake()
 {
     instance = this;
 }
Exemplo n.º 11
0
 void Awake()
 {
     current = this;
 }