public void InitializeGathererStats(UnitBaseBehaviourComponent unit, UnitGatheringResourceStats tmp) { if (!tmp.dataInitialized) { tmp.SetInterval(unit, dmgInterval_B); tmp.GetAtkType = new Attack(); tmp.GetAtkType.CreateData(AttackType.Normal, Stats.Strength, unit.myStats.GetStats(Stats.Strength).GetLevel, unit.GetUnitBaseDamage()); tmp.unitDamage_C = myStats.NetDamage(tmp.GetAtkType); tmp.dataInitialized = true; } gathererStats.Add(tmp); }
// 1 public override void StartInteraction(InteractingComponent newUnit, ActionType actionIndex) { if (!canInteract) { return; } UnitBaseBehaviourComponent unit = newUnit.GetComponent <UnitBaseBehaviourComponent>(); // Obtain Interacting Unit if (unit.objectType == ObjectType.PlayerControlled || unit.objectType == ObjectType.Unit) { Debug.Log("Adding : " + newUnit.transform.name); interactingUnit.Add(unit); } UnitGatheringResourceStats tmp = new UnitGatheringResourceStats(); InitializeGathererStats(unit, tmp); ReceiveDamage(tmp.unitDamage_C, unit); }