Ejemplo n.º 1
0
        private void CreateModel(int id)
        {
            DestroyModel();
            var tbEquip = Table.GetEquipBase(id);

            if (tbEquip == null)
            {
                return;
            }
            var tbMont = Table.GetWeaponMount(tbEquip.EquipModel);

            if (tbMont == null)
            {
                return;
            }
            WingModel.CreateModel(tbMont.Path, tbEquip.AnimPath + "/FlyIdle.anim", model =>
            {
                ModelDrag.Target = model.transform;
                WingModel.PlayAnimation();
                model.gameObject.SetLayerRecursive(LayerMask.NameToLayer(GAMELAYER.UI));
                model.gameObject.SetRenderQueue(RenderQueue);
                //if (Wing2Scale.ContainsKey(id))
                //{
                //    var scale = Wing2Scale[id];
                //    model.gameObject.transform.localScale = scale;
                //}
//                model.gameObject.transform.localScale = new Vector3(2f,2f,2f);
            });

            //grid.SetLookIndex(tbEquip.Ladder - 1 < 0 ? 0 : tbEquip.Ladder - 1);
        }
Ejemplo n.º 2
0
        private void CreateModel(int id)
        {
            DestroyModel();
            var tbEquip = Table.GetEquipBase(id);

            if (tbEquip == null)
            {
                return;
            }
            var tbMont = Table.GetWeaponMount(tbEquip.EquipModel);

            if (tbMont == null)
            {
                return;
            }
            WingModel.CreateModel(tbMont.Path, tbEquip.AnimPath + "/FlyIdle.anim", model =>
            {
                ModelDrag.Target = model.transform;
                WingModel.PlayAnimation();
                model.gameObject.SetLayerRecursive(LayerMask.NameToLayer(GAMELAYER.UI));
                model.gameObject.SetRenderQueue(RenderQueue);
            });
        }
Ejemplo n.º 3
0
        private void CreateWingModel(int equipId)
        {
            var tbEquip = Table.GetEquipBase(equipId);

            if (tbEquip == null)
            {
                return;
            }
            var tbMont = Table.GetWeaponMount(tbEquip.EquipModel);

            if (tbMont == null)
            {
                return;
            }

            Model.CreateModel(tbMont.Path, tbEquip.AnimPath + "/FlyIdle.anim", theModel =>
            {
                if (theModel != null)
                {
                    theModel.transform.parent = Model.transform;
                    Vector3 v = Vector3.zero;
                    foreach (var ep in ListEquipOffset)
                    {
                        if (ep.EquipId == equipId)
                        {
                            v = ep.OriginPosition;
                            break;
                        }
                    }
                    theModel.transform.localPosition = v;
                    theModel.gameObject.SetLayerRecursive(LayerMask.NameToLayer(GAMELAYER.UI));
                    theModel.gameObject.SetRenderQueue(ModelRenderQueue);

                    Model.PlayAnimation();
                }
            });
        }
Ejemplo n.º 4
0
        private void CreateMountModel(int mountId)
        {
            var tbMount = Table.GetMount(mountId);

            if (tbMount == null)
            {
                return;
            }

            if (AnimModelRoot)
            {
                AnimModelRoot.DestroyModel();
            }
            var tbEquip = Table.GetEquipBase(tbMount.ItemId);

            if (tbEquip == null)
            {
                return;
            }
            var tbMont = Table.GetWeaponMount(tbEquip.EquipModel);

            if (tbMont == null)
            {
                return;
            }
            StartCoroutine(CreateModelCoroutine(() =>
            {
                AnimModelRoot.DestroyModel();
                AnimModelRoot.CreateModel(tbMont.Path, tbEquip.AnimPath + "/Stand.anim", model =>
                {
                    ModelDrag.Target = model.transform;
                    AnimModelRoot.PlayAnimation();
                    model.gameObject.SetLayerRecursive(LayerMask.NameToLayer(GAMELAYER.UI));
                    model.gameObject.SetRenderQueue(3004);
                    var particle = model.gameObject.GetComponent <ParticleScaler>();
                    if (particle != null)
                    {
                        particle.Update();
                    }

                    ModelDrag.Target.gameObject.SetActiveRecursive(true);
                }, false);
            }));
        }
Ejemplo n.º 5
0
        private void CreateFakeObj(IEvent ievent)
        {
            int dataId = (ievent as MountRefreshModel_Event).MountId;

            if (ModelRoot)
            {
                ModelRoot.DestroyModel();
            }
            var tbEquip = Table.GetEquipBase(dataId);

            if (tbEquip == null)
            {
                return;
            }
            var tbMont = Table.GetWeaponMount(tbEquip.EquipModel);

            if (tbMont == null)
            {
                return;
            }
            StartCoroutine(CreateModelCoroutine(() =>
            {
                ModelRoot.DestroyModel();
                ModelRoot.CreateModel(tbMont.Path, tbEquip.AnimPath + "/Stand.anim", model =>
                {
                    ModelDrag.Target = model.transform;
                    ModelRoot.PlayAnimation();
                    model.gameObject.SetLayerRecursive(LayerMask.NameToLayer(GAMELAYER.UI));
                    model.gameObject.SetRenderQueue(RenderQueue);
                    var particle = model.gameObject.GetComponent <ParticleScaler>();
                    if (particle != null)
                    {
                        particle.Update();
                    }

                    ModelDrag.Target.gameObject.SetActiveRecursive(true);
                }, false);
            }));
        }