Inheritance: MonoBehaviour
示例#1
0
 void Awake()
 {
     _instance = this;
     returning = true;
     leftButton = GameObject.FindGameObjectWithTag("LeftButton");
     rightButton = GameObject.FindGameObjectWithTag("RightButton");
 }
 public override void handleTouch(ButtonManager.WTouch touch, Vector3 position, bool start, bool end)
 {
     base.handleTouch(touch, position, start, end);
     if (end) {
         released();
     }
 }
示例#3
0
    void Start()
    {
        GameObject gm = GameObject.Find("GameManager");
        if (gm == null) { Debug.LogWarning("Game Manager not found! Cannot issue UI commands!"); return; }

        bm = gm.GetComponent<ButtonManager>();
        if (bm == null) { Debug.LogWarning("Button Manager script not found! Cannot issue UI commands!"); return; }
    }
    public override void handleTouch(ButtonManager.WTouch touch, Vector3 position, bool start, bool end)
    {
        base.handleTouch(touch, position, start, end);
        Vector3 clickNewPosition = cam.ScreenToWorldPoint(position);
        if (start) {
            clickStartPosition = clickNewPosition;
            startPosition = positionTool.transform.localPosition;
            startTime = Time.time;
            started = true;
            pressState = true;
            buttonTouchId = (touch!=null?touch.touch.fingerId:MOUSE_FINGER_ID);
        }
        if (started && buttonTouchId == (touch!=null?touch.touch.fingerId:MOUSE_FINGER_ID)) {
            if (positionTool.dragable && (dragging || (clickNewPosition - clickStartPosition).magnitude > dragTreshold)) {
                if (!dragging) {
                    clickStartPosition = clickNewPosition;
                    startPosition = positionTool.transform.localPosition;
                    dragging = true;
                    WidgetEventDispather.Instance.notifyWidgetDraggingStart();
                    disableTimerAnimation();
                }
                Vector3 newPosition = startPosition + (clickNewPosition - clickStartPosition);
                positionTool.setSnapedPosition(newPosition);
            } else {
                if (DicePlusConnectionManager.Instance.state == DicePlusConnectionManager.State.ROLLER) {
                    animation["timer"].speed = 1/Time.timeScale;
                    animation.CrossFade("timer");
                    if (Time.time > startTime + timerInterval) {
                        runClickAnimation();
                        DicePlusConnectionManager.Instance.disableRoller();
                        buttonTouchId = -1;
                        started = false;
                        disableTimerAnimation();
                        return;
                    }
                }
                if (end) {
                    released();
                    buttonTouchId = -1;
                    started = false;
                    disableTimerAnimation();
                    return;
                }
            }
            if (end) {
                dragging = false;
                WidgetEventDispather.Instance.notifyWidgetDraggingEnd();

                buttonTouchId = -1;
                started = false;
                disableTimerAnimation();
                return;
            }
        }
    }
示例#5
0
    public override void handleTouch(ButtonManager.WTouch touch, Vector3 position, bool start, bool end)
    {
        base.handleTouch(touch, position, start, end);
        Vector3 clickNewPosition = cam.ScreenToWorldPoint(position);
        if (start) {
            clickStartPosition = clickNewPosition;
            started = true;
            pressState = true;
            buttonTouchId = (touch!=null?touch.touch.fingerId:MOUSE_FINGER_ID);
            startPosition = infoScreenAnimator.transform.localPosition;

        }
        if (started && buttonTouchId == (touch!=null?touch.touch.fingerId:MOUSE_FINGER_ID)) {
            if (dragging || (clickNewPosition - clickStartPosition).magnitude > dragTreshold) {
                if (!dragging) {
                    clickStartPosition = clickNewPosition;
                    startPosition = infoScreenAnimator.transform.localPosition;
                    dragging = true;
                }
                Vector3 diff = (clickNewPosition - clickStartPosition);
                Vector3 newPosition = startPosition + diff;
                infoScreenAnimator.setPosition(newPosition);
                ButtonManager.Instance.selectNextRadioButton(screen, (int)((Mathf.Abs(diff.x) + InfoStreamAnimator.SCREEN_WIDTH/2f)/InfoStreamAnimator.SCREEN_WIDTH) * (int)Mathf.Sign(-diff.x), false);
            } else {
                if (end) {
                    released(clickNewPosition);
                    buttonTouchId = -1;
                    started = false;
                    return;
                }
            }
            if (end) {
                released(clickNewPosition);
                dragging = false;
                buttonTouchId = -1;
                started = false;
                return;
            }
        }
    }
