Beispiel #1
0
	public void SetDefaults(){
		slotDelegate = null;
		_SlotEmpty = true;
		_WeaponAmounts.text = "";
		_WeaponIcons.enabled = false;
		_mainWeapon = false;
		_subWeapon = false;
		m_LaserLine.enabled = false;
		m_hasTower = false;
		m_hasMine = false;
		m_BulletAmount = 0;
		m_LaserAmount = 0;
		m_FireBallAmount = 0;
	}
Beispiel #2
0
	void OnMineAmountChange(bool active){

		m_hasMine = active;

		if (m_hasMine) {
			if (_SlotEmpty) {
				_SlotEmpty = false;
				slotDelegate = PutMine;
			}

			if (isLocalPlayer) {
				_WeaponIcons.sprite = m_MineIcon;
			}
		} else {
			_SlotEmpty = true;
			slotDelegate = null;
		}
	}
Beispiel #3
0
	void OnBulletAmountChange(int amount){
		if (m_BulletAmount <= 0) {
			if (_SlotEmpty) {
				_SlotEmpty = false;
				slotDelegate = ShootSplashBullet;
			}
		}

		m_BulletAmount = amount;

		if (amount > 0) {
			if (isLocalPlayer) {
				_WeaponIcons.sprite = m_BulletIcon;
				_WeaponAmounts.text = Mathf.FloorToInt(m_BulletAmount).ToString ();
			}
		} else {
			_SlotEmpty = true;
			slotDelegate = null;
		}
	}
Beispiel #4
0
	void OnTowerAmountChange(bool active){

		m_hasTower = active;

		if (m_hasTower) {
			if (_SlotEmpty) {
				_SlotEmpty = false;
				slotDelegate = PutTower;
			}

			if (isLocalPlayer) {
				_WeaponIcons.sprite = m_TowerIcon;
			}
		} else {
			_SlotEmpty = true;
			slotDelegate = null;
		}
	}
Beispiel #5
0
	void OnLaserAmountChange(float amount){
		if (m_LaserAmount <= 0) {
			if (_SlotEmpty) {
				_SlotEmpty = false;
				slotDelegate = ShootLaser;
			}
		}

		m_LaserAmount = amount;

		if (amount > 0) {
			if (isLocalPlayer) {
				_WeaponIcons.sprite = m_LaserIcon;
				_WeaponAmounts.text = Mathf.FloorToInt(m_LaserAmount).ToString ();
			}
		} else {
			if (isLocalPlayer) {
				_WeaponIcons.sprite = null;
				_WeaponAmounts.text = "";
			}

			_SlotEmpty = true;
			slotDelegate = null;
			CmdStopLaser ();
		}
	}