Beispiel #1
0
        public void refreshVipLv(uint viplv)
        {
            bool flag = viplv == 0u;

            if (flag)
            {
                bool active = this.vipIcon.gameObject.active;
                if (active)
                {
                    this.vipIcon.gameObject.SetActive(false);
                }
            }
            else
            {
                bool flag2 = this.curName == null;
                if (!flag2)
                {
                    this.vipIcon.gameObject.SetActive(true);
                    this.vipIcon.sprite = U3DAPI.U3DResLoad <Sprite>("icon/vip/" + viplv);
                    this.vipIcon.transform.SetParent(this.curName.transform, false);
                    Vector2 anchoredPosition = this.rectVipIcon.anchoredPosition;
                    Vector2 sizeDelta        = this.rectVipIcon.sizeDelta;
                }
            }
        }
Beispiel #2
0
    void Start()
    {
        WIN_MTL_1  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_baoshi");
        LOSE_MTL_1 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_baoshi2");
        NONE_1     = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_baoshi3");

        WIN_MTL_2  = U3DAPI.U3DResLoad <Material>("mtl/faguan_lan");
        LOSE_MTL_2 = U3DAPI.U3DResLoad <Material>("mtl/faguan_hong");

        WIN_MTL_3  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_fuwen");
        LOSE_MTL_3 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_fuwen2");

        WIN_MTL_4  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian");
        LOSE_MTL_4 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_hongdi");
        NONE_4     = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_hongdi2");

        WIN_MTL_5  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian2");
        LOSE_MTL_5 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_hong");

        WIN_MTL_6  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_zhutou");
        LOSE_MTL_6 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_zhutou2");

        WIN_MTL_7  = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_diquan");
        LOSE_MTL_7 = U3DAPI.U3DResLoad <Material>("mtl/zc_judian_diquan2");
    }
Beispiel #3
0
        public void useCamera(string id)
        {
            bool flag = this.transUser == null;

            if (flag)
            {
                this.transUser = FightAniUserTempSC.goUser.transform;
            }
            bool flag2 = this.process == null;

            if (flag2)
            {
                this.process = new processStruct(new Action <float>(this.onUpdate), "GameCameraMgr", false, false);
            }
            this.clearCurCamera();
            GameObject gameObject = U3DAPI.U3DResLoad <GameObject>(id);
            bool       flag3      = gameObject == null;

            if (!flag3)
            {
                this.curGoCamera = UnityEngine.Object.Instantiate <GameObject>(gameObject);
                this.curGoCamera.transform.SetParent(this.transUser, false);
                this.curScCamera = this.curGoCamera.transform.FindChild("Camera").GetComponent <CameraAniTempCS>();
                bool flag4 = this.curScCamera == null;
                if (flag4)
                {
                    this.curScCamera = this.curGoCamera.transform.FindChild("Camera").gameObject.AddComponent <CameraAniTempCS>();
                }
                this.curTransCamera = this.curGoCamera.transform.FindChild("Camera");
                this.animator       = this.curGoCamera.transform.FindChild("Camera").GetComponent <Animator>();
                this.animator.speed = 1f;
                GRMap.GAME_CAMERA.SetActive(false);
                (CrossApp.singleton.getPlugin("processManager") as processManager).addProcess(this.process, false);
            }
        }
        private void Model_LoadedOK(UnityEngine.Object model_obj, System.Object data)
        {
            GameObject obj_prefab = model_obj as GameObject;

            if (obj_prefab == U3DAPI.DEF_GAMEOBJ || obj_prefab == null)
            {
                Debug.LogError("not find model = " + m_strModelPath);
                model_obj = U3DAPI.U3DResLoad <GameObject>("def_role");
            }

            GameObject npcObj = GameObject.Instantiate(model_obj) as GameObject;

            npcObj.transform.SetParent(gameObject.transform, false);
            npcObj.transform.SetAsFirstSibling();
            foreach (Transform tran in npcObj.gameObject.GetComponentsInChildren <Transform>())
            {
                if (model_obj.name == "npc_111")
                {
                    tran.gameObject.layer = EnumLayer.LM_SELFROLE;
                }
                else
                {
                    tran.gameObject.layer = EnumLayer.LM_NPC;
                }
            }

            anim             = npcObj.transform.FindChild("model").GetComponent <Animator>();
            anim.cullingMode = AnimatorCullingMode.AlwaysAnimate;
        }
