Beispiel #1
0
        /*--------------------------------------------------------------------------------------------*/
        public SegmentSettings GetPalmSettings(NavItem pNavItem)
        {
            InitOnce();

            HovercastCustomPalm palm = FindCustom(vMainPalm, pNavItem, (c => c.Palm));

            return(palm.GetSettings() ?? GetSegmentSettings(pNavItem));
        }
Beispiel #2
0
        /*--------------------------------------------------------------------------------------------*/
        public Type GetPalmRenderer(NavItem pNavItem)
        {
            InitOnce();

            HovercastCustomPalm palm = FindCustom(vMainPalm, pNavItem, (c => c.Palm));

            return(palm.GetRenderer());
        }
Beispiel #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void InitOnce()
        {
            if (vMainSeg != null)
            {
                return;
            }

            vMainSeg  = gameObject.GetComponent <HovercastCustomSegment>();
            vMainPalm = gameObject.GetComponent <HovercastCustomPalm>();
            vCursor   = gameObject.GetComponent <HovercastCustomCursor>();
            vInteract = gameObject.GetComponent <HovercastCustomInteraction>();

            if (vMainSeg == null)
            {
                Debug.LogWarning("Hovercast | No '" + typeof(HovercastCustomSegment).Name +
                                 "' provided; using default.");
                vMainSeg = gameObject.AddComponent <HovercastDefaultSegment>();
            }

            if (vMainPalm == null)
            {
                Debug.LogWarning("Hovercast | No '" + typeof(HovercastCustomPalm).Name +
                                 "' provided; using default.");
                vMainPalm = gameObject.AddComponent <HovercastDefaultPalm>();
            }

            if (vCursor == null)
            {
                Debug.LogWarning("Hovercast | No '" + typeof(HovercastCustomCursor).Name +
                                 "' provided; using default.");
                vCursor = gameObject.AddComponent <HovercastDefaultCursor>();
            }

            if (vInteract == null)
            {
                Debug.LogWarning("Hovercast | No '" + typeof(HovercastCustomInteraction).Name +
                                 "' provided; using default.");
                vInteract = gameObject.AddComponent <HovercastCustomInteraction>();
            }

            ////

            vCustomMap = new Dictionary <int, CustomItem>();

            HovercastCustomSegment[] segList =
                gameObject.GetComponentsInChildren <HovercastCustomSegment>();
            HovercastCustomPalm[] palmList =
                gameObject.GetComponentsInChildren <HovercastCustomPalm>();

            FillCustomItems(segList, ((c, s) => { c.Seg = s; }));
            FillCustomItems(palmList, ((c, p) => { c.Palm = p; }));
        }