private void Awake() { myManager = FindObjectOfType <JigsawManager>(); slotTransform = gameObject.GetComponent <RectTransform>(); button = gameObject.GetComponent <Button>(); img = gameObject.GetComponent <Image>(); }
void Start() { jmgr = GameObject.FindObjectOfType <JigsawManager> (); jevt = GameObject.FindObjectOfType <JigsawPieceEvents> (); jpd = gameObject.GetComponent <JigsawPieceData> (); jevt.onPieceDroppedEvent += CheckPieceConnection; }
private void Awake() { button = gameObject.GetComponent <Button>(); img = gameObject.GetComponent <Image>(); myManager = FindObjectOfType <JigsawManager>(); // Add the event of sticking to the cursor once we've clicked the button. gameObject.GetComponent <Button>().onClick.AddListener(delegate { this.StickToCursor(true); }); }
// Use this for initialization void Start() { manager = GetComponentInParent <JigsawManager>(); }