Beispiel #5
0
        public static void loadBaseData()
        {
            SHADOW_PREFAB = U3DAPI.U3DResLoad <GameObject>("default/shadow");
            if (SHADOW_PREFAB == null)
            {
                SHADOW_PREFAB = new GameObject();
            }

            HIT_Main_Color_nameID = Shader.PropertyToID("_Color");
            HIT_Rim_Color_nameID  = Shader.PropertyToID("_RimColor");
            HIT_Rim_Width_nameID  = Shader.PropertyToID("_RimWidth");

            MTL_Main_Tex = Shader.PropertyToID("_MainTex");
            MTL_Dead_Tex = Shader.PropertyToID("_MainTex");
            MTL_Born_Tex = Shader.PropertyToID("_MainTex");

            BORN_MTL       = U3DAPI.U3DResLoad <Material>("mtl/born_mtl");
            DEAD_MTL       = U3DAPI.U3DResLoad <Material>("mtl/dead_mtl");
            DEAD_MT_AMOUNT = Shader.PropertyToID("_Amount");
            BORN_MT_AMOUNT = Shader.PropertyToID("_Amount");

            CHAR_MTL = U3DAPI.U3DResLoad <Material>("mtl/char_mtl");

            EnumMaterial.EMT_EQUIP_L    = U3DAPI.U3DResLoad <Material>("mtl/equip_low");
            EnumMaterial.EMT_EQUIP_H    = U3DAPI.U3DResLoad <Material>("mtl/equip_high");
            EnumMaterial.EMT_SKILL_HIDE = U3DAPI.U3DResLoad <Material>("mtl/skill_hide");
        }
        override public void init()
        {
            mInstance = this;
            inText();
            m_ItemCurrentTeamInfoDic = new Dictionary <uint, ItemCurrentTeamInfo>();
            friend                = getTransformByPath("contant/friend/friend");
            root                  = this.transform;
            mMaterialGrey         = U3DAPI.U3DResLoad <Material>("uifx/uiGray");
            mContant              = transform.FindChild("contant");
            itemCurrentInfoPrefab = transform.FindChild("temp/itemMemberInfo");

            leaveOnLineSprite = GAMEAPI.ABUI_LoadSprite("icon_comm_icon_notice");//TODO:临时离线图片资源替代
            deadSprite        = GAMEAPI.ABUI_LoadSprite("icon_job_icon_boss");
            new BaseButton(getTransformByPath("contant/friend/friend/go")).onClick = (GameObject go) =>
            {
                if (GRMap.instance.m_nCurMapID >= 3333)
                {
                    flytxt.instance.fly(ContMgr.getCont("a3_currentTeamInfo_cant_invite_inFb"));
                    return;
                }
                ArrayList array = new ArrayList();
                array.Add(2);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SHEJIAO, array);
            };
        }
Beispiel #7
0
        protected void initMesh()
        {
            GameObject gameObject = U3DAPI.U3DResLoad <GameObject>("creatchar/cc_scene");
            bool       flag       = gameObject != null;

            if (flag)
            {
                this.m_theScene = UnityEngine.Object.Instantiate <GameObject>(gameObject);
            }
            this.m_skmesh_cc_male = (GRClient.instance.world.createEntity(Define.GREntityType.CHARACTER) as GRCharacter3D);
            this.m_skmesh_cc_male.load(GraphManager.singleton.getCharacterConf("0"), null, null);
            this.m_skmesh_cc_male.applyAvatar(GraphManager.singleton.getAvatarConf("0", "10000"), null);
            this.m_skmesh_cc_male.pos  = new Vec3(0.1f, -100f, 1.5f);
            this.m_skmesh_cc_male.rotY = 317f;
            this.m_skmesh_cc_female    = (GRClient.instance.world.createEntity(Define.GREntityType.CHARACTER) as GRCharacter3D);
            this.m_skmesh_cc_female.load(GraphManager.singleton.getCharacterConf("1"), null, null);
            this.m_skmesh_cc_female.applyAvatar(GraphManager.singleton.getAvatarConf("1", "10001"), null);
            this.m_skmesh_cc_female.pos  = new Vec3(0.1f, -100f, 1.5f);
            this.m_skmesh_cc_female.rotY = 297f;
            GRClient.instance.getGraphCamera().visible = false;
            this.m_bMale_BodyHair_Loaded   = false;
            this.m_bMale_Weapon_Loaded     = false;
            this.m_bFemale_BodyHair_Loaded = false;
            this.m_bFemale_Weapon_Loaded   = false;
        }
Beispiel #8
0
 public override void onClosed()
 {
     this.disposeAvatar();
     InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
     U3DAPI.functionbar_BackFrom();
     SceneCamera.m_curGameObj.SetActive(true);
     a3_liteMinimap.instance.miniMapActive = true;
 }
Beispiel #9
0
 public override void onShowed()
 {
     this.createAvatar();
     InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR);
     base.transform.FindChild("ig_bg_bg").gameObject.SetActive(false);
     U3DAPI.functionbar_ChangeTo();
     SceneCamera.m_curGameObj.SetActive(false);
     a3_liteMinimap.instance.miniMapActive = false;
 }
