// Start is called before the first frame update
    void Start()
    {
        setter = FindObjectOfType <WeaponSetter>();
        Assert.IsNotNull(setter, "Weapon Messenger could not locate Weapon Setter.");
        ui = FindObjectOfType <WeaponUI>();
        Assert.IsNotNull(ui, "Weapon Messenger could not locate Weapon UI.");

        defaultColor = GetComponent <Text>().color;
    }
Esempio n. 2
0
 private void PistolShoot()
 {
     if (Input.GetKeyDown(KeyCode.Mouse0) && WeaponSetter.GetActiveWeapon() == "Pistol")
     {
         myAnimator.SetTrigger("PistolShoot");
         GameObject bulletInstantiation = Instantiate(bullet, transform.position, shoulderParent.transform.rotation);
         Destroy(bulletInstantiation, timeToDestroyBullet);
     }
 }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     instance = GameManager.instance;
     Assert.IsNotNull(instance, "Weapon Rule Manager could not find Game Manager.");
     Assert.IsNotNull(searchField, "Search Field has not been assigned to Weapon Rule Manager.");
     setter = GetComponent <WeaponSetter>();
     Assert.IsNotNull(setter, "Weapon Rule Manager could not find Weapon Setter.");
     ui = GetComponent <WeaponUI>();
     Assert.IsNotNull(ui, "Weapon Rule Manager could not find Weapon UI.");
 }
Esempio n. 4
0
    // 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);
    }
Esempio n. 5
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;
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        instance = GameManager.instance;
        Assert.IsNotNull(instance, "Can not find Game Manger.");
        loader = FindObjectOfType <WeaponLoader>();
        Assert.IsNotNull(loader, "Can not find Rule Loader.");
        setter = FindObjectOfType <WeaponSetter>();
        Assert.IsNotNull(setter, "Can not find Rule Setter.");
        ui = FindObjectOfType <WeaponUI>();
        Assert.IsNotNull(ui, "Can not find Rule UI.");

        GetComponent <Button>().onClick.AddListener(LoadWeapon);
    }
Esempio n. 7
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.");
    }
Esempio n. 8
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."));
    }