Exemple #1
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        RegisterEvent();

        mTitle               = PrefabTf.Find("textTitle").GetComponent <Text>();
        mTip                 = PrefabTf.Find("textTip").GetComponent <Text>();
        mBtnCreateRoom       = PrefabTf.Find("btnCreate").GetComponent <Button> ();
        mBtnEnterRoom        = PrefabTf.Find("btnEnter").GetComponent <Button> ();
        mBtnLeaveRoom        = PrefabTf.Find("btnLeave").GetComponent <Button> ();
        mBtnReady            = PrefabTf.Find("btnReady").GetComponent <Button> ();
        mInputRoomName       = PrefabTf.Find("inputRoomName").GetComponent <InputField> ();
        mInputRoomId         = PrefabTf.Find("inputRoomId").GetComponent <InputField> ();
        mAccountGrid         = PrefabTf.Find("accountGrid").GetComponent <GridLayoutGroup>();
        mAccountItemTemplate = PrefabTf.Find("accountItemTemplate").gameObject;
        mAccountItemTemplate.SetActive(false);

        EventTriggerListener.Get(mBtnCreateRoom.gameObject).onClick = OnCreateClicket;
        EventTriggerListener.Get(mBtnEnterRoom.gameObject).onClick  = OnEnterClicked;
        EventTriggerListener.Get(mBtnLeaveRoom.gameObject).onClick  = OnLeaveClicked;
        EventTriggerListener.Get(mBtnReady.gameObject).onClick      = OnReadyClicked;

        mTitle.text = "注册或者登录";
        mTip.text   = string.Empty;
        RefreshView();
    }
Exemple #2
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        mJostickController = new JostickController();
        mJostickController.Init(PrefabTf.Find("SimpleTouchJoystick"), delegate() {
            mIsDirty = true;
        }, delegate() {
            mIsDirty = true;
        }, delegate() {
            mIsDirty = true;
        });

        mTimerId = TimerManager.Instance.RepeatCall(ulong.MaxValue, delegate() {
            if (!mIsDirty)
            {
                return;
            }
            if (mJostickController.touchPresent)
            {
                GameBattle.LogicLayer.OperatorManager.Instance.MoveJoystick(mJostickController.movementVector);
            }
            else
            {
                GameBattle.LogicLayer.OperatorManager.Instance.StopMove();
            }
            mIsDirty = false;
        });
    }
Exemple #3
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        mTitle       = PrefabTf.Find("textTitle").GetComponent <Text>();
        mBtnPlayGame = PrefabTf.Find("btnNewGame").GetComponent <Button> ();
        EventTriggerListener.Get(mBtnPlayGame.gameObject).onClick = OnPlayClicked;

        mTitle.text = "哈哈主界面";
    }
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);

        mTip      = PrefabTf.Find("textTip").GetComponent <Text>();
        mTip.text = string.Empty;
        AddObjectEventListener(EventId.LoadingViewTips, delegate(object eventParam) {
            Tupple <float, string> curProcess = eventParam as Tupple <float, string>;
            mTip.text = curProcess.item2 + "(" + curProcess.item1.ToString() + "%)";
        });
    }
Exemple #5
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        RegisterEvent();

        mTitle            = PrefabTf.Find("textTitle").GetComponent <Text>();
        mTip              = PrefabTf.Find("textTip").GetComponent <Text>();
        mBtnLogin         = PrefabTf.Find("btnLogin").GetComponent <Button> ();
        mBtnRegist        = PrefabTf.Find("btnRegist").GetComponent <Button> ();
        mInputAccountName = PrefabTf.Find("inputAccountName").GetComponent <InputField> ();
        mInputPassword    = PrefabTf.Find("inputPassword").GetComponent <InputField> ();

        EventTriggerListener.Get(mBtnLogin.gameObject).onClick  = OnLoginClicked;
        EventTriggerListener.Get(mBtnRegist.gameObject).onClick = OnRegistClicked;

        mTitle.text = "注册或者登录";
        mTip.text   = string.Empty;
    }
Exemple #6
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        List <int> selfSkillList = openParam as List <int>;

        mSkillOpes = new SkillViewOpe[selfSkillList.Count];
        for (int i = 0; i < selfSkillList.Count; ++i)
        {
            int skillId = selfSkillList[i];
            GDSKit.SkillConfig skillConfig = GDSKit.SkillConfig.GetInstance(skillId);
            Transform          tf          = PrefabTf.Find("skill" + i);
            switch ((SkillType)skillConfig.targetInfo.type)
            {
            case SkillType.NoTargetSkill:
                break;

            case SkillType.UnitTargetSkill:
                break;

            case SkillType.AreaTargetSkill:
                if (skillConfig.distance <= 0)
                {
                    SkillViewClickOpe clickOpe = new SkillViewClickOpe();
                    clickOpe.Init(skillConfig, tf);
                    mSkillOpes[i] = clickOpe;
                }
                else
                {
                    SkillViewJostickOpe jostickOpe = new SkillViewJostickOpe();
                    jostickOpe.Init(skillConfig, tf);
                    mSkillOpes[i] = jostickOpe;
                }
                break;

            default:
                throw new System.NotImplementedException("技能界面未实现的技能类型 " + skillConfig.targetInfo.type);
            }
        }
    }