Beispiel #10
0
        public NewbieModel()
        {
            Transform  transform  = GameObject.Find("newbieLayer").transform;
            GameObject original   = U3DAPI.U3DResLoad <GameObject>("prefab/newbiebg");
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

            this.bgitem = new BgItem(gameObject.transform, transform);
            gameObject  = UnityEngine.Object.Instantiate <GameObject>(original);
        }
Beispiel #11
0
        public void InitPlayerCam(bool active = false)
        {
            bool flag = this.m_player_camera == null;

            if (flag)
            {
                this.m_player_camera = UnityEngine.Object.Instantiate <GameObject>(U3DAPI.U3DResLoad <GameObject>("camera/player_camera"));
            }
            this.m_player_camera.SetActive(active);
        }
Beispiel #12
0
        public void InitNPCCam(bool active = true)
        {
            bool flag = this.m_npc_camera == null;

            if (flag)
            {
                this.m_npc_camera = UnityEngine.Object.Instantiate <GameObject>(U3DAPI.U3DResLoad <GameObject>("camera/npc_camera"));
            }
            this.m_npc_camera.SetActive(active);
        }
Beispiel #13
0
    public static void Init_DEFAULT()
    {
        DEF_GAMEOBJ.name = "DEF_GAMEOBJ";

        GameObject obj_prefab = U3DAPI.U3DResLoad <GameObject>("default/skinned_mesh_renderer");

        DEF_SKINNEDMESHRENDERER = obj_prefab.GetComponent <SkinnedMeshRenderer>();
        DEF_ANIMATOR            = obj_prefab.GetComponent <Animator>();

        DEF_TEX2D = new Texture2D(4, 4);

        DEF_SPRITE = Sprite.Create(DEF_TEX2D, new Rect(0f, 0f, 4f, 4f), new Vector2(0f, 0f));
    }
    // Use this for initialization
    void Start()
    {
        curShader = U3DAPI.U3DResLoad <Shader>("CameraShaders/DeathShader");
        if (SystemInfo.supportsImageEffects == false)
        {
            enabled = false;
            return;
        }

        if (curShader != null && curShader.isSupported == false)
        {
            enabled = false;
        }
    }
Beispiel #15
0
        private void initScence()
        {
            GameObject original = U3DAPI.U3DResLoad <GameObject>("ui_mesh/login/loginscene");

            this.scene  = UnityEngine.Object.Instantiate <GameObject>(original);
            this.aniCam = this.scene.transform.FindChild("camera").GetComponent <Animation>();
            LightmapSettings.lightmaps = new LightmapData[]
            {
                new LightmapData
                {
                    lightmapFar = Resources.Load("ui_mesh/login/scene/LightmapFar-0") as Texture2D
                }
            };
            InterfaceMgr.ui_Camera_cam.gameObject.SetActive(false);
        }
        void Start()
        {
            Debug.LogError("进城战");
            WIN_MTL_1 = U3DAPI.U3DResLoad <Material>("mtl/zc2_chengmen1");
            WIN_MTL_2 = U3DAPI.U3DResLoad <Material>("mtl/zc2_chengmen2");

            A3_cityOfWarProxy.getInstance().addEventListener(A3_cityOfWarProxy.REFRESHFBINFO, onFbInfo);
            door = GameObject.Find("Object368");
            door.SetActive(true);
            PlayerModel.getInstance().inCityWar = true;
            InvokeRepeating("refersh_Nav", 0, 3f);
            door.GetComponent <MeshRenderer>().material = WIN_MTL_2;

            InvokeRepeating("Refsignal", 0, 1);
        }
Beispiel #17
0
        public void ADDO()
        {
            Material mat = U3DAPI.U3DResLoad <Material>("uifx/uiGray");

            if (mat == null)
            {
                Debug.LogError("找不到需求材质! = uiGray.mat");
                return;
            }
            foreach (var v in transform.GetComponentsInChildren <Image>())
            {
                v.material = mat;
                v.material.SetFloat("_grayScale", 0.3f);
            }
            IsDark = true;
        }
Beispiel #18
0
        void initScence()
        {
            GameObject temp = U3DAPI.U3DResLoad <GameObject>("ui_mesh/login/loginscene");

            scene = GameObject.Instantiate(temp) as GameObject;

            aniCam = scene.transform.FindChild("camera").GetComponent <Animation>();


            //LightmapData lightmapData = new LightmapData();
            //lightmapData.lightmapFar = U3DAPI.U3DResLoad<Texture2D>("ui_mesh/login/scene/LightmapFar-0") as Texture2D;
            //LightmapSettings.lightmaps = new LightmapData[] { lightmapData };


            InterfaceMgr.ui_Camera_cam.gameObject.SetActive(false);
        }
