예제 #1
0
    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);
    }
예제 #2
0
	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);
	}
예제 #3
0
    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);
    }