Exemple #1
0
  // Start is called before the first frame update
  void Start()
  {
      MGAmmo      = maxmg;
      pistolAmmo  = maxpistol;
      shotgunAmmo = maxsg;
      ARAmmo      = maxar;
      //gun_animator = this.anim
      firing           = false;
      MusicSource.clip = Pistol;
      //   fullAuto = false;
      headshot = false;
      //   isBig = false;
      wpnNum = 0;
      AmmoCounter(0);
      outofAmmo = false;
      //fps = other.GetComponent<UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController.MovementSettings>();
      useA = false;
      useS = false;
      useM = false;
      if (lvl1)
      {
          objectivedisplay.showObjective("Investigate The Enemy Compound", 5);
          currentObj   = "Investigate The Enemy Compound";
          pistolAmmo   = 0;
          shotgunAmmo  = 5;
          MGAmmo       = maxmg;
          ARAmmo       = 30;
          other.canRun = false;

          AmmoCounter(0);
      }
  }
    private void OnTriggerEnter(Collider other)
    {
        {
            if (other.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>() && firsttime)
            {
                firsttime = false;
                if (changeObj)
                {
                    objdis.showObjective(obj);
                    player.currentObj = obj;
                }
                if (spawnenem)
                {
                    for (int i = 0; i < spawns.Length; i++)
                    {
                        spawns[i].triggered = true;
                    }
                }
                if (destroy)
                {
                    Destroy(this.gameObject);
                }

                if (changemusic)
                {
                    mp.changeSong(songnum);
                }
            }
        }
    }