private void Update() { gameObject.SetActive(newsObj != null && newsObj.isActiveAndEnabled); if (newsObj == null) { return; } transform.position = Utils.WorldToUISpace(game.HUD.Canvas, newsObj.GetPosition()) + offset; }
private bool CheckTrueNews() { var trueNewsHit = Physics2D.CircleCastAll(transform.position, sightRange, Vector2.zero, 0, game.Layers.Item); foreach (var item in trueNewsHit) { TrueNews trueNews = item.transform.GetComponent <TrueNews>(); if (trueNews) { //bubble.SetReaction(ECitizenReaction.What); targetPos = trueNews.GetPosition(); game.SoundManager.PlaySound(SoundManager.ESound.eCitizenNews); return(true); } } return(false); }