Esempio n. 1
0
    //添加选项
    void addOptions()
    {
        for (int i = 0; i < currentGameEvent.options.Length; i++)
        {
            GameObject option = (GameObject)MonoBehaviour.Instantiate(optionGameObject);
            option.name             = string.Format("option{0}", i);
            option.transform.parent = optionBackgroundImage.gameObject.transform;

            RectTransform rectTransform = option.GetComponent <RectTransform> ();
            rectTransform.anchorMin = Vector2.one * 0.5f;
            rectTransform.anchorMax = Vector2.one * 0.5f;
            float width  = backgroundImage.rectTransform.sizeDelta.x * 0.75f;
            float height = width / 5.0f;
            rectTransform.sizeDelta  = new Vector2(width, height);
            rectTransform.pivot      = Vector2.one * 0.5f;
            rectTransform.localScale = Vector3.one;
            float posY = (currentGameEvent.options.Length - 1) * height / 2.0f - (height * (float)i);
            Debug.Log(width + "," + height + "," + posY);
            rectTransform.anchoredPosition3D = new Vector3(0, posY, 0);

            Text optionText = rectTransform.FindChild("text").gameObject.GetComponent <Text>();
            if (optionText != null)
            {
                optionText.text = currentGameEvent.options [i].text;
                UUIEventListener.Get(option, currentGameEvent.options [i].tag).onClickTag = optionClick;
            }
        }
    }
    static int Get(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes <UnityEngine.Transform>(L, 1))
            {
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 1);
                UUIEventListener      o    = UUIEventListener.Get(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes <UnityEngine.GameObject>(L, 1))
            {
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 1);
                UUIEventListener       o    = UUIEventListener.Get(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UUIEventListener.Get"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 3
0
    void Start()
    {
        //MapUtil.GetInstance.DrawGrid ();

        Application.targetFrameRate = 30;

        GlobalConfig.GetInstance.InitGlobalSetting();


//		GameObject.Find ("frame1").SetActive (false);
//		GameObject.Find ("frame2").SetActive (false);
//		GameObject.Find ("frame3").SetActive (false);
//		GameObject.Find ("frame4").SetActive (false);
//		GameObject.Find ("frame5").SetActive (false);

        loadingImage = GameObject.Find("Loading");
        btnHFAttack  = GameObject.Find("btnHFAttack");

        btnStart = GameObject.Find("btnStart");

        btnMXUlt = GameObject.Find("btnMX");
        btnLEUlt = GameObject.Find("btnLE");
        btnHMUlt = GameObject.Find("btnHM");
        btnODUlt = GameObject.Find("btnOD");
        btnRRUlt = GameObject.Find("btnRR");
        btnTimer = GameObject.Find("btnTimer");

        btnLEUlt.SetActive(false);
        btnRRUlt.SetActive(false);

//		UUIEventListener.Get (btnHFAttack).onClick = btn1ClickHandler;
//
//
//		UUIEventListener.Get (btnODAttack).onClick = btnAttackHandler;
//		UUIEventListener.Get (btnMXAttack).onClick = btnAttackHandler;
//		UUIEventListener.Get (btnLEAttack).onClick = btnAttackHandler;
//		UUIEventListener.Get (btnHMAttack).onClick = btnAttackHandler;


        UUIEventListener.Get(btnODUlt).onClick = BtnUtlHandler;
        UUIEventListener.Get(btnMXUlt).onClick = BtnUtlHandler;
        //UUIEventListener.Get (btnLEUlt).onClick = BtnUtlHandler;
        UUIEventListener.Get(btnHMUlt).onClick = BtnUtlHandler;
        //UUIEventListener.Get (btnRRUlt).onClick = BtnUtlHandler;


        //UUIEventListener.Get (btnStart).onClick = BtnStartClickHandler;

        UUIEventListener.Get(loadingImage).onDrag = LoadingDragHandler;
        UUIEventListener.Get(btnTimer).onClick    = BtnTimerHandler;
        //MessageCenter.GetInstance.addEventListener (BaseEvent.CLICK, btn1ClickHandler);
        MainComponentManager main   = MainComponentManager.SharedInstance;
        BattleManager        battle = BattleManager.SharedInstance;

//		StartCoroutine (DelayToInvokeDo (2.0f));

        //播放第一段背景音乐
        AudioManager.SharedInstance.PlaySound("Bgmusic_01", 1.0f);
    }
Esempio n. 4
0
    void Start()
    {
        //Screen.SetResolution(750,1333,false);
        //PlayerSettings.SetAspectRatio(AspectRatio.Aspect16by9,true);没用

        UUIEventListener.Get(speedUpText.gameObject).onClick         = speedUp;
        UUIEventListener.Get(nextImage.gameObject).onClick           = next;
        UUIEventListener.Get(backgroundImage.gameObject).onClick     = next;
        UUIEventListener.Get(textBackgroundImage.gameObject).onClick = next;
        UUIEventListener.Get(roleImage.gameObject).onClick           = next;

        UUIEventListener.Get(speedUpText.gameObject).onClick = speedUp;
        JsonUtility.FromJsonOverwrite(GameJSON.text, this);
        setCurrentTag(startTag);

        optionBackgroundImage.gameObject.SetActive(false);
    }
Esempio n. 5
0
    void RegisterEvent()
    {
        UUIEventListener.Get(_start).onClick = StartBtn;
        UUIEventListener.Get(_pause).onClick = PauseBtn;

        GameObject quit = _canvas.transform.Find("quit").gameObject;

        UUIEventListener.Get(quit).onClick = QuitBtn;

        GameObject com = _canvas.transform.Find("com").gameObject;

        UUIEventListener.Get(com).onClick = ComBtn;

        GameObject leftRight = _canvas.transform.Find("LeftRight").gameObject;

        UUIEventListener.Get(leftRight).onClick = leftRightBtn;

        GameObject UpDown = _canvas.transform.Find("UpDown").gameObject;

        UUIEventListener.Get(UpDown).onClick = UpdownBtn;

        GameObject replay = _canvas.transform.Find("rePlay").gameObject;

        UUIEventListener.Get(replay).onClick = ReplayBtn;

        GameObject localVideo = _canvas.transform.Find("LocalVideo").gameObject;

        UUIEventListener.Get(localVideo).onClick = LocalVideoBtn;
        _hightVideoSprite = localVideo.GetComponent <Image>().sprite;
        _localVideo       = localVideo.GetComponent <Image>();


        GameObject netVideo = _canvas.transform.Find("NetVideo").gameObject;

        UUIEventListener.Get(netVideo).onClick = NetVideoBtn;
        _netVideo          = netVideo.GetComponent <Image>();
        _oldVideoSprite    = _netVideo.sprite;
        _netVideo.sprite   = _hightVideoSprite; //默认是网络
        _localVideo.sprite = _oldVideoSprite;
    }
Esempio n. 6
0
 public void RegOnBeginDrag(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onDragBegin = OnBeginDrag;
     onDragBegin = cb;
 }
Esempio n. 7
0
 public void RegOnDrop(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onDrop = OnDrop;
     onDrop = cb;
 }
Esempio n. 8
0
 public void RegOnEndDrag(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onDragEnd = OnEndDrag;
     onDragEnd = cb;
 }
Esempio n. 9
0
 public void RegOnDeselect(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onDeSelect = OnDeselect;
     onDeSelect = cb;
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     //GameObject go = startImage.gameObject;
     //Debug.Log ("" + go.ToString ());
     UUIEventListener.Get(startImage.gameObject).onClick = jumpToScene1;
 }
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     UUIEventListener.Get(startImage.gameObject).onClick = jumpToScene1;
 }
