private void Awake()
    {
        //allows all players to run this
        sceneScript   = GameObject.Find("SceneReference").GetComponent <SceneReference>().sceneScript;
        setNameButton = GameObject.Find("SceneReference").GetComponent <SceneReference>().setNameButton;



        // disable all weapons
    }
Example #2
0
    private void Awake()
    {
        //allows all players to run this
        sceneScript   = GameObject.Find("SceneReference").GetComponent <SceneReference>().sceneScript;
        setNameButton = GameObject.Find("SceneReference").GetComponent <SceneReference>().setNameButton;

        anim = GetComponent <Animator>();

        // disable all weapons
        foreach (var item in weaponArray)
        {
            if (item != null)
            {
                item.SetActive(false);
            }
            if (selectedWeaponLocal < weaponArray.Length && weaponArray[selectedWeaponLocal] != null)
            {
                activeWeapon = weaponArray[selectedWeaponLocal].GetComponent <Weapon>();
                sceneScript.UIAmmo(activeWeapon.weaponAmmo);
                weaponArray[selectedWeaponLocal].SetActive(true);
            }
        }
    }