Esempio n. 1
0
 private void Start()
 {
     clickManager          = new WeiClickManager();
     itemObjRectTransform  = GetComponent <RectTransform>();
     canvasGroup           = GetComponent <CanvasGroup>(); //used to modify the state of children elements  Alpha, Raycasting, Enabled....
     dragSlotRectTransform = GameObject.FindGameObjectWithTag("DraggingItem").GetComponent <RectTransform>();
     inventory             = transform.parent.parent.parent.GetComponent <InventoryUISetting>();
     draggedItemBox        = GameObject.FindGameObjectWithTag("DraggingItem").transform;
 }
        //private int imageTypeIndex;

        //This function is called when the object is loaded.
        private void OnEnable()
        {
            invUiSetting = target as InventoryUISetting;
            //here serializedObject is Representing the object or objects being inspected.
            slotRow              = serializedObject.FindProperty("row");
            slotColumn           = serializedObject.FindProperty("column");
            slotSize             = serializedObject.FindProperty("slotSize");
            iconSize             = serializedObject.FindProperty("iconSize");
            slotsPaddingBetweenX = serializedObject.FindProperty("paddingBetweenX");
            slotsPaddingBetweenY = serializedObject.FindProperty("paddingBetweenY");
            slotsPaddingLeft     = serializedObject.FindProperty("paddingLeft");
            slotsPaddingRight    = serializedObject.FindProperty("paddingRight");
            slotsPaddingTop      = serializedObject.FindProperty("paddingTop");
            slotsPaddingBottom   = serializedObject.FindProperty("paddingBottom");
            mainInventory        = serializedObject.FindProperty("mainInventory");
        }