//public void SetDownSlotVisible(bool _visible)
    //{
    //    if (slotDown != null)
    //    {
    //        slotDown.SetActiveRecursively(_visible);
    //        bDisableSlotDown = !_visible;
    //    }
    //}

    public void SetFocus(GameObject _focusObject, StoreTouchInfo _touchInfo)
    {
        if (_touchInfo == null)
            return;

        StoreItemControllerInfo selectItem = null;

        _focusObject.SetActiveRecursively(true);

        SimpleSprite sprite = _focusObject.GetComponent<SimpleSprite>();
        sprite.Unclip();


        if (_touchInfo.type == StoreTouchType.STORE_TOUCH_LEFT)
            selectItem = itemUp;
        else if (_touchInfo.type == StoreTouchType.STORE_TOUCH_RIGHT)
            selectItem = itemDown;

        if (selectItem != null)
        {
            selectItem.itemFocusObject           = _focusObject;
            _focusObject.transform.parent        = selectItem.itemSlotSprite.transform;
            _focusObject.transform.localPosition = new Vector3(0.0f, 0.0f, -2.0f);
            selectItem.uiListItemContainer.ScanChildren();
        }
    }
Пример #2
0
	protected override void BuyItemBtnInputDelegate(ref POINTER_INFO ptr)
	{
		if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP && IsLockInput == false && nowState != StoreState.NOTOUCH)
		{
			Transform tm = ptr.targetObj.transform.parent.parent;

			StoreItemControllerBuyButton itemController = tm.gameObject.GetComponent<StoreItemControllerBuyButton>();

			// check remain Time
			StoreItemInfoUI info = itemController.GetStoreItemInfo(StoreTouchType.STORE_TOUCH_LEFT);

			if (info != null && info.item_Type == Store_Item_Type.ChargeItem)
			{
				if (dicChargeItemInfo.ContainsKey(info.itemID))
				{
					int remainTime = dicChargeItemInfo[info.itemID].nRemainTime;

					if (remainTime > 0)
					{
						ShowItemRemainTimeMsgBox(remainTime);
						return;
					}
				}
			}

			if (itemController != null)
			{
				StoreTouchInfo dummyTouchInfo = new StoreTouchInfo();
				dummyTouchInfo.type = StoreTouchType.STORE_TOUCH_LEFT;
				dummyTouchInfo.idx = int.Parse(tm.gameObject.name);
				dummyTouchInfo.storeItemController = itemController;
				dummyTouchInfo.touchObject = null;
				PrepareBuyNowTouchItem(dummyTouchInfo);
			}

			HideMiracleInfo();
		}
	}
Пример #3
0
	/// <summary>
	/// Find 
	/// </summary>
	/// <param name="_ray"></param>
	/// <returns></returns>
	public virtual StoreTouchInfo FindClickStoreItem( Ray _ray)
	{
		StoreTouchInfo touchInfo = new StoreTouchInfo();

		if( !AsUtil.PtInCollider( scrollList.collider, _ray))
			return touchInfo;

		int count = scrollList.Count;
		for ( int i = 0; i < count; i++)
		{
			IUIListObject item = scrollList.GetItem( i);

			StoreItemController storeControl = item.gameObject.GetComponent<StoreItemController>();

			if( storeControl != null)
			{
				foreach ( StoreItemControllerInfo info in storeControl.items)
				{
					bool bCheck = false;

					// On box Collider
					if( info != null)
						info.boxCollider.enabled = true;

					if( info != null)
						bCheck = AsUtil.PtInCollider( info.boxCollider, _ray);

					// off boxCollider
					if( info != null)
						info.boxCollider.enabled = false;

					if( bCheck == true)
					{
						touchInfo.idx = i;
						touchInfo.storeItemController = storeControl;
						touchInfo.type = info.touchType;
						touchInfo.touchObject = info.itemIconObject;
						return touchInfo;
					}
				}
			}
		}

		return touchInfo;
	}
