| | |
| | | using System.Collections.Generic; |
| | | using ActionGameFramework.Health; |
| | | using Core.Health; |
| | | using KTGMGemClient; |
| | | using TowerDefense.Affectors; |
| | |
| | | public TowerPlacementGhost towerGhostPrefab; |
| | | |
| | | /// <summary> |
| | | /// Build effect gameObject to instantiate on start |
| | | /// </summary> |
| | | //public GameObject buildEffectPrefab; |
| | | |
| | | /// <summary> |
| | | /// 升级特效 |
| | | /// </summary> |
| | | public GameObject UpgradeEffectPrefab; |
| | | |
| | | /// <summary> |
| | | /// 当前的Level对应的DamagerData. |
| | | /// </summary> |
| | | public Damager levelDamager; |
| | | |
| | | /// <summary> |
| | | /// Reference to scriptable object with level data on it |
| | | /// </summary> |
| | | public TowerLevelData levelData; |
| | | |
| | | /// <summary> |
| | | /// The parent tower controller of this tower |
| | |
| | | public LayerMask mask { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the cost value |
| | | /// </summary> |
| | | public int cost |
| | | { |
| | | get { return levelData.cost; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the sell value |
| | | /// </summary> |
| | | public int sell |
| | | { |
| | | get { return levelData.sell; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the max health |
| | | /// </summary> |
| | | public int maxHealth |
| | | { |
| | | get { return levelData.maxHealth; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the starting health |
| | | /// </summary> |
| | | public int startingHealth |
| | | { |
| | | get { return levelData.startingHealth; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the tower description |
| | | /// </summary> |
| | | public string description |
| | | { |
| | | get { return levelData.description; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the tower description |
| | | /// </summary> |
| | | public string upgradeDescription |
| | | { |
| | | get { return levelData.upgradeDescription; } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initialises the Effects attached to this object |
| | | /// </summary> |
| | | public virtual void Initialize(Tower tower, LayerMask enemyMask, IAlignmentProvider alignment) |
| | |
| | | effect.Initialize(alignment, mask); |
| | | effect.towerPtr = tower; |
| | | AttackAffector attackAffector = effect.GetComponent<AttackAffector>(); |
| | | |
| | | // if (attackAffector.projectile != null) |
| | | // { |
| | | // Damager damager = attackAffector.projectile.gameObject.GetComponent<Damager>(); |
| | | // damager.TowerAttributeId = tower.attributeId; |
| | | // } |
| | | } |
| | | m_ParentTower = tower; |
| | | Transform starTs = transform.Find("Star"); |
| | |
| | | starTs.localRotation = Quaternion.Euler(60, 180, 0); |
| | | } |
| | | |
| | | Vector3 normalScale; |
| | | |
| | | private void Awake() |
| | | { |
| | | normalScale = new Vector3(1.5f, 1.5f, 1.5f); |
| | | canPlaceMesh.enabled = false; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// Returns a list of affectors that implement ITowerRadiusVisualizer |
| | | /// </summary> |
| | |
| | | { |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取当前TowerLevel对应的AttackRise. |
| | | /// </summary> |
| | | /// /// </summary> |
| | | public float attackRise { get { return m_ParentTower.attackRise; } } |
| | | |
| | | public void OnAfterDeserialize() |