예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        instance = GameManager.instance;
        Assert.IsNotNull(instance, "Weapon Loader could not find Game Manager.");
        messenger = FindObjectOfType <WeaponMessenger>();
        Assert.IsNotNull(messenger, "Weapon Loader could not find Weapon Messenger.");
        setter = gameObject.GetComponent <WeaponSetter>();
        Assert.IsNotNull(setter, "Weapon Loader could not find Weapon Setter.");
        ui = gameObject.GetComponent <WeaponUI>();
        Assert.IsNotNull(ui, "Weapon Loader could not find Weapon UI.");

        weaponsLoaded = instance.Weapons.Count > 0;
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        instance  = GameManager.instance;
        loader    = GetComponent <WeaponLoader>();
        messenger = FindObjectOfType <WeaponMessenger>();
        setter    = GetComponent <WeaponSetter>();
        ui        = GetComponent <WeaponUI>();

        Assert.IsNotNull(instance, "Weapon Saver could not locate Game Manager");
        Assert.IsNotNull(loader, "Weapon Saver could not locate Weapon Loader.");
        Assert.IsNotNull(messenger, "Weapon Saver could not locate Weapon Messenger.");
        Assert.IsNotNull(setter, "Weapon Saver could not locate Weapon Setter.");
        Assert.IsNotNull(ui, "Weapon Saver could not locate Weapon Ui.");
    }
예제 #3
0
    // 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."));
    }