| | |
| | | private Transform mat; |
| | | Vector3 normalScale; |
| | | |
| | | private Vector3 fireScale = new Vector3(1.6f, 1.6f, 1.84f); |
| | | private Vector3 woodScale = new Vector3(1.0f, 1.0f, 1.88f); |
| | | private Vector3 fireScale = new Vector3(1.92f, 1.92f, 2.208f); |
| | | private Vector3 woodScale = new Vector3(1.5f, 1.5f, 2.82f); |
| | | private Vector3 waterScale = new Vector3(1.0f, 1.0f, 1.88f); |
| | | |
| | | private Vector3 fireOffectp = new Vector3(0f, 0f, -0.15f); |
| | | |
| | | private Vector3 woodOffectp = new Vector3(0.08f, 0f, 0.2f); |
| | | |
| | | private void Awake() |
| | | { |
| | |
| | | public void NormalScale() |
| | | { |
| | | mat.localScale = normalScale; |
| | | mat.localPosition = Vector3.zero; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | //火元素 |
| | | mat.localScale = fireScale; |
| | | mat.localPosition = fireOffectp; |
| | | } |
| | | else if (transform.name.StartsWith("BlinkTower")) |
| | | { |
| | | //木元素 |
| | | mat.localScale = woodScale; |
| | | mat.localPosition = woodOffectp; |
| | | |
| | | } |
| | | else if (transform.name.StartsWith("CopyCatTower")) |
| | | { |
| | |
| | | /// 当前的TowerLevel设置为对应怪物的材质显示 |
| | | /// </summary> |
| | | /// <param name="mat"></param> |
| | | public void SetTowerMonsterMat(Material mat) |
| | | public void SetTowerMonsterMat(Material material) |
| | | { |
| | | if (mat == null) return; |
| | | // 查找子结点: |
| | | foreach (Transform t in transform.GetComponentsInChildren<Transform>()) |
| | | { |
| | | if (t.name == "Cube") |
| | | { |
| | | t.GetComponent<MeshRenderer>().material = mat; |
| | | //Vector3 scale = t.localScale; |
| | | if (material == null) return; |
| | | |
| | | // if (!this.bScaleForCombat) |
| | | mat.GetComponent<MeshRenderer>().material = material; |
| | | |
| | | ResetScale(); |
| | | // if (transform.name.StartsWith("GrowUpTower") && mat.localPosition != fireOffectp) |
| | | // { |
| | | // scale.z *= 1.267f; |
| | | // t.localScale = scale; |
| | | // Vector3 pos = t.localPosition; |
| | | // pos.z -= 0.2f; |
| | | // t.localPosition = pos; |
| | | // bScaleForCombat = true; |
| | | // mat.localPosition = fireOffectp; |
| | | // } |
| | | } |
| | | } |
| | | // else if (transform.name.StartsWith("BlinkTower") && mat.localPosition != woodOffectp) |
| | | // { |
| | | // //木元素 |
| | | // mat.localPosition = woodOffectp; |
| | | // } |
| | | // // 查找子结点: |
| | | // foreach (Transform t in transform.GetComponentsInChildren<Transform>()) |
| | | // { |
| | | // if (t.name == "Cube") |
| | | // { |
| | | // t.GetComponent<MeshRenderer>().material = mat; |
| | | // //Vector3 scale = t.localScale; |
| | | |
| | | // // if (!this.bScaleForCombat) |
| | | // // { |
| | | // // scale.z *= 1.267f; |
| | | // // t.localScale = scale; |
| | | // // Vector3 pos = t.localPosition; |
| | | // // pos.z -= 0.2f; |
| | | // // t.localPosition = pos; |
| | | // // bScaleForCombat = true; |
| | | // // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /// <summary> |