private void createIndicator() { if (!spaceCarrier.isVisible && offscreenIndicator == null) { offscreenIndicator = Instantiate(OffscreenIndicatorPrefab); offscreenIndicator.setSpaceCarrier(spaceCarrier); return; } if (spaceCarrier.isVisible && offscreenIndicator != null) { destroyIndicator(); offscreenIndicator = null; } }
// Use this for initialization void Start() { game = FindObjectOfType <GameController>(); timeLeft = duration; hud = FindObjectOfType <HUDManager>(); visitorMangager = FindObjectOfType <VisitorManager>(); if (gameObject.GetComponent <Animator>()) { isAnimation = true; } audioSource = gameObject.AddComponent <AudioSource>(); transform.localEulerAngles = Vector3.zero; waitingCountText.transform.parent.eulerAngles = Vector3.zero; GameObject indicator = Instantiate(game.offscreenAttractionIndicator); myIndicator = indicator.GetComponent <OffscreenIndicator>(); myIndicator.SetTarget(this.transform); myIndicator.transform.SetParent(this.transform, false); myIndicator.gameObject.SetActive(false); }
protected override void OnSpawn() { base.OnSpawn(); Instance = this; }