Пример #1
0
 void Start()
 {
     if (WeaponTweaks == null)
     {
         WeaponTweaks = BalanceTweaks.GlobalInstance.basicGun;
     }
 }
Пример #2
0
    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;
    }