예제 #1
0
    public void Activate(string text, UnityEngine.Events.UnityAction action)
    {
        RandomZigzagPath path = new RandomZigzagPath(new Vector3(0.0f, 5.0f, 0.0f), new Vector3(10.0f, 5.0f, 0.0f));

        for (int i = 0; i < path.vertices.Length; i++)
        {
            Debug.Log("index:" + i + ", point:" + path.vertices[i].ToString());
        }
        gameObject.SetActive(true);
        this.text.text           = text;
        backgroundRect.sizeDelta = new Vector2(backgroundRect.rect.width, this.text.preferredHeight + 130.0f);
        submit.onClick.RemoveAllListeners();
        submit.onClick.AddListener(action);
        submit.onClick.AddListener(Close);
    }
예제 #2
0
 public override void Init(Vector3 end, float altitude = 0.0f)
 {
     base.Init(end, altitude);
     path = new RandomZigzagPath(transform.position, end);
     StartCoroutine(Move());
 }