private void Awake() // Initialization
    {
        int childCount = crosshairContainer.childCount;

        crosshairLinesTransforms = new RectTransform[childCount];
        crosshairLinesImages     = new Image[childCount];

        for (int i = 0; i < childCount; i++)
        {
            Transform child = crosshairContainer.GetChild(i);

            try
            {
                crosshairLinesImages[i]     = child.GetComponent <Image>();
                crosshairLinesTransforms[i] = child.GetComponent <RectTransform>();
            }
            catch (Exception e)
            {
#if UNITY_EDITOR
                Debug.LogWarning("" + e + "\n| i: " + i);
                Debug.Break();
#endif
            }
        }


        dotTransform    = cursorDot.GetComponent <RectTransform>();
        saveLoadUtility = new CursorSaveLoad();

        OnClick_ReloadProperties();
    }
Пример #2
0
 private void Awake()
 {
     LoadTextures();
     cursorSaveLoadUtility = new CursorSaveLoad();
 }