// Start is called before the first frame update void Start() { manager = FindObjectOfType <WeaponRuleManager>(); Assert.IsNotNull(manager, "Weapon Rule Button can not locate Weapon Rule Manager."); setter = FindObjectOfType <WeaponSetter>(); Assert.IsNotNull(setter, "Weapon Rule Button can not locate Weapon Setter."); ui = FindObjectOfType <WeaponUI>(); Assert.IsNotNull(ui, "Weapon Rule Button can not locate Weapon UI."); GetComponent <Button>().onClick.AddListener(AddRemoveRule); }
// Start is called before the first frame update void Start() { Assert.IsNotNull(PanelMelee, "The Melee Panel has not been added to the Weapon UI."); Assert.IsNotNull(PanelRange, "The Range Panel has not been added to the Weapon UI."); Assert.IsNotNull(InputStrength, "The Strength Input has not been added to the Weapon UI."); Assert.IsNotNull(DropdownStrength, "The Strength Dropdown has not been added to the Weapon UI."); Assert.IsNotNull(InputAP, "The AP Input has not been added to the Weapon UI."); Assert.IsNotNull(DropdownAP, "The AP Dropdown has not been added to the Weapon UI."); Assert.IsNotNull(InputDamage, "The Damage Input has not been added to the Weapon UI."); Assert.IsNotNull(DropdownDamage, "The Damage Dropdown has not been added to the Weapon UI."); Assert.IsNotNull(InputRange, "The Range Input has not been added to the Weapon UI."); Assert.IsNotNull(DropdownRange, "The Range Dropdown has not been added to the Weapon UI."); Assert.IsNotNull(InputShots, "The Shots Input has not been added to the Weapon UI."); Assert.IsNotNull(DropdownShots, "The Shots Dropdown has not been added to the Weapon UI."); Assert.IsNotNull(panelAddRules, "The Rules Panel has not been added to the Weapon UI."); Assert.IsNotNull(contentRules, "The Rules Content ui object has not been added to the Weapon UI."); Assert.IsNotNull(buttonWeaponRule, "The Rule Button has not been added to the Weapon UI."); Assert.IsNotNull(panelRulesAdded, "The Rules Added panel has not been added to the Weapon UI."); Assert.IsNotNull(panelRemoveRule, "The Remove Rule panel has not been added to the Weapon UI."); Assert.IsNotNull(buttonSave, "The Save Button has not been added to the Weapon UI."); Assert.IsNotNull(panelNameCheck, "The Name Check Panel has not been added to the Weapon UI."); Assert.IsNotNull(buttonLoad, "The Load Button has not been added to the Weapon UI."); Assert.IsNotNull(panelLoad, "The Load Panel has not been added to the Weapon UI."); Assert.IsNotNull(contentLoad, "The Load Content ui object has not been added to the Weapon UI."); instance = GameManager.instance; Assert.IsNotNull(instance, "The Weapon UI could not find the Game Manager."); loader = gameObject.GetComponent <WeaponLoader>(); Assert.IsNotNull(loader, "The Weapon UI could not find the Weapon Loader."); manager = gameObject.GetComponent <WeaponRuleManager>(); Assert.IsNotNull(manager, "The Weapon UI could not find the Weapon Rule Manager."); messenger = FindObjectOfType <WeaponMessenger>(); Assert.IsNotNull(messenger, "The Weapon UI could not find the Weapon Messenger."); setter = gameObject.GetComponent <WeaponSetter>(); Assert.IsNotNull(setter, "The Weapon UI could not find the Weapon Setter."); defaultColor = InputRange.GetComponentInChildren <Text>().color; if (instance.Weapons.Count > 0) { buttonLoad.interactable = true; } StartCoroutine(messenger.DisplayMessage("Fill in the weapon's profile.")); }