// Use this for initialization void Start() { keepweaponScript = GameObject.FindGameObjectWithTag("Player").GetComponent <keepWeapon>(); switchweaponsScript = GameObject.FindGameObjectWithTag("WeaponContainer").GetComponent <SwitchWeapons>(); //switchweaponsScript.Persistence(); LevelProgression.MasterLevelMultiplier += 1; Debug.Log("GameStarted working" + gameObject.name); }
public AudioClip gunclock, pistolsfx, shotgunsfx, riflesfx; // sound effects // Use this for initialization void Start() { anim = GetComponent <Animator>(); // gets animator on this gameobject SwitchScript = GetComponent <SwitchWeapons>(); // gets switchweapons script on this gameobject moveInput = moveJoystick.GetComponent <MoveVirtualJoystick>(); // gets move joystick script shootInput = shootJoystick.GetComponent <ShootVirtualJoystick>(); // gets shoot joystick script audiosource = GetComponent <AudioSource>(); // used to access audio source component sounds = new AudioClip[] { gunclock, pistolsfx, shotgunsfx, riflesfx }; // puts all sound fx in an array for easy access. }
// Use this for initialization void Start() { pickedupWeapon = gameObject; maceTransform = GameObject.Find("MaceTransform").GetComponent <Transform>(); hammerTransform = GameObject.Find("HammerTransform").GetComponent <Transform>(); battleaxeTransform = GameObject.Find("BattleAxeTransform").GetComponent <Transform>(); scytheTransform = GameObject.Find("ScytheTransform").GetComponent <Transform>(); hoeTransform = GameObject.Find("HoeTransform").GetComponent <Transform>(); forkTransform = GameObject.Find("ForkTransform").GetComponent <Transform>(); dualdaggersTransform = GameObject.Find("DualDaggersTransform").GetComponent <Transform>(); gunTransform = GameObject.Find("GunTransform").GetComponent <Transform>(); hammerandsickleTransform = GameObject.Find("HammerandSickleTransform").GetComponent <Transform>(); maceAnimator = GameObject.Find("lowpolymaceanimator").GetComponent <Animator>(); swordAnimator = GameObject.Find("lowpolyswordanimator").GetComponent <Animator>(); hammerAnimator = GameObject.Find("lowpolyhammeranimator").GetComponent <Animator>(); scytheAnimator = GameObject.Find("scytheanimator").GetComponent <Animator>(); hoeAnimator = GameObject.Find("hoeanimator").GetComponent <Animator>(); forkAnimator = GameObject.Find("forkanimator").GetComponent <Animator>(); dagger1Animator = GameObject.Find("dagger1animator").GetComponent <Animator>(); gunAnimator = GameObject.Find("gunanimator").GetComponent <Animator>(); dagger2Animator = GameObject.Find("dagger2animator").GetComponent <Animator>(); speartransform = GameObject.Find("SpearTransform").GetComponent <Transform>(); weaponcontainer = GameObject.FindGameObjectWithTag("WeaponContainer"); switchWeaponsScript = weaponcontainer.GetComponent <SwitchWeapons>(); playersWeapon = switchWeaponsScript.gameObject.transform.GetChild(0).gameObject; weaponsarray = switchWeaponsScript.weapons; weaponZeroRW = switchWeaponsScript.weaponZero; weaponOneRW = switchWeaponsScript.weaponOne; thiss = this; }
// Use this for initialization void Start() { pauseScript = GameObject.FindGameObjectWithTag("GamePauser").GetComponent <Pause>(); weaponScreen = GameObject.FindGameObjectWithTag("WeaponScreen"); weapon1APtext = GameObject.FindGameObjectWithTag("WeaponText1").GetComponent <Text>(); weapon2APtext = GameObject.FindGameObjectWithTag("WeaponText2").GetComponent <Text>(); canvas2 = GameObject.FindGameObjectWithTag("Canvas2").GetComponent <Canvas>(); weaponContainer = GameObject.FindGameObjectWithTag("WeaponContainer"); switchweaponScripts = weaponContainer.GetComponent <SwitchWeapons>(); holdster1 = GameObject.FindGameObjectWithTag("holdster1").GetComponent <Transform>(); holdster2 = GameObject.FindGameObjectWithTag("holdster2").GetComponent <Transform>(); // weapon1 = switchweaponScripts.weaponZero; // weapon2 = switchweaponScripts.weaponOne; weapon1 = switchweaponScripts.weaponZero; weapon2 = switchweaponScripts.weaponOne; weaponstats1 = weapon1.GetComponent <WeaponStats>(); weaponstats2 = weapon2.GetComponent <WeaponStats>(); weapon1AP = weaponstats1.WeaponStrength; weapon2AP = weaponstats2.WeaponStrength; weapon1APtext = GameObject.FindGameObjectWithTag("WeaponText1").GetComponent <Text>(); weapon2APtext = GameObject.FindGameObjectWithTag("WeaponText2").GetComponent <Text>(); if (!SwitchWeapons.pickaxeActive) { switchweaponScripts.PutAwayPickaxe(); } //wScreenActive = false; weaponScreen.SetActive(false); }