public void Init(Sentence.Info sentenceInfo, Callback callback) { this.sentenceInfo = sentenceInfo; this.callback = callback; if (sentenceInfo.Hooker != null) { hookerRenderer = sentenceInfo.Hooker.GetComponent <Renderer> (); if (hookerRenderer == null) { hookerRenderer = sentenceInfo.Hooker.GetComponentInChildren <Renderer> (); } if (hookerRenderer != null) { this.transform.position = new Vector3(sentenceInfo.Hooker.transform.position.x, sentenceInfo.Hooker.transform.position.y + hookerRenderer.bounds.size.y); } else { this.transform.position = new Vector3(sentenceInfo.Hooker.transform.position.x, sentenceInfo.Hooker.transform.position.y); } } SetCanvasSizeAndImages(); SetSpringJoint(); Destroy(gameObject, sentenceInfo.timeInSeconds); }
public void Init(Sentence.Info sentenceInfo, Callback callback){ this.sentenceInfo = sentenceInfo; this.callback = callback; if(sentenceInfo.Hooker!=null) this.transform.position = sentenceInfo.Hooker.transform.position; SetCanvasSizeAndImages (); SetSpringJoint (); Destroy(gameObject, sentenceInfo.timeInSeconds); }
public void Init(Sentence.Info sentenceInfo, Callback callback) { this.sentenceInfo = sentenceInfo; this.callback = callback; if (sentenceInfo.Hooker != null) { this.transform.position = sentenceInfo.Hooker.transform.position; } SetCanvasSizeAndImages(); SetSpringJoint(); Destroy(gameObject, sentenceInfo.timeInSeconds); }