コード例 #1
0
ファイル: TopListView.cs プロジェクト: 602147629/GDGJ_Script
        protected override void Init()
        {
            NGUITools.FindInChild <Button>(gameObject, "btn_close").onClick = CloseClick;

            goldRank     = FindInChild <UIToggle>("right/rankbutton/gold");
            fightRank    = FindInChild <UIToggle>("right/rankbutton/fight");
            levelRank    = FindInChild <UIToggle>("right/rankbutton/level");
            battleRank   = FindInChild <UIToggle>("right/rankbutton/battle");
            rankInfoList = new List <GameObject>();
            for (int i = 101; i <= 100 + RankNum; i++)
            {
                rankInfoList.Add(FindChild("right/list/container/oncenter/" + i));
                rankInfoList[i - 101].GetComponent <UIWidgetContainer>().onClick = OnRoleRankInfoClick;
            }
            self = FindChild("right/self");
            left = FindChild("left");
            left.SetActive(false);
            selected = FindChild("right/select");
            selected.SetActive(false);

            goldRank.onStateChange   = OnRankButtonToggleChange;
            fightRank.onStateChange  = OnRankButtonToggleChange;
            levelRank.onStateChange  = OnRankButtonToggleChange;
            battleRank.onStateChange = OnRankButtonToggleChange;

            spin      = FindInChild <SpinWithMouse>("mode");
            equipList = new List <ItemContainer>();
            GetLeftItemList();
            InitLabel();
        }
コード例 #2
0
ファイル: RoleView.cs プロジェクト: 602147629/GDGJ_Script
        protected override void Init()
        {
            base.showTween = FindInChild <TweenPlay>();
            roleBackground = FindChild("rolebackground");
            repuGameObject = FindChild("Medal/repu");
            modelSpin      = NGUITools.FindInChild <SpinWithMouse>(roleBackground, "rolebackgroundl");
            EventDelegate.Add(base.showTween.onFinished, GoodsView.Instance.ResetGird);
            tweenPosition = FindInChild <TweenPosition>();
            ckb_shuxing   = FindInChild <UIToggle>("top/ckb_shuxing");
            ckb_shuxing.FindInChild <UILabel>("label").text = LanguageManager.GetWord("RoleView.PropertyTab");
            ckb_beibao = FindInChild <UIToggle>("top/ckb_beibao");
            ckb_beibao.FindInChild <UILabel>("label").text = LanguageManager.GetWord("RoleView.BagTab");
            ckb_peiyue = FindInChild <UIToggle>("top/ckb_peiyu");
            ckb_peiyue.FindInChild <UILabel>("label").text = LanguageManager.GetWord("RoleView.GrowTab");
            ckb_medal = FindInChild <UIToggle>("top/ckb_medal");
            ckb_medal.FindInChild <UILabel>("label").text = LanguageManager.GetWord("RoleView.MedalTab");

            btn_close = FindInChild <Button>("topright/btn_close");

            btn_close.clickDelegate += CloseView;

            EventDelegate.Add(ckb_medal.onChange, TabViewOnClick);
            EventDelegate.Add(ckb_shuxing.onChange, TabViewOnClick);
            EventDelegate.Add(ckb_peiyue.onChange, TabViewOnClick);
            EventDelegate.Add(ckb_beibao.onChange, TabViewOnClick);

            Singleton <GoodsView> .Instance.gameObject    = FindChild("Goods");
            Singleton <RolePropView> .Instance.gameObject = FindChild("Property");
            Singleton <GrowView> .Instance.gameObject     = FindChild("Grow");
            MedalView.Instance.gameObject = FindChild("Medal");
        }
コード例 #3
0
 void ShowSkill()
 {
     NGUIUtil.SetActive(MyHead.SkillInfo, true);
     NGUIUtil.SetActive(MyHead.BtnOK.gameObject, true);
     if (GoSoldier != null)
     {
         SpinWithMouse spinHero = MyHead.WndBg.AddComponent <SpinWithMouse>();
         if (spinHero != null)
         {
             spinHero.target = GoSoldier.transform;
         }
     }
 }
コード例 #4
0
    public GameObject CreatModel(string goName, PosType pos, SpinWithMouse spin, AnimType type = AnimType.None, int rota = 180, float z = 0)
    {
        this.type = type;
        model     = null;
        DestroyModel(pos);
        SetEmbattleBG(pos);
        model = Resource.CreateCharacter(goName, parent.gameObject);
        if (goName == "boss_009")
        {
            model.transform.localPosition = new Vector3(0, 0.2f, 0);
        }
        model.transform.localRotation = Quaternion.Euler(0, rota, 0);
        if (z != 0)
        {
            model.transform.localPosition = new Vector3(0, 0, z);
        }
        Transform redCircle = model.transform.FindChild("Effect_targetselected01");

        if (redCircle != null)
        {
            redCircle.gameObject.SetActive(false);
        }
        NGUITools.SetLayer(model, LayerMask.NameToLayer("UI"));
        model.tag = Tag.monster;
        //if (pos == PosType.SelectPos)
        //{
        //    model.transform.localScale = model.transform.localScale * 1.4f;
        //}
        GameObject taizi = transform.Find("TitlePos/fazhenxuanren_taizi").gameObject;

        if (taizi != null && pos == PosType.TitlePos)
        {
            model.transform.parent = taizi.transform;
            spin.target            = taizi.transform;
        }
        else if (pos == PosType.SelectPos)
        {
            spin.target = SelectPos;
        }
        else if (spin != null)
        {
            spin.target = model.transform;
        }

        if (null != model)
        {
            PlayAppearedAnim(model);
        }
        return(model);
    }