Esempio n. 12
0
 public void RegOnEnter(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onEnter = OnPointerEnter;
     onEnter = cb;
 }
Esempio n. 13
0
 public void RegOnDown(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onDown = OnPointerDown;
     onDown = cb;
 }
Esempio n. 14
0
 public void RegOnClick(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onClick = OnPointerClick;
     onClick = cb;
 }
Esempio n. 15
0
 void Start()
 {
     instance = this;
     UUIEventListener.Get(showLogButton.gameObject).onClick = _ => logPanel.gameObject.SetActive(!logPanel.gameObject.activeSelf);
     DontDestroyOnLoad(transformParent.gameObject);
 }
Esempio n. 16
0
 public void RegOnScroll(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onScroll = OnScroll;
     onScroll = cb;
 }
Esempio n. 17
0
 public void RegOnMove(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onMove = OnMove;
     onMove = cb;
 }
Esempio n. 18
0
 public void RegOnExit(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onExit = OnPointerExit;
     onExit = cb;
 }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     Debug.Log(PlayerPrefs.GetInt("endTag"));
     UUIEventListener.Get(replayImage.gameObject).onClick = rePlay;
 }
Esempio n. 20
0
 public void RegOnUp(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onUp = OnPointerUp;
     onUp = cb;
 }
Esempio n. 21
0
 public void RegOnUpdateSelected(VoidDelegate cb)
 {
     UUIEventListener.Get(gameObject).onUpdateSelect = OnUpdateSelected;
     onUpdateSelect = cb;
 }
Esempio n. 22
0
 static public UUIEventListener Get(Transform go)
 {
     return(UUIEventListener.Get(go.gameObject));
 }