示例#6
0
 public ButtonManager()
 {
     Instance = this;
 }
示例#7
0
    void Awake()
    {
        mTutorial = GlobalVariables.Instance.Instanciate (mLevelPrefab, transform, 1);
        mTutorial.transform.name = "tutorial";

        GameObject mPlayButton2 = GlobalVariables.Instance.Instanciate (mPlayPrefab, transform, 0.75f);
        mPlayButton2.transform.name = "PlayLevelButton";

        mTitleText = mTutorial.transform.Find ("level name text").GetComponent<TextMesh> ();
        mPictureImage = mTutorial.transform.Find ("level picture").GetComponent<MeshRenderer> ();
        mFrame = mTutorial.transform.Find ("small_frame").GetComponent<MeshRenderer> ();

        mTextMeshes = GetComponentsInChildren<TextMesh> ();
        mMeshRenders = GetComponentsInChildren<MeshRenderer> ();

        mPlayButton = ButtonManager.CreateButton(gameObject, "PlayLevelButton");

        mPictureImage.enabled = false;

        // add default
        if (mLevelName.Length < 1)
        {
            mLevelName = gameObject.name;
        }
    }
示例#8
0
 public PauseComponent(Game game)
     : base(game)
 {
     buttonManager = new ButtonManager(Game, this);
     timerPreventExit = 0;
 }
示例#9
0
	void Awake () 
	{
		Instance = this;
	}
示例#10
0
 /// <summary>
 /// Recreate the set of button spec instances.
 /// </summary>
 public void RecreateButtons()
 {
     ButtonManager.RecreateButtons();
 }
示例#11
0
 public MenuComponent(Game game)
     : base(game)
 {
     buttonManager = new ButtonManager(game, this);
 }
示例#12
0
 // Updates Vehicle Rotation to allow tilt controls.
 private void Start()
 {
     butt = GameObject.Find("Butooon").GetComponent <ButtonManager>();
 }
示例#13
0
 public SponsoButton(ButtonManager b) : base(0, 0, 5, 1, b)
 {
 }
示例#14
0
 void Start()
 {
     ButtonManager.AddButtonEventListener(NextLV);
 }
 public ButtonClickEvent(ButtonManager sender)
 {
     this.sender = sender;
 }
示例#16
0
        public override void Update()
        {
            base.Update();
            if (shouldWait != 0)
            {
                shouldWait--;
                return;
            }
            if (ButtonManager.Get(ButtonManager.ButtonID.DIRECT_LEFT))
            {
                switch (gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].type)
                {
                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Float:
                    if (lastHorizontal < -10)
                    {
                        gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].Decrement(0.05f);
                    }
                    else
                    {
                        gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].Decrement();
                    }
                    shouldWait = waitTicks;
                    if (lastHorizontal > 0)
                    {
                        lastHorizontal = 0;
                    }
                    lastHorizontal--;
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Bool:
                    shouldWait = waitTicks;
                    gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].isOn =
                        !gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].isOn;
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Combo:
                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special:
                    shouldWait = waitTicks;
                    gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].comboSelected--;
                    break;
                }
            }
            else if (ButtonManager.Get(ButtonManager.ButtonID.DIRECT_RIGHT))
            {
                switch (gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].type)
                {
                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Float:
                    if (lastHorizontal > 10)
                    {
                        gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].Increment(0.05f);
                    }
                    else
                    {
                        gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].Increment();
                    }
                    shouldWait = waitTicks;

                    if (lastHorizontal < 0)
                    {
                        lastHorizontal = 0;
                    }
                    lastHorizontal++;
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Bool:
                    shouldWait = waitTicks;
                    gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].isOn =
                        !gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].isOn;
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Combo:
                case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special:
                    shouldWait = waitTicks;
                    gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[parentMenu.menuIndex.Get()].comboSelected++;
                    break;
                }
            }
            else
            {
                lastHorizontal = 0;
            }
        }
 void OnDestroy()
 {
     if (this == instance) {
         instance = null;
     }
 }
