private void Update() { if (attacks.GetActiveWeapon().Equals(GnomeWeapons.Firework) && !fireworkObject.activeSelf) { fireworkObject.SetActive(true); } else if (!attacks.GetActiveWeapon().Equals(GnomeWeapons.Firework) && fireworkObject.activeSelf) { fireworkObject.SetActive(false); } // update line renderer position lr.SetPosition(0, fireworkObject.transform.position); lr.SetPosition(1, fireworkObject.transform.position + transform.forward * 2); }
private void Update() { if (attacks.GetActiveWeapon().Equals(GnomeWeapons.FishingRod) && !fishingRodObject.activeSelf) { fishingRodObject.SetActive(true); } else if (!attacks.GetActiveWeapon().Equals(GnomeWeapons.FishingRod) && fishingRodObject.activeSelf) { fishingRodObject.SetActive(false); } if (hasSwung) { fishingRodObject.transform.GetChild(0).GetComponent <LineRenderer>().SetPosition(0, fishingRodObject.transform.GetChild(0).transform.position); fishingRodObject.transform.GetChild(0).GetComponent <LineRenderer>().SetPosition(1, fishingRodProjectile.transform.position); } }
private void Start() { activeWeapon = gnome.GetActiveWeapon(); UpdateWeapon(weapons[1]); }