Beispiel #1
0
 void Awake()
 {
     Rigidbody rb = GetComponent<Rigidbody> ();
     if (rb) {
         rb.isKinematic = true;
         rb.useGravity = false;
     }
     world = GameWorld.Instance;
     world.Register (this);
     mover = GetComponent<EntityMover> ();
     audioSource = GetComponent<AudioSource> ();
     float rndFactor = StandardGameSettings.Get.entityPitchRandomization;
     audioSource.pitch = Random.Range (1f - rndFactor, 1f + rndFactor);
     audioSource.playOnAwake = false;
     audioSource.loop = true;
     OnAwake ();
 }