protected virtual void Start() { sh = transform.root.GetComponentInChildren <StealthHider>(); cs = GetComponentInParent <ControlSource>(); move = transform.parent.GetComponentInChildren <Movement>(); SelectFiringSound(); energy = GetComponent <Energy>(); }
// Start is called before the first frame update void Start() { ut = FindObjectOfType <UnitTracker>(); ownIFF = GetComponentInChildren <IFF>(); attackRange = weaponLifetime * weaponSpeed; selectedFiringSound = SelectSoundFromArray(firingSounds); sh = GetComponentInChildren <StealthHider>(); }
// 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; }
protected override void Start() { base.Start(); weaponSource = GetComponentInChildren <WeaponSource>().transform; sh = GetComponentInChildren <StealthHider>(); }