protected void Init(SKU.Attribute p_castDuration, SKU.Attribute p_cooldownDuration, List <IRequirement> p_requirements, IProgressTracker p_progressTracker = null) { _castDuration = p_castDuration; _cooldownDuration = p_cooldownDuration; _requirements = p_requirements; _progressTracker = p_progressTracker; }
public void Init_Server(TowerData data) { Debug.Log("INIT SERVER"); if (entity.IsOwner()) { _data = data; state.TowerType = (int)_data.towerType; if (data.canAttack) { _attackRate = new SKU.Attribute(); _damage = new SKU.Attribute(); _range = new SKU.Attribute(); _attackRate.AddOnValueChangedListener(UpdateAttackRate_Server); _damage.AddOnValueChangedListener(UpdateDamage_Server); _range.AddOnValueChangedListener(UpdateRange_Server); AttributeManager attributeManager = gameObject.AddComponent <AttributeManager>(); attributeManager.Add(AttributeType.AttackRate, _attackRate); attributeManager.Add(AttributeType.Damage, _damage); attributeManager.Add(AttributeType.Range, _range); _attackRate.BaseValue = _data.attackRate; _damage.BaseValue = _data.damage; _range.BaseValue = _data.range; // TODO init from data gameObject.AddComponent <ShootBullet>(); } } }
void Start() { var requirement = new List <IRequirement>(); requirement.Add(new ValidTargetReq(gameObject)); SKU.Attribute rate = GetComponent <AttributeManager>().Get <SKU.Attribute>(AttributeType.AttackRate); base.Init(rate, requirement); }
public void Init_Server(float speed) { _speed = new SKU.Attribute(speed); GetComponent <AttributeManager>().Add(AttributeType.Speed, _speed); _aiPath = gameObject.AddComponent <AIPath>(); _aiPath.pickNextWaypointDist = 0.5f; AIDestinationSetter destination = gameObject.AddComponent <AIDestinationSetter>(); destination.target = _end; RaycastModifier modifier = gameObject.AddComponent <RaycastModifier>(); modifier.thickRaycast = true; modifier.thickRaycastRadius = 0.5f; }
void UpdateRange_Server(SKU.Attribute attribute) { state.Range = attribute.Value; }
void UpdateDamage_Server(SKU.Attribute attribute) { state.Damage = attribute.Value; }
void UpdateAttackRate_Server(SKU.Attribute attribute) { state.AttackRate = attribute.Value; }
protected void Init(SKU.Attribute p_cooldownDuration, List <IRequirement> p_requirements, IProgressTracker p_progressTracker = null) { Init(new SKU.Attribute(0f), p_cooldownDuration, p_requirements, p_progressTracker); }