public override void FindHive(HiveController foundedHive)
 {
     //if(Vector3.Distance(transform.position,foundedHive.transform.position)<=eyesight)
     //{
         if (foundedHive.hiveFraction!=fraction)
         {
             //Debug.Log("SOLDIER ATTACKS HIVE");
             foundedHive.GetCaptured(fraction,damage,hive.antColor);
             wasAlienHiveFound = true;
         } else if(foundedHive.currentHealth<foundedHive.healthToCapture)
             {
                 Debug.Log("SOLDIER REPAIRS HIVE");
                 foundedHive.GetCaptured(fraction,repair,hive.antColor);
                 wasAlienHiveFound = true;
             } else if(foundedHive != hive)
             {
                 Debug.Log(unitType + " CHANGED HIVE");
                 hive.ChangeUnits(-1);
                 hive = foundedHive;
                 hive.ChangeUnits(1);
                 transform.parent = hive.transform;
                 TimeToExplore ();
             }
     //}
 }
 // Start is called before the first frame update
 void Start()
 {
     uiC            = GetComponent <UIController>();
     ruleC          = GetComponent <RuleController>();
     timeC          = GetComponent <TimeController>();
     scoreC         = GetComponent <ScoreController>();
     otherBeeC      = GetComponent <OtherBeeController>();
     hiveC          = GetComponent <HiveController>();
     soundC         = GetComponent <SoundController>();
     BGM            = GetComponent <AudioSource>();
     bee            = BeeObject.GetComponent <Bee>();
     scene          = SCENE.Home;
     gamePlayedOnce = false;
 }
Example #3
0
 public virtual void SetBehavior(GameObject hiveC)
 {
     hive = hiveC.GetComponent<HiveController>();
     speed = hive.hiveSpeed+Random.Range(-0.5f,1f);
     range = hive.hiveRange;
     maxCargo = hive.hiveMaxCargo;
     fraction = hive.hiveFraction;
     maxHealth = hive.hiveHealth;
     health = maxHealth;
     damage = hive.hiveDamage;
     repair = hive.hiveRepair;
     GetComponentInChildren<AntCargo>().fraction = fraction;
     InvokeRepeating("FindNextSector",0f,0.5f/speed);
 }