示例#18
0
    public void UpdateOnStart()
    {
        logo.Update();
        switch (state)
        {
        case StarMenu.MenuItemId.Start_Menu:
            textMenu.Update();

            if (ButtonManager.GetDown(ButtonManager.ButtonID.X, this))
            {
                StarMenu.MenuItemId nextState = (StarMenu.MenuItemId)(textMenu.menuIndex.Get());
                if (!hasSelectedSave)
                {
                    nextState++;
                }

                if (!hasSomeSave)
                {
                    if (nextState >= StarMenu.MenuItemId.Load_Game)
                    {
                        nextState++;
                    }
                }

                switch (nextState)
                {
                case StarMenu.MenuItemId.New_Game:
                    gameManager.NewGame();
                    break;

                case StarMenu.MenuItemId.Continue:
                    gameManager.LoadGame();
                    break;

                case StarMenu.MenuItemId.Exit:
                    Application.Quit();
                    break;

                default:
                    ChangeState(nextState);
                    break;
                }
            }

            break;

        case StarMenu.MenuItemId.Options:
            options.Update();

            if (ButtonManager.GetDown(ButtonManager.ButtonID.X, this))
            {
                for (int i = 0; i < gameManager.menuJson.optionsMenu.Length; i++)
                {
                    for (int j = 0; j < gameManager.menuJson.optionsMenu[i].items.Length; j++)
                    {
                        switch (gameManager.menuJson.optionsMenu[i].items[j].type)
                        {
                        case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special:
                            switch (gameManager.menuJson.optionsMenu[i].items[j].special)
                            {
                            case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.Language:
                                break;

                            case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TitleFont:
                                gameManager.saveJson.config.titleFontIndex = gameManager.menuJson.optionsMenu[i].items[j].comboSelected.Get();
                                break;

                            case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TextFont:
                                gameManager.saveJson.config.textFontIndex = gameManager.menuJson.optionsMenu[i].items[j].comboSelected.Get();
                                break;

                            case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.ComboTexture:
                                ButtonManager.SetControllerTexture((ButtonManager.Controll)gameManager.menuJson.optionsMenu[i].items[j].comboSelected.Get());
                                break;
                            }
                            break;
                        }
                    }
                }
                gameManager.ChangeLanguage(gameManager.languagues[gameManager.menuJson.optionsMenu[0].items[0].comboSelected.Get()].name);
                ChangeState(StarMenu.MenuItemId.Start_Menu);
            }

            break;

        case StarMenu.MenuItemId.Load_Game:
            loadZone.Update();
            load.Update();

            if (ButtonManager.GetDown(ButtonManager.ButtonID.TRIANGLE, this))
            {
                gameManager.RemoveGame(load.menuIndex.Get());
                if (gameManager.saveJson.saves.Length == 0)
                {
                    ChangeState(StarMenu.MenuItemId.Start_Menu);
                }
                load.Init();
            }
            else if (ButtonManager.GetDown(ButtonManager.ButtonID.X, this))
            {
                gameManager.LoadGame(load.menuIndex.Get());
            }
            break;

        default:
            ChangeState(StarMenu.MenuItemId.Start_Menu);
            break;
        }

        if (ButtonManager.GetDown(ButtonManager.ButtonID.CIRCLE, this))
        {
            ChangeState(StarMenu.MenuItemId.Start_Menu);
        }
    }
