| | |
| | | public GameObject AttackBody; |
| | | |
| | | /// <summary> |
| | | /// 可以放置的材质 |
| | | /// </summary> |
| | | public MeshRenderer canPlaceMesh; |
| | | |
| | | /// <summary> |
| | | /// 精灵塔动作状态 |
| | | /// </summary> |
| | | public TowerActionState ActionState { get; protected set; } |
| | |
| | | mat = transform.Find("Cube"); |
| | | myRender = mat.GetComponent<MeshRenderer>(); |
| | | normalScale = new Vector3(1.5f, 1.5f, 1.5f); |
| | | canPlaceMesh.enabled = false; |
| | | } |
| | | |
| | | private void Start() |
| | |
| | | ChangeState(TowerActionState.Standing); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置可以放置 |
| | | /// </summary> |
| | | /// <param name="isOn"></param> |
| | | public void SetCanPlace(bool isOn) |
| | | { |
| | | if (canPlaceMesh.enabled != isOn) |
| | | canPlaceMesh.enabled = isOn; |
| | | } |
| | | |
| | | public void ChangeState(TowerActionState state) |
| | | { |
| | | if (ActionAnimator == null || !ActionAnimator.isActiveAndEnabled) return; |