예제 #1
0
            // 创建对应的角色
            public void CreateActor(int index)
            {
                if (index >= 0 && index < mData.Count)
                {
                    //if (AuditManager.Instance.AuditAndIOS() && SDKHelper.GetRoleList() != null)
                    //{
                    //    List<uint> npc_id = SDKHelper.GetRoleList();
                    //    int rid = (int)mData[index].rid - 1;
                    //    UnitID actor_uid = ClientModel.CreateClientModelByActorIdForLua(ActorHelper.RoleIdToCreateTypeId(npc_id[rid]), OnResLoaded);
                    //    var client_model = ActorManager.Instance.GetActor(actor_uid) as ClientModel;
                    //    client_model.AttackSpeed = 1.0f;
                    //    mActorGameObjects.Add(client_model);
                    //    return;
                    //}



                    uint type_idx = ActorHelper.RoleIdToTypeId(mData [index].rid);

                    List <uint> model_list   = new List <uint>();
                    List <uint> fashion_list = new List <uint>();
                    ActorHelper.GetModelFashionList(mData[index].shows, model_list, fashion_list);

                    if (AuditManager.Instance.AuditAndIOS() && SDKHelper.GetSwitchModel() && SDKHelper.GetFashion() != 0)
                    {
                        fashion_list.Add(SDKHelper.GetFashion());
                    }

                    var         model_id_list = ActorManager.ReplaceModelList(model_list, (Actor.EVocationType)mData [index].rid, true);
                    ClientModel actor         = ClientModel.CreateClientModel(type_idx, mData[index].uuid, model_id_list, fashion_list, mData[index].effects, OnResLoaded, false, true);
                    // 攻速必须为1,不然出场特效与动作匹配不上
                    actor.AttackSpeed = 1.0f;
                    mActorGameObjects.Add(actor);
                    actor.Freeze(DBActor.UF_ANIMATION);
                }
            }