Beispiel #19
0
    //出生的材质变化
    public virtual void onBornStart(int type)
    {
        if (m_MonBody != null)
        {
            Material born_mtl             = U3DAPI.U3DResLoad <Material>("mtl/born_mtl" + type);
            SkinnedMeshRenderer[] curSMRs = m_MonBody.GetComponentsInChildren <SkinnedMeshRenderer>();
            for (int i = 0; i < curSMRs.Length; i++)
            {
                Material mtl_inst = GameObject.Instantiate(born_mtl) as Material;
                Texture  tex      = curSMRs[i].material.GetTexture(gameST.MTL_Main_Tex);
                mtl_inst.SetTexture(gameST.MTL_Dead_Tex, tex);

                curSMRs[i].material = mtl_inst;
            }
            m_MonBody.material.SetFloat(gameST.DEAD_MT_AMOUNT, m_live_Burn);
            m_bchangeLiveMtl = true;
        }
    }
Beispiel #20
0
        public void refreshTitle(int title_id)
        {
            bool flag = title_id == 0;

            if (flag)
            {
                this.titleIcon.gameObject.SetActive(false);
            }
            else
            {
                bool flag2 = this.curName == null;
                if (!flag2)
                {
                    this.titleIcon.gameObject.SetActive(true);
                    this.titleIcon.sprite = U3DAPI.U3DResLoad <Sprite>("icon/achievement/title_ui/t" + title_id);
                    this.titleIcon.SetNativeSize();
                }
            }
        }
Beispiel #21
0
    public virtual void onBornStart(int type)
    {
        bool flag = this.m_MonBody != null;

        if (flag)
        {
            Material original = U3DAPI.U3DResLoad <Material>("mtl/born_mtl" + type);
            SkinnedMeshRenderer[] componentsInChildren = this.m_MonBody.GetComponentsInChildren <SkinnedMeshRenderer>();
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                Material material = UnityEngine.Object.Instantiate <Material>(original);
                Texture  texture  = componentsInChildren[i].material.GetTexture(gameST.MTL_Main_Tex);
                material.SetTexture(gameST.MTL_Dead_Tex, texture);
                componentsInChildren[i].material = material;
            }
            this.m_MonBody.material.SetFloat(gameST.DEAD_MT_AMOUNT, this.m_live_Burn);
            this.m_bchangeLiveMtl = true;
        }
    }
Beispiel #22
0
        public void QSMY_OPEN_PRELAB_id_path(string parm)
        {
            string[] array = parm.Split(new char[]
            {
                ','
            });
            bool flag = array.Length != 2;

            if (!flag)
            {
                GameObject gameObject = U3DAPI.U3DResLoad <GameObject>(array[1]);
                bool       flag2      = gameObject == null;
                if (!flag2)
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject);
                    gameObject2.transform.SetParent(InterfaceMgr.getInstance().winLayer, false);
                    InterfaceMgr.setUntouchable(gameObject2);
                    this.dPreLab[array[0]] = gameObject2;
                }
            }
        }
Beispiel #23
0
        private void OnShowAvatar(bool show)
        {
            if (show)
            {
                bool flag = this.m_npc_camera == null;
                if (flag)
                {
                    this.m_npc_camera = UnityEngine.Object.Instantiate <GameObject>(U3DAPI.U3DResLoad <GameObject>("camera/npc_camera"));
                }
            }
            this.m_anim_usr.gameObject.SetActive(show);
            bool flag2 = this.m_anim_npc != null;

            if (flag2)
            {
                GameObject expr_5A = this.m_anim_npc.gameObject;
                if (expr_5A != null)
                {
                    expr_5A.SetActive(show);
                }
            }
        }
Beispiel #24
0
        public static void loadBaseData()
        {
            gameST.SHADOW_PREFAB = Resources.Load <GameObject>("shadow/shadow");
            bool flag = gameST.SHADOW_PREFAB == null;

            if (flag)
            {
                gameST.SHADOW_PREFAB = new GameObject();
            }
            gameST.HIT_Main_Color_nameID = Shader.PropertyToID("_Color");
            gameST.HIT_Rim_Color_nameID  = Shader.PropertyToID("_RimColor");
            gameST.HIT_Rim_Width_nameID  = Shader.PropertyToID("_RimWidth");
            gameST.MTL_Main_Tex          = Shader.PropertyToID("_MainTex");
            gameST.MTL_Dead_Tex          = Shader.PropertyToID("_MainTex");
            gameST.MTL_Born_Tex          = Shader.PropertyToID("_MainTex");
            gameST.BORN_MTL             = U3DAPI.U3DResLoad <Material>("mtl/born_mtl");
            gameST.DEAD_MTL             = U3DAPI.U3DResLoad <Material>("mtl/dead_mtl");
            gameST.DEAD_MT_AMOUNT       = Shader.PropertyToID("_Amount");
            gameST.BORN_MT_AMOUNT       = Shader.PropertyToID("_Amount");
            gameST.CHAR_MTL             = U3DAPI.U3DResLoad <Material>("mtl/char_mtl");
            EnumMaterial.EMT_EQUIP_L    = U3DAPI.U3DResLoad <Material>("mtl/equip_low");
            EnumMaterial.EMT_EQUIP_H    = U3DAPI.U3DResLoad <Material>("mtl/equip_high");
            EnumMaterial.EMT_SKILL_HIDE = U3DAPI.U3DResLoad <Material>("mtl/skill_hide");
        }
