示例#1
0
    // Use this for initialization
    void Start()
    {
        {
            //如果您是家长请按[yuan]2秒以上
            string[] arrayDuyin = GetParentDuyin();
            string   str        = Language.main.GetString("STR_PARENT_GATE_TITLE_HEAD") + "<color=#FF0000FF>" + "[" + arrayDuyin[indexSelectWord] + "]" + "</color>" + Language.main.GetString("STR_PARENT_GATE_TITLE_END");
            textTitle.text = str;
        }

        ParentGateLongPress longPress = null;

        string[] arrayWord = GetParentWord();

        textWord0.text          = arrayWord[0];
        longPress               = textWord0.GetComponent <ParentGateLongPress>();
        longPress.callbackPress = OnParentGateLongPressDidPress;
        longPress.index         = 0;

        textWord1.text          = arrayWord[1];
        longPress               = textWord1.GetComponent <ParentGateLongPress>();
        longPress.callbackPress = OnParentGateLongPressDidPress;
        longPress.index         = 1;

        textWord2.text          = arrayWord[2];
        longPress               = textWord2.GetComponent <ParentGateLongPress>();
        longPress.callbackPress = OnParentGateLongPressDidPress;
        longPress.index         = 2;

        textWord3.text          = arrayWord[3];
        longPress               = textWord3.GetComponent <ParentGateLongPress>();
        longPress.callbackPress = OnParentGateLongPressDidPress;
        longPress.index         = 3;

        LayOut();
    }
示例#2
0
 public void OnParentGateLongPressDidPress(ParentGateLongPress press)
 {
     if (indexSelectWord == press.index)
     {
         //right click by parent
         Debug.Log("OnParentGateLongPressDidPress");
         if (this.callbackClose != null)
         {
             Debug.Log("OnParentGateLongPressDidPress press=true");
             this.callbackClose(this, true);
         }
         OnClickBtnBack();
     }
 }