private void HandleMovingWeaponLineup(WeaponLineup lineup, bool isLeft, bool isRight) { bool moved = false; if ((isLeft || isRight) && !(wasRight || wasLeft)) { moved = MoveLineup(lineup, isLeft, isRight); if (moved) { queryActionTimer = queryActionEverySeconds; } } if (isLeft || isRight) { queryActionTimer -= Time.deltaTime; } else { queryActionTimer = queryActionEverySeconds; } if (queryActionTimer < 0) { MoveLineup(lineup, isLeft, isRight); queryActionTimer = queryActionEverySeconds; } }
private bool MoveLineup(WeaponLineup lineup, bool isLeft, bool isRight) { if (isLeft) { lineup.MoveLeft(); ChangeWeaponTextPanel(lineup); return(true); } else if (isRight) { lineup.MoveRight(); ChangeWeaponTextPanel(lineup); return(true); } return(false); }
public void ChangeWeaponTextPanel(WeaponLineup lineup) { ModType type = lineup.GetModType; foreach (WeaponInfo info in weaponInfos) { if (info.weaponType == type) { weaponNameText.text = info.weaponName; weaponGraphic.sprite = info.weaponImage; LeanTween.value(damageBar.fillAmount, info.damageValue, 0.3f).setOnUpdate((float val) => { damageBar.fillAmount = val; }); LeanTween.value(rangeBar.fillAmount, info.rangeValue, 0.3f).setOnUpdate((float val) => { rangeBar.fillAmount = val; }); LeanTween.value(rofBar.fillAmount, info.rofValue, 0.3f).setOnUpdate((float val) => { rofBar.fillAmount = val; }); LeanTween.value(difficultyBar.fillAmount, info.difficultyValue, 0.3f).setOnUpdate((float val) => { difficultyBar.fillAmount = val; }); return; } } }