示例#19
0
        public override void DrawElement(Rect rect, int elementIndex, bool isActive)
        {
            if (elementIndex >= gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items.Length)
            {
                return;
            }

            MenuJson.OptionMenuTab.OptionsMenuItem opt = gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[elementIndex];

            GUIStyle style = gameManager.TextStyle();

            style.fontSize = (int)(style.fontSize * Mathf.Min(menuArea.GetPercentSize(), 1f));

            switch (opt.type)
            {
            case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Bool:
                if (opt.isOn)
                {
                    GUI.Label(rect, "ON", style);
                }
                else
                {
                    GUI.Label(rect, "OFF", style);
                }
                break;

            case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Combo:
                GUI.Label(rect, opt.combo[opt.comboSelected.Get()], style);
                break;

            case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Float:
                slider.Display(rect, opt.value, opt.valueMin, opt.valueMax);
                break;

            case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special:
                switch (opt.special)
                {
                case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TitleFont:
                case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TextFont:
                    style.font = gameManager.fonts[opt.comboSelected.Get()].font;
                    GUI.Label(rect, gameManager.fonts[opt.comboSelected.Get()].name, style);
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.Language:
                    GUI.Label(rect, gameManager.languagues[opt.comboSelected.Get()].name, style);
                    break;

                case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.ComboTexture:
                    GUI.Label(optionCombo.comboTextureLabel.GetRect(rect), ((ButtonManager.Controll)opt.comboSelected.Get()).ToString(), style);
                    if (ButtonManager.GetControllerTexture((ButtonManager.Controll)opt.comboSelected.Get()))
                    {
                        GUI.DrawTexture(optionCombo.comboTextureTexture.GetRect(rect), ButtonManager.GetControllerTexture((ButtonManager.Controll)opt.comboSelected.Get()));
                    }
                    break;

                default:
                    break;
                }
                break;
            }
        }
示例#20
0
 private void showButtonGrid()
 {
     gvButton.DataSource = ButtonManager.GetAllButtonsByPageID(int.Parse(ddlPage.SelectedValue));
     gvButton.DataBind();
 }
示例#21
0
	void Awake ()
    {
        _instance = this;
    }
示例#22
0
 public static bool ButtonUp(EButtonCode code)
 {
     return(ButtonManager.ButtonUp(code));
 }
示例#23
0
    void Awake()
    {
        mObj = GlobalVariables.Instance.Instanciate (mPrefab, transform, 1);

        mTitleText = mObj.transform.Find ("life_text").GetComponent<TextMesh> ();

        mAnimator = mObj.transform.Find ("Anim_LifePerk").GetComponent<Animator> ();

        m1p = mAnimator.transform.Find("box").gameObject;
        m2p = mAnimator.transform.Find("arm").gameObject;
        m3p = mAnimator.transform.Find("shelf").gameObject;
        //m1p.SetActive (false);
        m2p.SetActive (false);
        m3p.SetActive (false);

        mObjParts = new GameObject[3];
        for (int i = 0; i < mObjParts.Length; i++)
        {
            mObjParts[i] = mObj.transform.Find("upgrade_life/buy_orb " + (i + 1)).gameObject;
            mObjParts[i].SetActive(false);
        }

        if (mPerkName.Length < 1)
        {
            mPerkName = gameObject.name;
        }
        mPerkButton = ButtonManager.CreateButton(gameObject, "perk_life/Anim_LifePerk");
    }
示例#24
0
 public static float GetAxisRaw(EButtonCode code)
 {
     return(ButtonManager.GetAxisRaw(code));
 }
示例#25
0
    void Awake()
    {
        mPerks = GetComponentsInChildren<Perk> ();

        mPrevObj = ButtonManager.CreateButton(gameObject, "Prev");
        mNextObj = ButtonManager.CreateButton(gameObject, "Next");
    }
示例#26
0
 /// <summary>
 ///     Adds a screen to the stack. This screen will become the new main screen, but
 ///     the ones under it will still persist at the same state.
 /// </summary>
 /// <param name="screen"></param>
 public static void AddScreen(Screen screen)
 {
     Screens.Push(screen);
     ButtonManager.ResetDrawOrder();
 }
示例#27
0
 public virtual void handleTouch(ButtonManager.WTouch touch, Vector3 position, bool start, bool end)
 {
     if (started) {
         pressState = true;
     }
 }
示例#28
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        spinNextText = spinNextButton.transform.FindChild("Text").GetComponent<Text>();
    }