コード例 #5
0
        protected override void Init()
        {
            btnClose  = FindInChild <Button>("center/topright/btn_close");
            labLevel  = FindInChild <UILabel>("center/info/title/lvl");
            labName   = FindInChild <UILabel>("center/info/title/name");
            labForce  = FindInChild <UILabel>("center/info/force/zl");
            centerObj = transform.Find("center").gameObject;

            roleBackground = FindChild("center/rolebackground");
            modelSpin      = NGUITools.FindInChild <SpinWithMouse>(roleBackground, "rolebackgroundl");

            btnClose.onClick = CloseOnClick;

            GetLeftItemList();
        }
コード例 #6
0
        protected override void Init()
        {
            //btn_back.
            btn_start = Tools.find(gameObject, "btn_start").GetComponent <UIWidgetContainer>();
            btn_start.FindInChild <UILabel>("label").text = LanguageManager.GetWord("RoleCreate.BtnStart");
            //btn_back = Tools.find(gameObject, "btn_fanhui").GetComponent<UIWidgetContainer>();
            btn_random  = Tools.find(gameObject, "btn_random").GetComponent <Button>();
            input       = Tools.find(gameObject, "inp_name").GetComponent <UIInput>();
            yuansushi   = Tools.find(gameObject, "ckb_yss").GetComponent <UIToggle>();
            mojianshi   = Tools.find(gameObject, "ckb_mjs").GetComponent <UIToggle>();
            qiangxieshi = Tools.find(gameObject, "ckb_qxs").GetComponent <UIToggle>();
            //yuansushiSprite = Tools.find(gameObject, "rw/yss").GetComponent<UI2DSprite>();
            //mojianshiSprite = Tools.find(gameObject, "rw/mjs").GetComponent<UI2DSprite>();
            //qiangxieshiSprite = Tools.find(gameObject, "rw/qxs").GetComponent<UI2DSprite>();

            //scale = FindInChild<TweenScale>("rw");
            //yssInfoSprite = FindInChild<UISprite>("info/yuansushi");
            //mjsInfoSprite = FindInChild<UISprite>("info/mojianshi");
            //qxsInfoSprite = FindInChild<UISprite>("info/qiangxieshi");
            tipsLabel       = FindInChild <UILabel>("info/shuoming");
            info            = FindChild("info").transform;
            info.localScale = Vector3.one;
            info.gameObject.SetActive(true);

            modelSpin = NGUITools.FindInChild <SpinWithMouse>(gameObject, "mode");

            btn_random.onClick += RandomName;
            btn_start.onClick  += StartGame;
            //btn_back.onClick = BackOnClick;
            yuansushi.startsActive   = false;
            mojianshi.startsActive   = false;
            qiangxieshi.startsActive = false;
            //yuansushiSprite.gameObject.SetActive(false);
            //qiangxieshiSprite.gameObject.SetActive(false);
            //mojianshiSprite.gameObject.SetActive(false);
            yuansushi.onStateChange   += CheckBoxStateChange;
            mojianshi.onStateChange   += CheckBoxStateChange;
            qiangxieshi.onStateChange += CheckBoxStateChange;
            //input.onChange.Add(new EventDelegate(LimitNameShow));  //限制显示名字的长度
            input.characterLimit = 6; //限制最长为6个字符
            // LoadRandomNameData();
            gameObject.SetActive(false);
            NGUITools.SetLayer(gameObject, LayerMask.NameToLayer("Mode"));
            EffectMgr.Instance.CreateUIEffect(EffectId.UI_SelectRoleStage1, Vector3.zero, OnFirstEffectOver);
            // play = NGUITools.FindInChild<TweenPlay>(gameObject, "mode");
            FindInChild <UIWidgetContainer>("mode").onClick = OnRoleClick;
        }
コード例 #7
0
    static int set_speed(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SpinWithMouse obj  = (SpinWithMouse)o;
            float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.speed = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index speed on a nil value" : e.Message));
        }
    }
コード例 #8
0
    static int set_target(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SpinWithMouse         obj  = (SpinWithMouse)o;
            UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
            obj.target = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index target on a nil value" : e.Message));
        }
    }
コード例 #9
0
    static int get_speed(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SpinWithMouse obj = (SpinWithMouse)o;
            float         ret = obj.speed;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index speed on a nil value" : e.Message));
        }
    }
