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

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

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

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

            return(palm.GetRenderer());
        }
Example #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; }));
        }