Beispiel #1
0
    public bool changeWeapon(int index)
    {
        if (index >= 0 && index < _dataCtrl.szWeapons.Count)
        {
//			_Weapon.gameObject.SetActive(false);
//			_Weapon = szWeaponGO[mWeaponIndex];
//			_Weapon.gameObject.SetActive(true);
            _weaponData = _dataCtrl.szWeapons[index];
//			_Weapon.trBullet.enabled = !bUseStaticWeapon;
            return(_Weapon.ChangeWeapon(index, _weaponData.cost));
        }
        return(false);
    }
Beispiel #2
0
//	public void DonotNeedCoin(float time)
//	{
//		CancelInvoke("retNeedCoin");
//		bNeedCoin = false;
//		Invoke("retNeedCoin",time);
//	}
//	void retNeedCoin()
//	{
//		bNeedCoin = true;
//	}
    void Start()
    {
        if (dp.DelAD == 0)
        {
            Up = Up_Add;
        }
        else
        {
            Up = upTemp;
        }
        _ShareWorld = WGGameWorld.Instance;

        _dataCtrl = WGDataController.Instance;


//		for(int i=0;i<_dataCtrl.szWeapons.Count;i++)
//		{
//			WGWeapon wep = WGWeapon.CreateWeapon(i);
//			wep.gameObject.SetActive(false);
//			wep.transform.parent = this.transform;
//			wep.transform.localPosition = Vector3.zero;
//			wep.transform.localRotation = Quaternion.Euler(Vector3.zero);
//			wep.transform.localScale = Vector3.one;
//			szWeaponGO.Add(wep);
//		}
        mWeaponIndex = 0;
//		_Weapon = szWeaponGO[0];

        _Weapon = WGWeapon.CreateWeapon();
        SDK.AddChild(_Weapon.gameObject, this.gameObject);
        _Weapon.transform.localPosition = new Vector3(0, 0, -0.99f);
//		_Weapon.labCostCoin = labCostNum;
        _Weapon.ESetActive(true);
        _weaponData = _dataCtrl.szWeapons[0];

        UIEventListener.Get(goEvent).onPress += this.myOnPress;
        CheckStaticWeapon();
    }