Beispiel #25
0
        public bool linkWpRibbon()
        {
            bool flag = this.m_rib_Wp != null;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                Transform wpRibbon = this.getWpRibbon(this.m_char.gameObject.transform);
                bool      flag2    = wpRibbon != null;
                if (flag2)
                {
                    GameObject original = U3DAPI.U3DResLoad <GameObject>("ribbon/rib_1");
                    this.m_rib_Wp = UnityEngine.Object.Instantiate <GameObject>(original);
                    this.m_rib_Wp.transform.SetParent(wpRibbon, false);
                    this.m_rib_Active = true;
                }
                result = true;
            }
            return(result);
        }
Beispiel #26
0
 public static void Init_DEFAULT()
 {
     U3DAPI.Init_DEFAULT();
 }
Beispiel #27
0
        public void onAttchange(Variant msgData)
        {
            debug.Log("onAttchange::" + msgData.dump());
            BaseRole role = getRole(msgData["iid"]);

            if (role == null)
            {
                return;
            }

            //if (msgData.ContainsKey("hpadd") && msgData["hpadd"].ContainsKey("die") && msgData["hpadd"]["die"]._bool)
            //    role.Die(msgData);

            bool isUser = role.m_isMain;

            if (msgData.ContainsKey("speed") && role is ProfessionRole)
            {
                var pro = (role as ProfessionRole);

                pro.speed = msgData["speed"]._int;

                if (isUser)
                {
                    PlayerModel.getInstance().speed = pro.speed;
                }
            }

            uint             frm_iid = 0;
            LGAvatarGameInst frm_lc  = null;

            if (msgData.ContainsKey("hpchange"))
            {
                Variant hpchanged = msgData["hpchange"];
                int     hpchange  = hpchanged["hpchange"];
                int     curhp     = hpchanged["hp_left"];
                Variant d         = new Variant();
                if (isUser)
                {
                    PlayerModel.getInstance().modHp(curhp);
                }
                if (hpchange > 0)
                {
                    role.modHp(curhp);
                    if (isUser)
                    {
                        FightText.play(FightText.HEAL_TEXT, role.getHeadPos(), hpchange);
                    }
                    if (healEff == null)
                    {
                        healEff = GAMEAPI.ABFight_LoadPrefab("FX_comFX_fuwenFX_FX_fuwen_chuyong");
                    }
                    if (healEff != null && role is ProfessionRole)
                    {
                        GameObject fx_inst = GameObject.Instantiate(healEff) as GameObject;
                        GameObject.Destroy(fx_inst, 1f);
                        fx_inst.transform.SetParent(role.m_curModel, false);
                    }
                    if (msgData.ContainsKey("rune_ids"))
                    {
                        List <Variant> l = msgData["rune_ids"]._arr;
                        foreach (Variant rune_id in l)
                        {
                            FightText.play(FightText.ADD_IMG_TEXT, role.getHeadPos(), hpchange, false, rune_id);
                        }
                    }
                }
                else if (hpchange < 0)
                {
                    frm_iid = hpchanged["frm_iid"];
                    BaseRole frm = RoleMgr._instance.getRole(frm_iid);

                    if (msgData.ContainsKey("rune_ids"))
                    {
                        Variant rune = msgData["rune_ids"];
                        if (rune.Count > 0)
                        {
                            int            id_rune = rune[0];
                            List <Variant> l       = msgData["rune_ids"]._arr;
                            foreach (Variant rune_id in l)
                            {
                                role.onServerHurt(-hpchange, curhp, hpchanged["die"], frm, id_rune);
                            }
                        }
                    }
                }
            }

            if (msgData.ContainsKey("mpchange"))
            {
                Variant mpchanged = msgData["mpchange"];
                int     mpchange  = mpchanged["mpchange"];
                int     curmp     = mpchanged["mp_left"];
                if (isUser)
                {
                    PlayerModel.getInstance().modMp(curmp);
                }
            }
            if (msgData.ContainsKey("pk_state"))
            {
                int pkstate = msgData["pk_state"];
                switch (pkstate)
                {
                case 0:
                    role.m_ePK_Type = PK_TYPE.PK_PEACE;
                    break;

                case 1:
                    role.m_ePK_Type = PK_TYPE.PK_PKALL;
                    break;

                case 2:
                    role.m_ePK_Type = PK_TYPE.PK_TEAM;
                    break;

                case 3:
                    role.m_ePK_Type = PK_TYPE.PK_LEGION;
                    break;

                case 4:
                    role.m_ePK_Type = PK_TYPE.PK_HERO;
                    break;

                case 5:
                    role.m_ePK_Type = PK_TYPE.Pk_SPOET;
                    break;
                }
                ;
            }
            if (msgData.ContainsKey("clanid"))
            {
                role.m_unLegionID = msgData["clanid"];
            }
            if (msgData.ContainsKey("teamid"))
            {
                role.m_unTeamID = msgData["teamid"];

                if (isUser)
                {
                    PlayerModel.getInstance().teamid = role.m_unTeamID;

                    PlayerNameUIMgr.getInstance().refeshHpColor();
                }
                else
                {
                    PlayerNameUIMgr.getInstance().refeshHpColor(role);
                }
            }

            if (msgData.ContainsKey("rune_ids"))
            {
                List <Variant> l = msgData["rune_ids"]._arr;
                foreach (Variant rune_id in l)
                {
                    GameObject eff = EffMgr.getRuneEff(rune_id._int);
                    if (eff != null)
                    {
                        GameObject fx_inst = GameObject.Instantiate(eff) as GameObject;
                        GameObject.Destroy(fx_inst, 2f);
                        fx_inst.transform.SetParent(role.m_curModel, false);
                    }
                }
                //if (!msgData.ContainsKey("hpchange"))
                //{
                //    foreach (Variant rune_id in l)
                //    {
                //        FightText.play(FightText.IMG_TEXT, role.getHeadPos(), 0, false, rune_id);
                //    }
                //}
            }

            if (msgData.ContainsKey("sprite_flag"))
            {
                uint call = msgData["sprite_flag"];
                uint iid  = msgData["iid"];
                var  vv   = MonsterMgr._inst.getMonster(iid);
                if (vv != null)
                {
                    SkinnedMeshRenderer render = vv.m_curModel.FindChild("body").GetComponent <SkinnedMeshRenderer>();
                    switch (call)
                    {
                    case 0:
                        foreach (var v in render.sharedMaterials)
                        {
                            v.shader = Shader.Find("A3/A3_Char_Streamer_H");
                            v.SetColor("_RimColor", new Color(0, 0, 0, 0));
                            v.SetFloat("_RimWidth", 0f);
                        }
                        break;

                    case 1:
                        render.sharedMaterial = U3DAPI.U3DResLoad <Material>("default/monster_1021_heite_gold");
                        break;
                    }
                }
            }

            if (isUser == false)
            {
                if (msgData.ContainsKey("dress"))
                {
                    var _role = role as ProfessionRole;

                    _role.rideId = msgData.getValue("dress")._int;

                    if (msgData.getValue("mount")._uint == (uint)RIDESTATE.UP && _role != null)
                    {
                        _role.ridestate = RIDESTATE.UP;

                        if (_role.invisible == false && _role.dianjiTime == -1 && _role.isUp == false)
                        {
                            _role.ChangeRideState(true);
                        }

                        //_role.set_Ride( msgData.getValue( "dress" )._int);
                    }

                    else if (msgData.getValue("mount")._uint == ( uint )RIDESTATE.Down && _role != null)
                    {
                        _role.ridestate = RIDESTATE.Down;

                        _role.Remove_Ride();
                    }
                }
            } //其他玩家坐骑切换

            //if (msgData.ContainsKey("speed"))
            //    role.modSpeed(msgData["speed"]._int);

            //if (msgData.ContainsKey("maxhp"))
            //{
            //    int maxhp = msgData["maxhp"];
            //    role.modMaxHp(maxhp);
            //    if (isUser)
            //    {
            //        PlayerModel.getInstance().max_hp = maxhp;
            //    }
            //}

            //if (msgData.ContainsKey("maxdp"))
            //    role.modMaxDp(msgData["maxdp"]._int);

            //if (msgData.ContainsKey("in_pczone"))
            //{
            //    if (role.isMainPlayer())
            //    {
            //        if (msgData["in_pczone"]._bool)
            //        {
            //           // lgGeneral.PKStateChange(0);需要切换pk模式 lucisa
            //        }
            //        lguiMain.PczoneChange(msgData["in_pczone"]._bool);
            //    }
            //    this.in_pczone = msgData["in_pczone"]._bool;

            //}
            //if (msgData.ContainsKey("follow"))
            //{
            //    this.follow = msgData["follow"]._bool;
            //}
            //if (msgData.ContainsKey("ghost"))
            //{
            //    this.ghost = msgData["ghost"]._bool;
            //}
            //if (msgData.ContainsKey("ride_mon_id"))
            //{
            //    this.ride_mon = msgData["ride_mon_id"];//坐骑 lucisa
            //}
        }
