| | |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0, y: 0} |
| | | - _MainTex: |
| | | m_Texture: {fileID: 2800000, guid: 93f40a01d57fbff418fc0b54b6ab7d9f, type: 3} |
| | | m_Texture: {fileID: 2800000, guid: 8c9a3d26120e78f40aa4ef9ed23d573c, type: 3} |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0, y: 0} |
| | | - _MetallicGlossMap: |
| | |
| | | canPlaceRenderer: {fileID: 5722111975221064870} |
| | | canPlaceMat: {fileID: 2100000, guid: 434316934db1c90498f004f124d7c733, type: 2} |
| | | selectMat: {fileID: 2100000, guid: 3b7aa7626a2d4674ca2aa32958f14ca9, type: 2} |
| | | myPS: {fileID: 7663500723916369405} |
| | | towerVSRenderer: {fileID: 2078962303223178405} |
| | | towerVSMat: {fileID: 2100000, guid: c40b753d26a2b4a4facef99e60c526d2, type: 2} |
| | | fire: {fileID: 2800000, guid: 8c9a3d26120e78f40aa4ef9ed23d573c, type: 3} |
| | |
| | | propertyPath: m_Name |
| | | value: Effect_UI_BaoShiShengJi_TiShi |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 3190397260455246885, guid: 4fcc58d4d215bdf43807fe35b9e8f9ad, |
| | | type: 3} |
| | | propertyPath: m_IsActive |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 3190397261047448469, guid: 4fcc58d4d215bdf43807fe35b9e8f9ad, |
| | | type: 3} |
| | | propertyPath: playOnAwake |
| | |
| | | --- !u!4 &7663500724507464268 stripped |
| | | Transform: |
| | | m_CorrespondingSourceObject: {fileID: 3190397260455246884, guid: 4fcc58d4d215bdf43807fe35b9e8f9ad, |
| | | type: 3} |
| | | m_PrefabInstance: {fileID: 5052097780309765736} |
| | | m_PrefabAsset: {fileID: 0} |
| | | --- !u!198 &7663500723916369405 stripped |
| | | ParticleSystem: |
| | | m_CorrespondingSourceObject: {fileID: 3190397261047448469, guid: 4fcc58d4d215bdf43807fe35b9e8f9ad, |
| | | type: 3} |
| | | m_PrefabInstance: {fileID: 5052097780309765736} |
| | | m_PrefabAsset: {fileID: 0} |
| | |
| | | /// <param name="allTowerP"></param> |
| | | public void PlayPS(List<IntVector2> allTowerP) |
| | | { |
| | | for (int i = 0; i < allTowerP.Count; i++) |
| | | { |
| | | m_Tiles[allTowerP[i].x, allTowerP[i].y].SetParticleSystem(true); |
| | | } |
| | | // for (int i = 0; i < allTowerP.Count; i++) |
| | | // { |
| | | // m_Tiles[allTowerP[i].x, allTowerP[i].y].SetParticleSystem(true); |
| | | // } |
| | | } |
| | | /// <summary> |
| | | /// /// 停止所有升级动画 |
| | | /// </summary> |
| | | public void StopPS() |
| | | { |
| | | int iy = dimensions.y - 1;//3 |
| | | for (int ix = 0; ix < dimensions.x; ix++) |
| | | { |
| | | for (int y = iy; y >= dimensions.y - AttackRowNumbers; --y) |
| | | { |
| | | if (m_arrGridType[ix, y] == PlacementGridType.EGridOpen) |
| | | { |
| | | m_Tiles[ix, y].SetParticleSystem(false); |
| | | } |
| | | } |
| | | } |
| | | // int iy = dimensions.y - 1;//3 |
| | | // for (int ix = 0; ix < dimensions.x; ix++) |
| | | // { |
| | | // for (int y = iy; y >= dimensions.y - AttackRowNumbers; --y) |
| | | // { |
| | | // if (m_arrGridType[ix, y] == PlacementGridType.EGridOpen) |
| | | // { |
| | | // m_Tiles[ix, y].SetParticleSystem(false); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | } |
| | | StopPS(); |
| | | //StopPS(); |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | if (m_CurrentArea != null) |
| | | { |
| | | (m_CurrentArea as TowerPlacementGridEndless).CheckAllCanPlace(allTowerP); |
| | | (m_CurrentArea as TowerPlacementGridEndless).PlayPS(allPSTowerP); |
| | | //(m_CurrentArea as TowerPlacementGridEndless).PlayPS(allPSTowerP); |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public Material selectMat; |
| | | |
| | | public ParticleSystem myPS;//可以升级的特效 |
| | | //public ParticleSystem myPS;//可以升级的特效 |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | |
| | | public void SetParticleSystem(bool isOn) |
| | | { |
| | | if (isOn) |
| | | { |
| | | if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); |
| | | myPS.Play(); |
| | | // public void SetParticleSystem(bool isOn) |
| | | // { |
| | | // if (isOn) |
| | | // { |
| | | // if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); |
| | | // myPS.Play(); |
| | | |
| | | } |
| | | else |
| | | { |
| | | myPS.Stop(); |
| | | if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); |
| | | // } |
| | | // else |
| | | // { |
| | | // myPS.Stop(); |
| | | // if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); |
| | | |
| | | } |
| | | } |
| | | // } |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 设置是否可以放置 |
| | |
| | | private void Start() |
| | | { |
| | | sceneCamera = GameObject.Find("SceneCamera3D").GetComponent<Camera>(); |
| | | |
| | | Invoke("LookAtCamera",0.2f); |
| | | } |
| | | |
| | | private Vector3 offect = new Vector3(0, 0.07f, 0.04f); |
| | | |
| | | private void LookAtCamera() |
| | | { |
| | | transform.LookAt(transform.position + sceneCamera.transform.rotation * Vector3.forward, |
| | | sceneCamera.transform.rotation * Vector3.up); |
| | | |
| | | transform.localPosition = offect; |
| | | } |
| | | |
| | | // Update is called once per frame |
| | |
| | | void LateUpdate() |
| | | { |
| | | // transform.LookAt(sceneCamera.transform); |
| | | transform.LookAt(transform.position + sceneCamera.transform.rotation * Vector3.forward, |
| | | sceneCamera.transform.rotation * Vector3.up); |
| | | |
| | | } |
| | | } |
| | | } |