示例#29
0
        protected override void Initialize()
        {
            theFileManager = FileManager.Get(this);
            theInputManager = InputManager.Get(this);
            theUtilityManager = UtilityManager.Get(this);
            theTileManager = TileManager.Get(this);
            theButtonManager = ButtonManager.Get(this);
            thePlayerManager = PlayerManager.Get(this);
            theScreenManager = ScreenManager.Get(this);
            theCameraManager = CameraManager.Get(this);
            theEnemyManager = EnemyManager.Get(this);
            theProjectileManager = ProjectileManager.Get(this);
            theCollisionManager = CollisionManager.Get(this);

            theScreenManager.WorldScreen = new MainMenu();

            Player.CreatePlayer("test", new Vector2(mScreenDimensions.X / 2.0f, mScreenDimensions.Y / 2.0f), Vector2.Zero);

            TileButton.Create(new FloorCopper(), Keys.E);
            TileButton.Create(new FloorMetal(), Keys.R);
            TileButton.Create(new HardWallCopper(), Keys.T);
            TileButton.Create(new HardWallMetal(), Keys.Y);
            TileButton.Create(new WallMetal(), Keys.Q);
            TileButton.Create(new CopperWall(), Keys.W);

            EnemyButton.Create(new EnemyTurret(), Keys.F);
             //   EnemyButton.Create("Turret_Gun", Keys.F);

            theTileManager.Load("Level_1.xml");

            base.Initialize();
        }
示例#30
0
 protected override void AttachChildControls()
 {
     this.hdorderId             = (HtmlInputHidden)this.FindControl("hdorderId");
     this.txtRemark             = (TextBox)this.FindControl("txtRemark");
     this.txtRefundAmount       = (TextBox)this.FindControl("txtRefundMoney");
     this.dropRefundType        = (RefundTypeRadioList)this.FindControl("dropRefundType");
     this.DropReturnsReason     = (AfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList");
     this.btnSubmit             = ButtonManager.Create(this.FindControl("btnSubmit"));
     this.txtQuantity           = (HtmlInputText)this.FindControl("txtQuantity");
     this.divQuantity           = (HtmlTableRow)this.FindControl("divQuantity");
     this.divQuantityTag        = (HtmlTableRow)this.FindControl("divQuantityTag");
     this.litMaxAmount          = (Literal)this.FindControl("litMaxAmount");
     this.litMaxQuantity        = (Literal)this.FindControl("litMaxQuantity");
     this.groupbuyPanel         = (HtmlGenericControl)this.FindControl("groupbuyPanel");
     this.hidRefundType         = (HiddenField)this.FindControl("hidRefundType");
     this.hidAfterSaleType      = (HiddenField)this.FindControl("hidAfterSaleType");
     this.hidePicture           = (HiddenField)this.FindControl("fmSrc");
     this.txtBankName           = (HtmlInputText)this.FindControl("txtBankName");
     this.txtBankAccountName    = (HtmlInputText)this.FindControl("txtBankAccountName");
     this.txtBankAccountNo      = (HtmlInputText)this.FindControl("txtBankAccountNo");
     this.hidMaxQuantity        = (HtmlInputHidden)this.FindControl("hidMaxQuantity");
     this.products              = (Common_OrderItems_AfterSales)this.FindControl("Common_OrderItems_AfterSales");
     this.hidOneMaxRefundAmount = (HtmlInputHidden)this.FindControl("hidOneMaxRefundAmount");
     this.hidMaxRefundAmount    = (HtmlInputHidden)this.FindControl("hidMaxRefundAmount");
     PageTitle.AddSiteNameTitle("我的订单");
     this.OrderId = HttpContext.Current.Request.QueryString["OrderId"].ToNullString();
     this.SkuId   = HttpContext.Current.Request.QueryString["SkuId"].ToNullString();
     this.order   = TradeHelper.GetOrderInfo(this.OrderId);
     if (this.order == null || this.order.UserId != HiContext.Current.UserId)
     {
         this.ShowMessage("错误的订单信息!", false, "", 1);
     }
     else if (string.IsNullOrEmpty(this.SkuId) || !this.order.LineItems.ContainsKey(this.SkuId))
     {
         this.ShowMessage("错误的商品信息!", false, "", 1);
     }
     else
     {
         if (this.products != null)
         {
             if (string.IsNullOrEmpty(this.SkuId))
             {
                 this.products.DataSource = this.order.LineItems.Values;
             }
             else
             {
                 Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                 foreach (LineItemInfo value in this.order.LineItems.Values)
                 {
                     if (value.SkuId == this.SkuId)
                     {
                         dictionary.Add(value.SkuId, value);
                     }
                 }
                 this.products.DataSource = dictionary.Values;
             }
             this.products.DataBind();
         }
         decimal canRefundAmount = this.order.GetCanRefundAmount(this.SkuId, this.groupBuy, 0);
         if (canRefundAmount < decimal.Zero)
         {
             this.ShowMessage("订单中已申请的退款金额超过了订单总额!", false, "", 1);
         }
         else
         {
             decimal canRefundAmount2 = this.order.GetCanRefundAmount(this.SkuId, this.groupBuy, 1);
             if (this.order.LineItems.ContainsKey(this.SkuId))
             {
                 this.ReturnsItem = this.order.LineItems[this.SkuId];
             }
             this.btnSubmit.Click += this.btnReturns_Click;
             if (!this.Page.IsPostBack)
             {
                 this.DropReturnsReason.DataBind();
                 this.hidOneMaxRefundAmount.Value = canRefundAmount2.F2ToString("f2");
                 this.litMaxAmount.Text           = canRefundAmount.F2ToString("f2");
                 this.litMaxQuantity.Text         = TradeHelper.GetMaxQuantity(this.order, this.SkuId).ToString();
                 this.hidMaxQuantity.Value        = this.litMaxQuantity.Text;
                 this.txtQuantity.Value           = this.litMaxQuantity.Text;
                 this.txtRefundAmount.Text        = this.litMaxAmount.Text;
                 this.hidMaxRefundAmount.Value    = this.litMaxAmount.Text;
                 string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1);
                 if (this.order.PreSaleId <= 0 || this.order.Gateway.ToLower() == enumDescription || this.order.DepositGatewayOrderId.ToNullString() == enumDescription)
                 {
                     this.dropRefundType.OrderGateWay = ((this.order.PreSaleId > 0) ? enumDescription : this.order.Gateway);
                 }
                 this.dropRefundType.BalanceAmount = this.order.BalanceAmount;
                 this.dropRefundType.DataBind();
             }
         }
     }
 }
