// Use this for initialization void Start() { Targeter targeter = GetComponent <Targeter>(); targeter.onAcquiredTarget.AddListener(FoundTarget); hudOB = WorldUI.instance.CreateTargetHUD(transform); hudOB.gameObject.SetActive(false); }
public UIPosIndicator CreateTargetHUD(Transform targetTransform) { GameObject go = Instantiate(Resources.Load <GameObject>("TargetBox"), transform); UIPosIndicator hudOB = go.GetComponent <UIPosIndicator>(); hudOB.Init(targetTransform, true); return(hudOB); }