Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        guns       = gameObject.GetComponents <ShootingBase>();
        ammoScript = gameObject.GetComponent <AmmoControl>();

        RerollGun();
    }
 // Use this for initialization
 void Start()
 {
     gameManager      = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
     health           = 4;
     ammoControl      = canvasObject.GetComponent <AmmoControl>();
     pistolShot       = GetComponent <AudioSource>();
     maxSpeed         = 15;
     walkSpeed        = 5.5f;
     curSpeed         = 5;
     animator         = gameObject.GetComponent <Animator>();
     body             = this.GetComponent <Rigidbody2D>();
     renderer         = this.gameObject.GetComponent <SpriteRenderer>();
     spotlightObject  = GameObject.FindGameObjectWithTag("Spotlight");
     pointLightObject = GameObject.FindGameObjectWithTag("PointLight");
     spotlight        = spotlightObject.GetComponent <Light>();
     pointLight       = pointLightObject.GetComponent <Light>();
     playerSoundArray = GetComponentsInChildren <AudioSource>();
 }
Exemple #3
0
    protected float FireRateTickingCooldown; //The ticking cooldown between shots

    // Start is called before the first frame update
    void Start()
    {
        ammoScript = gameObject.GetComponent <AmmoControl>();
        FireRateTickingCooldown = 0.0f;
    }