public void UsingCurrentBuster() { switch (_currentTypeBuster) { case TypeBuster.JETPACK: ActivateJetpack(); break; case TypeBuster.SPEAR: ActivateSpear(); break; default: ActivateFreezeGun(); break; } _currentTypeBuster = TypeBuster.EMPTY; }
public void ShowBusterInUI(TypeBuster typeBuster) { Sprite curBuster; string nameCurBuster; switch (typeBuster) { case TypeBuster.JETPACK: curBuster = _jetpackIcon; nameCurBuster = "JETPACK"; break; case TypeBuster.SPEAR: curBuster = _fishIcon; nameCurBuster = "FISH"; break; default: curBuster = _gunIcon; nameCurBuster = "BLUSTER"; break; } _activateBusterLeft.image.sprite = curBuster; _activateBusterRight.image.sprite = curBuster; _currentBusterName.SetActive(true); _currentBusterName.GetComponentInChildren <Text>().text = nameCurBuster; }
public void UsingCurrentBuster() { if (_currentTypeBuster == TypeBuster.EMPTY) { return; } switch (_currentTypeBuster) { case TypeBuster.JETPACK: ActivateJetpack(); break; case TypeBuster.SPEAR: ActivateSpear(); break; case TypeBuster.FREZZYGUN: ActivateFreezeGun(); break; default: ActivateDynamit(); break; } _currentTypeBuster = TypeBuster.EMPTY; }
private void Start() { _currentTypeBuster = TypeBuster.EMPTY; _audioSource = GetComponent <AudioSource>(); GameManagerOffline.S._players.Add(gameObject); _rigidbody = GetComponent <Rigidbody>(); _transform = GetComponent <Transform>(); _steeringAgent = GetComponent <SteeringAgent>(); _steering = SteeringJoystick; if (_steeringAgent == null) { GameManagerOffline.S._activateBusterLeft.onClick.AddListener(UsingCurrentBuster); GameManagerOffline.S._activateBusterRight.onClick.AddListener(UsingCurrentBuster); GameManagerOffline.S._activateImpactLeft.GetComponent <ButtonImpact>()._impact += UsingImpact; GameManagerOffline.S._activateImpactRight.GetComponent <ButtonImpact>()._impact += UsingImpact; GameManagerOffline.S._activateImpactLeft.GetComponent <ButtonImpact>()._beginImpact += ScaleRightHand; GameManagerOffline.S._activateImpactRight.GetComponent <ButtonImpact>()._beginImpact += ScaleRightHand; } }
private void Awake() { _type = (TypeBuster)Random.Range(1, 4); }