Exemplo n.º 1
0
 public void Init(MazeSolving.BlockData data)
 {
     block = GetComponentInChildren <RawImage>();
     _data = data;
     _data.changeTypeAction = ChangeBlockView;
 }
Exemplo n.º 2
0
    public static MazeBlockCtrl Show(Transform parent, Vector2 size, Vector3 position, MazeSolving.BlockData data)
    {
        GameObject blockGO = Instantiate(Resources.Load <GameObject>("MazeBlock"));

        blockGO.name             = "[" + data.x + "," + data.y + "]";
        blockGO.transform.parent = parent;
        blockGO.GetComponent <RectTransform>().sizeDelta     = size;
        blockGO.GetComponent <RectTransform>().localPosition = position;
        MazeBlockCtrl ctrl = blockGO.GetComponent <MazeBlockCtrl>();

        ctrl.Init(data);

        return(ctrl);
    }