Exemple #1
0
 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);
 }
Exemple #2
0
        // 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);
        }