Пример #4
0
	public virtual void InputMove( Ray _ray)
	{
		if (isLockInput == true)
			return;

		if( scrollList == null || nowState == StoreState.NOTOUCH)
			return;

		if( scrollList.IsAutoScrolling == true || isDownStoreOut == true || scrollList.IsScrolling == true)
			return;

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			if( isDraingItem == true)
				return;

			StoreTouchInfo touchInfo = FindClickStoreItem( _ray);

			if( touchInfo.type == StoreTouchType.STORE_TOUCH_NONE)
				return;

			nowTouchInfo = touchInfo;

			fStationaryPassTime += Time.deltaTime;

			if( fStationaryPassTime >= fStationaryTime)
			{
				LockInput( true);

				SelectStoreItem( nowTouchInfo);

				prevTouchInfo = nowTouchInfo;

				StoreItemInfoUI itemInfo = touchInfo.storeItemController.GetStoreItemInfo();

				// test
				if( itemInfo.item_Type == Store_Item_Type.NormalItem)
					nowSelectIcon = GetItemIcon( itemInfo.itemID, itemInfo.itemBunch);
				else
					nowSelectIcon = GetItemIcon( "90000", 1);

				Vector3 nowMousePos = AsInputManager.Instance.UICamera.ScreenToWorldPoint( Input.mousePosition);
				touchOffset = nowTouchInfo.touchObject.transform.position - nowMousePos;
				isDraingItem = true;

				fStationaryPassTime = 0.0f;

				if( TooltipMgr.Instance != null)
					TooltipMgr.Instance.Clear();
	
				nowState = StoreState.DRAG;
			}
		}
	}
Пример #5
0
	private void ReleaseStoreItem( StoreTouchInfo _touchInfo)
	{
		if( _touchInfo != null && _touchInfo.idx != -1)
			_touchInfo.storeItemController.RemoveFocus( transform);
	}
Пример #6
0
	// InputUp
	public virtual void InputUp( Ray _ray)
	{
		if( scrollList == null || nowState == StoreState.NOTOUCH)
			return;

		if( scrollList.IsAutoScrolling == true || scrollList.IsScrolling == true)
			return;

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			StoreTouchInfo touchInfo = FindClickStoreItem( _ray);

			if( touchInfo.type != StoreTouchType.STORE_TOUCH_NONE)
			{
				if( isDownStoreOut == false)
				{
					if( isClicked == false)
					{
						OneClickTouchInfo = touchInfo;
						isClicked = true;
					}
					else // doubleClick
					{
						isClicked = false;
						fClickTimePassed = 0.0f;
						TwoClickTouchInfo = touchInfo;
						ProcessDClickUp();
					}
				}

				if( isDownStoreOut == true)
					isDownStoreOut = false;
			}
		}

		if( nowState == StoreState.DRAG && isDraingItem == true)
		{
			//Drop ÀÛ¾÷
			isDraingItem = false;

			LockInput( false);

			if( nowSelectIcon != null)
			{
				//ReleaseStoreItem( nowTouchInfo);
				GameObject.DestroyImmediate( nowSelectIcon);
				nowSelectIcon = null;
				nowSelectIcon = null;
				nowState = StoreState.NOTOUCH;
	
				if( ReleaseBuyItemEvent != null)
					ReleaseBuyItemEvent( _ray);
			}
		}

		if( AsHudDlgMgr.Instance != null)
		{
			if( true == AsHudDlgMgr.Instance.IsOpenInven)
			{
				if( true == AsHudDlgMgr.Instance.invenDlg.IsRect( _ray))
					isDownStoreOut = false;
			}
		}
	}
Пример #7
0
	public void PrepareBuyNowTouchItem( StoreTouchInfo _touchInfo)
	{
		nowTouchInfo = _touchInfo;
		SelectStoreItem( nowTouchInfo);
		prevTouchInfo = nowTouchInfo;
		LockInput( true);
		isDownStoreOut = false;
		nowState = StoreState.QUANTITY_BUY;

		AsSoundManager.Instance.PlaySound( AsSoundPath.ButtonClick, Vector3.zero, false);

		nowStoreItemInfo = nowTouchInfo.storeItemController.GetStoreItemInfo( nowTouchInfo.type);

		PrepareBuyItemEvent( nowStoreItemInfo);
	}
