private void OnEnable() { m_MaxHp = 1000; m_CurrentHp = m_MaxHp; if (m_weaponController != null) { return; } m_weaponController = GetComponent <WeaponController>(); m_weaponController.AddWeapon(1901, m_GunPos, null); }
public override void OnCollection() { Debug.Log("collected RogersPlasmaWeapon!"); GameObject rogersWeaponGO = GameObject.FindGameObjectWithTag("RogersWeapon"); if (rogersWeaponGO == null) { Debug.LogError("Rogers Weapon GO cannot be found!"); return; } WeaponController rogersWeapon = rogersWeaponGO.GetComponent <WeaponController>(); if (rogersWeapon == null) { Debug.LogError("Rogers Weapon Component cannot be found!"); return; } rogersWeapon.AddWeapon(Instantiate(rogersPlasmaWeapon, new Vector2(0, 0), Quaternion.identity)); DialogueManager dialogueManager = FindObjectOfType <DialogueManager>(); dialogueManager.DisplayDialogue(tutorialDialogue, () => { }); }