| | |
| | | using TableConfig; |
| | | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | |
| | |
| | | { |
| | | public void BuildModelRes(int id, bool isHighMesh = false) |
| | | { |
| | | ModelResConfig _modelRes = Config.Instance.Get<ModelResConfig>(id); |
| | | ModelResConfig _modelRes = ModelResConfig.Get(id); |
| | | if (_modelRes == null) |
| | | { |
| | | Debug.LogWarningFormat("要生成的ModelRes资源id: {0} 并不存在于配置表中, 请确认是否填写有错.", id); |
| | |
| | | return; |
| | | } |
| | | |
| | | ModelResConfig _modelRes = Config.Instance.Get<ModelResConfig>(id); |
| | | ModelResConfig _modelRes = ModelResConfig.Get(id); |
| | | string _path = _modelRes.ResourcesName; |
| | | string _resName = _modelRes.ResourcesName; |
| | | if (_path.IndexOf('/') != -1) |
| | |
| | | _path = _path.Substring(0, _modelRes.ResourcesName.IndexOf('/')); |
| | | } |
| | | |
| | | HandleMaterial(_path, _resName, _modelRes.Material_Fight_Normal); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_UI_Normal); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_Fight_Suit); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_UI_Suit); |
| | | if (suffix.Equals(InstanceResourcesLoader.raceSuffix)) |
| | | { |
| | | HandleMaterial(_path, _resName, _modelRes.Material_Fight_Normal); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_UI_Normal); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_Fight_Suit); |
| | | HandleMaterial(_path, _resName, _modelRes.Material_UI_Suit); |
| | | } |
| | | |
| | | BuildPrefab(_path, _resName, suffix, null, isHighMesh); |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | ModelResConfig _modelRes = Config.Instance.Get<ModelResConfig>(id); |
| | | ModelResConfig _modelRes = ModelResConfig.Get(id); |
| | | string _path = _modelRes.ResourcesName; |
| | | if (_path.IndexOf('/') != -1) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | ModelResConfig _modelRes = Config.Instance.Get<ModelResConfig>(id); |
| | | ModelResConfig _modelRes = ModelResConfig.Get(id); |
| | | string _path = _modelRes.ResourcesName; |
| | | if (_path.IndexOf('/') != -1) |
| | | { |
| | |
| | | |
| | | protected override void OnSetupRenderer(string path, string resName, ref Renderer renderer) |
| | | {//Assets/ART/Role/A_Zs_Sb/Materials/A_Zs05_Sb.mat |
| | | string _originalPath = path; |
| | | |
| | | if (path.EndsWith("_Sb")) |
| | | { |
| | | path = path.Replace("_Sb", ""); |
| | |
| | | |
| | | // 设置为不接受阴影 |
| | | renderer.receiveShadows = false; |
| | | if (resName.Contains("A_Zs") || resName.Contains("A_Fs")) |
| | | if (_originalPath.Equals("A_Zs") || _originalPath.Equals("A_Fs")) |
| | | { |
| | | renderer.material = renderer.sharedMaterial = null; |
| | | renderer.materials = renderer.sharedMaterials = new Material[0]; |