public void Init(ConversationGrid grid, Card card) { this.grid = grid; gridPixelPosition = Camera.main.WorldToScreenPoint(grid.transform.position); this.card = card; cardInstance.Init(card); }
public void Init(ConversationGrid grid, Card card, CardInventory parent, CardSource source) { cardInstance.Init(card, parent == null); this.parent = parent; this.grid = grid; this.source = source; gridPixelPosition = Camera.main.WorldToScreenPoint(grid.transform.position); this.card = card; gridSquarePixels = Screen.height / grid.GridSquaresVertical; transform.SetParent(grid.transform); transform.localScale = Vector3.one * 0.97f; transform.localPosition = new Vector3( (Input.mousePosition.x - gridPixelPosition.x) / gridSquarePixels, (Input.mousePosition.y - gridPixelPosition.y) / gridSquarePixels, 0 ); firstDrag = true; OnMouseDown(); }