Пример #8
0
	public virtual void ProcessUpClick()
	{
		if( scrollList == null || nowState == StoreState.NOTOUCH)
		{
			isClicked = false;
			return;
		}

		if( scrollList.IsAutoScrolling == true || scrollList.IsScrolling == true)
		{
			isClicked = false;
			return;
		}

		if( IsLockInput == true)
		{
			isClicked = false;
			return;
		}

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			if( isClicked == false)
				return;

			fClickTimePassed += Time.deltaTime;

			if( fClickTimePassed >= fDClickTime)
			{
				nowTouchInfo = OneClickTouchInfo;
				SelectStoreItem( nowTouchInfo);
				prevTouchInfo = nowTouchInfo;
				fStationaryPassTime = 0.0f;
				nowState = StoreState.SELECT;

				StoreItemInfoUI storeItemInfo = nowTouchInfo.storeItemController.GetStoreItemInfo( nowTouchInfo.type);

				PlayItemSound( storeItemInfo);

				if( storeItemInfo == null)
				{
					fClickTimePassed = 0.0f;
					isClicked = false;
					return;
				}

				/*
				// exception gold item
				if( storeItemInfo.item_Type == Store_Item_Type.NormalItem)
				{
					int itemID = System.Convert.ToInt32( storeItemInfo.itemID);
					Item itemData = ItemMgr.ItemManagement.GetItem( itemID);

					if( itemData.ItemData.GetItemType() == Item.eITEM_TYPE.EtcItem)
					{
						if( itemData.ItemData.GetSubType() == ( int)Item.eEtcItem.Gold)
						{
							fClickTimePassed = 0.0f;
							isClicked = false;
							PrepareBuyNowTouchItem( nowTouchInfo);
							return;
						}
					}
				}
				*/
				// exception miracle
				if( storeItemInfo.item_Type == Store_Item_Type.ChargeItem)
				{
					fClickTimePassed = 0.0f;
					isClicked = false;
					PrepareBuyNowTouchItem( nowTouchInfo);
					return;
				}

				if( storeItemInfo.item_Type == Store_Item_Type.NormalItem)
				{
					int itemID = System.Convert.ToInt32( storeItemInfo.itemID);
					Item itemData = ItemMgr.ItemManagement.GetItem( itemID);

					if( itemData != null)
					{
						RealItem haveitem = null;

						if( Item.eITEM_TYPE.EquipItem == itemData.ItemData.GetItemType())
							haveitem = ItemMgr.HadItemManagement.Inven.GetEquipItem( itemData.ItemData.GetSubType());
						else if( Item.eITEM_TYPE.CosEquipItem == itemData.ItemData.GetItemType())
							haveitem = ItemMgr.HadItemManagement.Inven.GetCosEquipItem( itemData.ItemData.GetSubType());

						OpenTooltip( haveitem, itemData, this, "SetTooltipClick", -1, storeItemInfo.itemSlot);
					}
				}

				fClickTimePassed = 0.0f;
				isClicked = false;
			}
		}
	}
Пример #9
0
	protected void SelectStoreItem( StoreTouchInfo _touchInfo)
	{
		try
		{
			if( prevTouchInfo != null && prevTouchInfo.idx != -1)
				prevTouchInfo.storeItemController.RemoveFocus( transform);

			if( focusItem == null)
				CreateFocus();

			if( focusItem != null)
			{
				_touchInfo.storeItemController.SetFocus( focusItem);
				scrollList.ClipItems();
			}
		}
		catch ( System.Exception e)
		{
			Debug.LogError( e.Message);
			Debug.LogError( e.Source);
		}
	}
Пример #10
0
	protected void Initilize()
	{
		prevTouchInfo = new StoreTouchInfo();

		// create focus
		CreateFocus();

		if( scrollList != null)
			scrollList.SetInputDelegate( InputDelegate);

		if( quantityMsgBox != null)
			quantityMsgBox.Close();

		if( classTypeBtn != null)
			classTypeBtn.AddInputDelegate( ChangeClassTypeDelegate);

		if( buttonClose != null)
			buttonClose.AddInputDelegate( CloseDelegate);

		if( radioBtns != null)
			radioBtnPositions = new Vector3[radioBtns.Length];

		int count = 0;
		foreach ( UIRadioBtn button in classBtns)
		{
			button.data = classEnums[count];
			button.AddInputDelegate( ChangeClassTypeDelegate);
			count++;
		}

		InitKindMenu();

		if( classTypePanel != null)
			classTypePanel.GetTransition( UIPanelManager.SHOW_MODE.BringInBack).AddTransitionEndDelegate( TransitionEndDelegate);
	}