Example #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public HovercursorState(Transform pBaseTx, HovercursorInput pInput,
                                HovercursorVisualSettings pVisualSett, Transform pCamera)
        {
            vBaseTx = pBaseTx;
            vInput  = pInput;

            VisualSettings    = pVisualSett;
            CameraTransform   = pCamera;
            ActiveCursorTypes = new CursorType[0];

            vCursorMap    = new Dictionary <CursorType, CursorState>();
            vTransformMap = new Dictionary <CursorType, Transform>();
            vDelegates    = new List <IHovercursorDelegate>();
        }
Example #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public void Awake()
        {
            const string prefix = "Hovercursor";

            DefaultVisualSettings = UnityUtil.FindComponentOrCreate <HovercursorVisualSettings,
                                                                     HovercursorVisualSettingsStandard>(DefaultVisualSettings, gameObject, prefix);

            Input        = UnityUtil.FindComponentOrFail(Input, prefix);
            CenterCamera = UnityUtil.FindComponentOrFail(CenterCamera, prefix);

            vState = new HovercursorState(Input, DefaultVisualSettings,
                                          CenterCamera.gameObject.transform);

            vPrevActiveCursorTypes = new List <CursorType>();
            vCursorMap             = new Dictionary <CursorType, UiCursor>(EnumIntKeyComparer.CursorType);
            vHideCursorTypes       = new List <CursorType>();
            vShowCursorTypes       = new List <CursorType>();
        }
Example #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public void Awake()
        {
            const string prefix = "Hovercursor";

            DefaultVisualSettings = UnityUtil.FindComponentOrCreate <HovercursorVisualSettings,
                                                                     HovercursorVisualSettingsStandard>(DefaultVisualSettings, gameObject, prefix);

            Input = UnityUtil.FindComponentOrFail(Input, prefix);

            if (CameraTransform == null)
            {
                CameraTransform = gameObject.transform;
            }

            vState = new HovercursorState(gameObject.transform, Input,
                                          DefaultVisualSettings, CameraTransform);

            vPrevActiveCursorTypes = new CursorType[0];
            vCursorMap             = new Dictionary <CursorType, UiCursor>();
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public HovercursorState(HovercursorInput pInput,
                                HovercursorVisualSettings pVisualSett, Transform pCamera)
        {
            vInput = pInput;

            VisualSettings  = pVisualSett;
            CameraTransform = pCamera;

            vCursorStateMap = new Dictionary <CursorType, CursorState>(EnumIntKeyComparer.CursorType);
            vCursorStates   = new List <CursorState>();
            vTransformMap   = new Dictionary <CursorType, Transform>(EnumIntKeyComparer.CursorType);
            vDelegates      = new List <IHovercursorDelegate>();

            vActiveDelegates      = new List <IHovercursorDelegate>();
            vActiveCursorTypes    = new List <CursorType>();
            vActiveCursorMap      = new HashSet <CursorType>(EnumIntKeyComparer.CursorType);
            vActiveCursorPlaneMap = new Dictionary <CursorType, ReadList <PlaneData> >(
                EnumIntKeyComparer.CursorType);

            ActiveCursorTypes = vActiveCursorTypes.AsReadOnly();

            vInput.SetPlaneProvider(GetActiveCursorPlanes);
        }