void Start() { if (WeaponTweaks == null) { WeaponTweaks = BalanceTweaks.GlobalInstance.basicGun; } }
private void ChangeGun(GameObject prefab, WeaponTweaks tweaks) { GameObject oldGun = playerM.gunObj; GameObject newGun = Instantiate(prefab, oldGun.transform.position, oldGun.transform.rotation, playerM.tankObj.transform); Destroy(oldGun); playerM.gunObj = newGun; playerM.gunObj.layer = PlayerManager.LAYER_START_INDEX + playerM.playerNum; playerM.gunController = playerM.gunObj.GetComponent <GunController>(); playerM.gunController.playerM = playerM; playerM.gunController.WeaponTweaks = tweaks; }