示例#31
0
    void Awake()
    {
        mObj = GlobalVariables.Instance.Instanciate (mPrefab, transform, 1);

        mTitleText = mObj.transform.Find ("air_text").GetComponent<TextMesh> ();
        mAnimator = mObj.transform.Find ("Anim_AirPerk").GetComponent<Animator> ();

        m1p = mAnimator.transform.Find("perk_air_1").gameObject;
        m2p = mAnimator.transform.Find("perk_airBS2").gameObject;
        m3p[0] = mAnimator.transform.Find("polySurface16").gameObject;
        m3p[1] = mAnimator.transform.Find("polySurface18").gameObject;
        m3p[2] = mAnimator.transform.Find("polySurface19").gameObject;
        //m1p.SetActive(false);
        m2p.SetActive(false);
        m3p[0].SetActive(false);
        m3p[1].SetActive(false);
        m3p[2].SetActive(false);

        mObjParts = new GameObject[3];
        for (int i = 0; i < mObjParts.Length; i++)
        {
            mObjParts[i] = mObj.transform.Find("upgrade_air/buy_orb " + (i + 1)).gameObject;
            mObjParts[i].SetActive(false);
        }

        if (mPerkName.Length < 1)
        {
            mPerkName = gameObject.name;
        }

        mPerkButton = ButtonManager.CreateButton(gameObject, "perk_air/Anim_AirPerk");
    }
示例#32
0
 // Use this for initialization
 void Start()
 {
     text = GetComponent <Text>();
     text = FindObjectOfType <Text>();
     BM   = GetComponent <ButtonManager>();
 }
 void Awake()
 {
     if (instance == null) {
         instance = this;
     } else {
         Destroy(this);
     }
 }
示例#34
0
 public HighScoresComponent(Game game)
     : base(game)
 {
     buttonManager = new ButtonManager(Game, this);
     activeScore = new List<HighScore>();
 }
 public override void Destroy()
 {
     Button.Destroy();
     ButtonManager.Remove(Button);
     base.Destroy();
 }
