private void Start() { exerciseConnection = FindObjectOfType <ExerciseConnection>(); reflectedEntity = GetComponent <ReflectedEntity>(); if (exerciseConnection == null || reflectedEntity == null) { Destroy(this); } entityId = reflectedEntity.EntityId; exerciseConnection.SubscribeFireInteraction(FireInteractionHandler); }
void Start() { ReflectedEntities = GetComponent <ReflectedEntities>(); ExerciseConnection.SubscribeFireInteraction(CreateNewFire); //if there isn't a main camera in the start, wait a second and try again. if (Camera.main != null) { AudioListener = Camera.main.GetComponent <AudioListener>(); } else { new Timer(1f, () => { AudioListener = Camera.main.GetComponent <AudioListener>(); }); } OneOverSpeedOfSound = 1f / 343f; tracerBullerFlare = Resources.Load <Flare>("Tracer Bullet Lens Flare/TracerBulletFlare"); }