コード例 #10
0
    static int get_target(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SpinWithMouse         obj = (SpinWithMouse)o;
            UnityEngine.Transform ret = obj.target;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index target on a nil value" : e.Message));
        }
    }
コード例 #11
0
    protected override void Init()
    {
        instance        = this;
        HeroPosEmb      = GameObject.Find("HeroPosEmbattle");
        dingweigrid     = transform.Find("DingweiContainer/Grid").GetComponent <UIGrid>();
        tediangrid      = transform.Find("TedianContainer/Grid").GetComponent <UIGrid>();
        login           = VOManager.Instance().GetCSV <LoginCSV>("Login").GetVoList();
        sureBtn.onClick = OnSureBtn;
        //randomBtn.onClick = OnRandomClick;
        pai1              = transform.Find("pai1").GetComponent <UIToggle>();
        pai2              = transform.Find("pai2").GetComponent <UIToggle>();
        pai3              = transform.Find("pai3").GetComponent <UIToggle>();
        skillMultList     = transform.Find("ScrollView/MultList").GetComponent <GUISingleMultList>();
        skillPanel        = transform.Find("SkillDescribePanel");
        heroName          = transform.Find("Name").GetComponent <UILabel>();
        des               = transform.Find("ScrollViewLabel/Des").GetComponent <UILabel>();
        checkBoxs.onClick = OnCreateRoleClick;
        boxs              = checkBoxs.GetBoxList();
        //for (int i = 0; i < boxs.Length; i++)
        //{
        //    boxs[i].GetComponent<UISprite>().spriteName = ((LoginVO)login[i + 1]).card_name.Trim();
        //}
        //checkBoxs.onHover = OnCreateRoleHover;
        //selectRoleSceneObj = GameObject.Find("Xuanren").transform;
        EventDelegate ed2 = new EventDelegate(this, "OnSelectCard");

        pai1.onChange.Add(ed2);
        pai2.onChange.Add(ed2);
        pai3.onChange.Add(ed2);
        backBtn.onClick = OnBackClick;
        //if (FSDataNodeTable<PlayerNameNode>.GetSingleton().DataNodeList.Count > 0)
        //{
        //    nodeDic = FSDataNodeTable<PlayerNameNode>.GetSingleton().DataNodeList;
        //    foreach (var nameLists in nodeDic)
        //    {

        //        playerData.GetInstance().selfData.nameList.Add(nameLists.Value);
        //    }

        //}
        InitNameList();
        //EventDelegate.Add(nicknameInput.GetComponent<UIInput>().onChange, OnChange);
        spinWithMouse = transform.Find("HeroTexture").GetComponent <SpinWithMouse>();
        collder       = transform.transform.Find("HeroTexture").GetComponent <BoxCollider>();
    }
コード例 #12
0
    public GameObject CreatModelByModelID(int modelId, PosType pos, SpinWithMouse spin, MountAndPet type, int rota = 180, AnimType animType = AnimType.None)
    {
        this.type = animType;
        model     = null;
        DestroyModel(pos);
        SetEmbattleBG(pos);
        if (FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList.ContainsKey(modelId))
        {
            string path = FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList[modelId].respath;

            if (FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList[modelId].respath.Contains("yx_"))
            {
                path = FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList[modelId].respath + "_show";
            }
            model = Instantiate(Resources.Load(FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList[modelId].respath)) as GameObject;
            model.transform.parent        = parent.transform;
            model.transform.localPosition = default(Vector3);
            if (Resource.GetNameByPath(modelId) == "boss_009")
            {
                model.transform.localPosition = new Vector3(0, 0.2f, 0);
            }
            model.transform.localRotation = Quaternion.identity;
            model.name = modelId + "";
            model.transform.localRotation = Quaternion.Euler(0, rota, 0);
            model.tag = Tag.monster;
            Transform redCircle = model.transform.FindChild("Effect_targetselected01");
            if (redCircle != null)
            {
                redCircle.gameObject.SetActive(false);
            }
            NGUITools.SetLayer(model, LayerMask.NameToLayer("UI"));

            if (pos == PosType.SelectPos)
            {
                model.transform.localScale = model.transform.localScale * 1.4f;
            }
            if (pos == PosType.NpcPos)
            {
                model.transform.localScale = Vector3.one * FSDataNodeTable <ModelNode> .GetSingleton().DataNodeList[modelId].modelSize;
            }
            GameObject taizi = transform.Find("TitlePos/fazhenxuanren_taizi").gameObject;
            if (taizi != null && pos == PosType.TitlePos)
            {
                model.transform.parent = taizi.transform;
                if (null != spin)
                {
                    spin.target = taizi.transform;
                }
                if (type == MountAndPet.Mount)
                {
                    taizi.transform.localRotation = Quaternion.Euler(-90f, -60f, 0f);
                    model.transform.localScale    = Vector3.one * 1.3f;
                }
                else
                {
                    model.transform.localScale = Vector3.one * 2f;
                }
                MountAndPetAnim(model);
            }
            else
            {
                if (null != spin)
                {
                    spin.target = model.transform;
                }
            }
        }


        return(model);
    }