예제 #1
0
    // Use this for initialization
    void Start()
    {
        playerAudioSource = GetComponent <AudioSource>();
        playerBody        = GetComponent <Rigidbody2D>();

        objPooler = FindObjectOfType <bulletPooler>();

        accleStartY = Input.acceleration.y; // mobile

        // get PlayerHealth script
        playerHealth = GetComponent <PlayerHealth>();

        // player set initial position
        //float h = CrossPlatformInputManager.GetAxis("Horizontal");
        //   float v = CrossPlatformInputManager.GetAxis("Vertical");
        // Vector2 _dir = new Vector2(h, v);
        //  movePlayer(_dir);

        // firing autometically
        InvokeRepeating("FireBtn", 3f, fireRate);
        //InvokeRepeating ("muzzleFlash",3f,fireRate);
    }
예제 #2
0
 private void Awake()
 {
     Instance = this;
 }