示例#1
0
    int ownAllegiance; //this is fine to set because combat units don't just change allegiance...

    protected override void Start()
    {
        base.Start();
        ownAllegiance = iff.GetIFFAllegiance();
        attackRange   = attack.GetAttackRange();
        speedSetting  = 2;
        CreateNewOffset(1);
        ss              = GetComponentInChildren <StealthSeeker>();
        factionLeader   = am.factionLeaders[ownAllegiance].gameObject;
        factionLeaderCS = factionLeader.GetComponent <ControlSource>();
    }
示例#2
0
 // Start is called before the first frame update
 public override void OnStartServer()
 {
     base.OnStartServer();
     ut                      = FindObjectOfType <UnitTracker>();
     ownIFF                  = GetComponent <IFF>();
     attackRange             = weaponLifetime * weaponSpeed;
     sh                      = GetComponentInChildren <StealthHider>();
     ss                      = GetComponentInChildren <StealthSeeker>();
     ss.OnSeekerDetection   += EvaluateDetectedObject;
     ss.OnSeekerLostContact += HandleLostContact;
     ut.AddUnitToTargetableList(gameObject);
     ownIFF.OnChangeIFF += CheckForAlliesAsTargetsAfterIFFChange;
 }