Beispiel #28
0
    private void Model_LoadedOK(UnityEngine.Object model_obj, System.Object data)
    {
        if (!MonsterMgr._inst.m_mapMonster.ContainsKey(m_unIID) && !MonsterMgr._inst.m_mapFakeMonster.ContainsKey(m_unIID))
        {
            return;
        }

        m_bWaitingModel = false;

        GameObject obj_prefab = model_obj as GameObject;

        if (obj_prefab == U3DAPI.DEF_GAMEOBJ || obj_prefab == null)
        {
            Debug.LogError("not find model = " + m_strModelPath);
            obj_prefab = U3DAPI.U3DResLoad <GameObject>("def_role");
        }

        m_curGameObj = GameObject.Instantiate(obj_prefab) as GameObject;

        foreach (Transform tran in m_curGameObj.GetComponentsInChildren <Transform>())
        {
            //debug.Log("改变了layer " + tran.name);
            tran.gameObject.layer = m_layer;// 更改物体的Layer层
        }

        m_curModel = m_curGameObj.transform.FindChild("model");
        m_curPhy   = m_curModel.transform.FindChild("physics");
        try
        {
            m_curPhy.gameObject.layer = EnumLayer.LM_BT_FIGHT;
        }
        catch (System.Exception ex)
        {
        }

        m_curAni = m_curModel.GetComponent <Animator>();

        CapsuleCollider CapsuleCollider = m_curPhy.GetComponent <CapsuleCollider>();

        headOffset      = CapsuleCollider.center;
        headOffset.y   += CapsuleCollider.height / 2;
        headOffset_half = CapsuleCollider.center;

        //4足位置(人左右手+左右脚  牛 4四只脚)
        m_LeftHand  = m_curModel.FindChild("L_Finger1");
        m_RightHand = m_curModel.FindChild("R_Finger1");
        m_LeftFoot  = m_curModel.FindChild("L_Toe0");
        m_RightFoot = m_curModel.FindChild("R_Toe0");

        if (m_LeftHand == null)
        {
            m_LeftHand = U3DAPI.DEF_TRANSFORM;
        }
        if (m_RightHand == null)
        {
            m_RightHand = U3DAPI.DEF_TRANSFORM;
        }
        if (m_LeftFoot == null)
        {
            m_LeftFoot = U3DAPI.DEF_TRANSFORM;
        }
        if (m_RightFoot == null)
        {
            m_RightFoot = U3DAPI.DEF_TRANSFORM;
        }

        //refreshViewType(viewType);
        //如断头 断尾要加效果的话要特殊处理

        //SelfHitPoint shp = m_curModel.gameObject.AddComponent<SelfHitPoint>();
        //shp.m_selfRole = this;

        //m_curPhy = m_curModel.FindChild("physics");
        //HurtPoint htt = m_curPhy.gameObject.AddComponent<HurtPoint>();
        //htt.m_selfRole = this;

        //PetBirdMgr.Inst.AttachPetBird(m_curModel);

        if (m_layer != EnumLayer.LM_SELFROLE && !(this is CollectRole) && TEMP_SHADOW != null)
        {
            GameObject shadowgo = GameObject.Instantiate(TEMP_SHADOW) as GameObject;
            shadowgo.transform.SetParent(m_curModel.transform, false);
            //当模型是有旋转时,调整影子的旋转反向
            Quaternion q = m_curModel.transform.localRotation;
            shadowgo.transform.localRotation = Quaternion.Inverse(q);
        }



        m_unLegionID = (uint)LOGION_DEF.LNDF_MONSTER;
        //军团ID=怪物(uint=2)
        m_curGameObj.SetActive(true);

        MonHurtPoint mhtt = m_curPhy.gameObject.AddComponent <MonHurtPoint>();

        mhtt.m_monRole = this;

        setNavLay(NavmeshUtils.allARE);

        //  m_curAgent.enabled = false;

        if (this is MonsterPlayer)
        {
            PlayerNameUIMgr.getInstance().show(this);
        }

        Transform mon_body = m_curModel.FindChild("body");

        if (mon_body != null)
        {
            m_MonBody = mon_body.GetComponent <SkinnedMeshRenderer>();
            if (m_MonBody.material.HasProperty(EnumShader.SPI_COLOR))
            {
                m_Main_Color = m_MonBody.material.GetColor(EnumShader.SPI_COLOR);
            }
            if (m_MonBody.material.HasProperty(EnumShader.SPI_RIMCOLOR))
            {
                m_Rim_Color = m_MonBody.material.GetColor(EnumShader.SPI_RIMCOLOR);
            }
            if (m_MonBody.material.HasProperty(EnumShader.SPI_RIMWIDTH))
            {
                m_Rim_Width = m_MonBody.material.GetFloat(EnumShader.SPI_RIMWIDTH);
            }

            m_mat = m_MonBody.material;
        }

        if (m_MonBody == null)
        {
            m_MonBody = U3DAPI.DEF_SKINNEDMESHRENDERER;
        }
        Transform mon_body1 = m_curModel.FindChild("body1");

        if (mon_body1 != null)
        {
            m_MonBody1 = mon_body1.GetComponent <SkinnedMeshRenderer>();
        }

        //m_fNavStoppingDis = 0.125f;
        if (tempXMl != null && tempXMl.getInt("born_eff") > 0)
        {
            //出生时材质变化
            onBornStart(tempXMl.getInt("born_eff"));
        }
        height = m_curModel.FindChild("physics").GetComponent <CapsuleCollider>().height;
        radius = m_curModel.FindChild("physics").GetComponent <CapsuleCollider>().radius;

        refreshViewType(999);

        //协议过来的一些初始化内容
        m_curGameObj.SetActive(invisible & m_curGameObj.activeSelf);
        if (to_moving)
        {
            NavMeshHit hit;
            Vector3    vec = new Vector3(to_x * 32 / GameConstant.PIXEL_TRANS_UNITYPOS, 0f, to_y * 32 / GameConstant.PIXEL_TRANS_UNITYPOS);
            NavMesh.SamplePosition(vec, out hit, 100f, m_layer);
            SetDestPos(hit.position);
        }

        Model_Loaded_Over();
    }
        public void init(Transform trans)
        {
            _instance = this;
            inText();
            itemMemberObjList = new List <ItemMemberObj>();
            txtTeambuff       = trans.FindChild("right/bottom/teambuff").GetComponent <Text>();
            Transform objects = trans.FindChild("right/main/body/contains");

            team_object        = transform.FindChild("right/bottom/team_object/Dropdown").gameObject;
            team_object_change = team_object.GetComponent <Dropdown>();
            team_object_change.onValueChanged.AddListener(team_object_dropdownClick);


            team_object_change.captionText.text = ContMgr.getCont("a3_teamPanel_16");
            for (int i = 0; i < team_object_change.options.Count; i++)
            {
                team_object_change.options[i].text = ContMgr.getCont("a3_teamPanel_" + (i + 16));
            }

            for (int i = 0; i < objects.childCount; i++)
            {
                Transform     child         = objects.GetChild(i);
                ItemMemberObj itemMemberObj = new ItemMemberObj(child);
                itemMemberObjList.Add(itemMemberObj);
            }
            togInvite = trans.FindChild("right/bottom/togInvite").GetComponent <Toggle>();
            /*暂时先屏蔽掉*/ //togJoin = trans.FindChild("right/bottom/togJoin").GetComponent<Toggle>();
            togInvite.onValueChanged.AddListener(onTogAgreenAddOtherClick);
            //togJoin.onValueChanged.AddListener(onTogAgreeOtherApplyClick);
            materialGrey  = U3DAPI.U3DResLoad <Material>("uifx/uiGray");
            carrSpriteDic = new Dictionary <uint, Sprite>();

            for (int i = 0; i < 3; i++)
            {
                if (i == 0)
                {
                    carrSpriteDic.Add(2, GAMEAPI.ABUI_LoadSprite("icon_team_warrior_team"));
                }
                if (i == 1)
                {
                    carrSpriteDic.Add(3, GAMEAPI.ABUI_LoadSprite("icon_team_mage_team"));
                }
                if (i == 2)
                {
                    carrSpriteDic.Add(5, GAMEAPI.ABUI_LoadSprite("icon_team_assassin_team"));
                }
            }
            BaseButton btnQuitTeam = new BaseButton(trans.FindChild("right/bottom/btnQuitTeam"));

            btnQuitTeam.onClick = onBtnQuitTeamClick;
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, onCreateTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, onAffirminvite);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, onNewMemberJoin);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, onChangeTeamInfo);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, onLeaveTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, onNoticeOnlineStateChange);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGECAPTAIN, onChangeCaptain);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_TEAMOBJECT_CHANGE, onChangeTeamObject);
            if (TeamProxy.getInstance().MyTeamData != null)
            {
                team_object_change.value = change_v((int)TeamProxy.getInstance().MyTeamData.ltpid, false);
            }

            new BaseButton(transform.Find("right/main/body/btn_call")).onClick = OnClickMsg;
        }
Beispiel #30
0
 public NewbieModel()
 {
     transCon = GameObject.Find("newbieLayer").transform;
     goBg     = GameObject.Instantiate(U3DAPI.U3DResLoad <GameObject>("newbiebg")) as GameObject;
 }