示例#36
0
 protected override void AttachChildControls()
 {
     this.hidErrorMsg           = (HtmlInputHidden)this.FindControl("hidErrorMsg");
     this.txtOrderId            = (HtmlInputHidden)this.FindControl("txtOrderId");
     this.litOrderIds           = (Literal)this.FindControl("litOrderIds");
     this.txtSkuId              = (HtmlInputHidden)this.FindControl("txtSkuId");
     this.txtRemark             = (TextBox)this.FindControl("txtRemark");
     this.txtRefundAmount       = (TextBox)this.FindControl("txtRefundMoney");
     this.dropRefundType        = (WapRefundTypeDropDownList)this.FindControl("dropRefundType");
     this.DropReturnsReason     = (WapAfterSalesReasonDropDownList)this.FindControl("ReturnsReasonDropDownList");
     this.btnReturns            = ButtonManager.Create(this.FindControl("btnReturns"));
     this.litProductName        = (Literal)this.FindControl("litProductName");
     this.txtQuantity           = (TextBox)this.FindControl("txtQuantity");
     this.divQuantity           = (HtmlTableRow)this.FindControl("divQuantity");
     this.divQuantityTag        = (HtmlTableRow)this.FindControl("divQuantityTag");
     this.litMaxAmount          = (Literal)this.FindControl("litMaxAmount");
     this.litMaxQuantity        = (Literal)this.FindControl("litMaxQuantity");
     this.hidOneMaxRefundAmount = (HtmlInputHidden)this.FindControl("hidOneMaxRefundAmount");
     this.groupbuyPanel         = (HtmlGenericControl)this.FindControl("groupbuyPanel");
     this.hidMaxRefundAmount    = (HtmlInputHidden)this.FindControl("hidMaxRefundAmount");
     this.txtOrderId.Value      = this.OrderId;
     this.txtSkuId.Value        = this.SkuId;
     this.litOrderIds.Text      = this.OrderId;
     PageTitle.AddSiteNameTitle("退货申请");
     this.order = TradeHelper.GetOrderInfo(this.OrderId);
     if (this.order == null)
     {
         this.ShowError("错误的订单信息!");
     }
     else if (!TradeHelper.CanReturn(this.order, this.SkuId))
     {
         this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!");
     }
     else if (string.IsNullOrEmpty(this.SkuId) || !this.order.LineItems.ContainsKey(this.SkuId))
     {
         this.ShowError("错误的商品信息!");
     }
     else
     {
         decimal canRefundAmount  = this.order.GetCanRefundAmount(this.SkuId, null, 0);
         decimal canRefundAmount2 = this.order.GetCanRefundAmount(this.SkuId, null, 1);
         if (canRefundAmount < decimal.Zero)
         {
             this.ShowError("订单中已申请的退款金额超过了订单总额!");
         }
         else
         {
             if (this.order.LineItems.ContainsKey(this.SkuId))
             {
                 this.ReturnsItem = this.order.LineItems[this.SkuId];
             }
             else
             {
                 if (this.divQuantity != null)
                 {
                     this.divQuantity.Style.Add("display", "none");
                 }
                 if (this.divQuantityTag != null)
                 {
                     this.divQuantityTag.Style.Add("display", "none");
                 }
             }
             if (!string.IsNullOrEmpty(this.SkuId))
             {
                 LineItemInfo lineItemInfo = this.order.LineItems[this.SkuId];
                 this.litProductName.Text = lineItemInfo.ItemDescription;
             }
             else
             {
                 this.txtQuantity.ReadOnly = true;
                 this.litProductName.Text  = "所有商品";
             }
             if (!this.Page.IsPostBack)
             {
                 this.litMaxQuantity.Text         = TradeHelper.GetMaxQuantity(this.order, this.SkuId).ToString();
                 this.litMaxAmount.Text           = canRefundAmount.F2ToString("f2");
                 this.hidOneMaxRefundAmount.Value = canRefundAmount2.F2ToString("f2");
                 this.hidMaxRefundAmount.Value    = this.litMaxAmount.Text;
                 this.txtQuantity.Text            = this.litMaxQuantity.Text;
                 this.txtRefundAmount.Text        = this.litMaxAmount.Text;
                 this.txtRefundAmount.Attributes.Add("placeholder", "最多可退款" + this.litMaxAmount.Text);
                 this.txtQuantity.Attributes.Add("placeholder", "最后可售后数量" + this.txtQuantity.Text + "件");
                 this.dropRefundType.preSaleId = this.order.PreSaleId;
                 string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1);
                 this.dropRefundType.OrderGateWay  = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway);
                 this.dropRefundType.BalanceAmount = this.order.BalanceAmount;
             }
         }
     }
 }