private bool shot; // a toggle for when we have shot the laser #endregion Fields #region Methods void Start() { // creating the two line renderers to initialise our variables laserL = new LineRenderer(); laserR = new LineRenderer(); // initialising eye positions EyeL = transform.Find("EyeL"); EyeR = transform.Find("EyeR"); // finding the BotControlScript on the root parent of the character botCtrl = transform.root.GetComponent<BotControlScriptPart2>(); // setting up the audio component GetComponent<AudioSource>().loop = true; GetComponent<AudioSource>().playOnAwake = false; }
private bool shot; // a toggle for when we have shot the laser void Start() { // creating the two line renderers to initialise our variables laserL = new LineRenderer(); laserR = new LineRenderer(); // initialising eye positions EyeL = transform.Find("EyeL"); EyeR = transform.Find("EyeR"); // finding the BotControlScript on the root parent of the character botCtrl = transform.root.GetComponent <BotControlScriptPart2>(); // setting up the audio component GetComponent <AudioSource>().loop = true; GetComponent <AudioSource>().playOnAwake = false; }