示例#1
0
        private void Awake()
        {
            ComponentLocator.Resolve <Updater>().Register(UpdateType.Late, this);
            cachedTransform = transform;

            IsEnabled = target != null;
        }
示例#2
0
        private void CreateFPSCounter()
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager>();

            windowsManager.CreateWindow <GameLoadingWindow>(GameLoadingWindow.prefabPath, Enums.EnumWindowsLayer.Loading);
            windowsManager.CreateWindow <FPSWindow>(FPSWindow.prefabPath, Enums.EnumWindowsLayer.Special);
        }
示例#3
0
        public void OnClickTest()
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();

            windowsManager.CreateWindow <TestShootingWindow>(TestShootingWindow.prefabPath, Enums.EnumWindowsLayer.Main);

            Close();
        }
示例#4
0
        public void OnClickTest2()
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();

            windowsManager.CreateWindow <SpaceShipTestWindow>(SpaceShipTestWindow.prefabPath, Enums.EnumWindowsLayer.Main);

            Close();
        }
示例#5
0
        private void Awake()
        {
            cachedTransform = transform;

            pitch           = startRotationAngle.x;
            yaw             = startRotationAngle.y;
            currentRotation = startRotationAngle;

            ComponentLocator.Resolve <Updater>().Register(UpdateType.Default, this);
        }
        public GameplayCameraStandaloneAdapter(bool _enabled) : base(_enabled)
        {
            EventManager.AddEventListener(ConstantEventsName.ON_GAMEPLAY_CAMERA_ENABLE, OnGameplayCameraEnableHandler);

            camera = ComponentLocator.Resolve <GameplayCameraController>();
            if (camera == null)
            {
                SetEnable(false);
            }
        }
示例#7
0
        public SpaceshipControlEditorAdapter(bool _enabled) : base(_enabled)
        {
            EventManager.AddEventListener(ConstantEventsName.ON_PLAYER_SPACESHIP_CREATE, OnPlayerSpaceshipCreateHandler);
            EventManager.AddEventListener(ConstantEventsName.ON_PLAYER_SPACESHIP_DESTROY, OnPlayerSpaceshipDestroyHandler);

            playerSpaceship = ComponentLocator.Resolve <PlayerSpaceship>();
            if (playerSpaceship == null)
            {
                SetEnable(false);
            }
        }
        private void OnGameplayCameraEnableHandler(CustomEvent _event)
        {
            var state = (bool)_event.EventData;

            if (state && camera == null)
            {
                camera = ComponentLocator.Resolve <GameplayCameraController>();
            }

            SetEnable(state);
        }
示例#9
0
        public override void Initialize(object _data)
        {
            //sceneName = (string)_data;

            //var operation = SceneManager.LoadSceneAsync(sceneName);
            //StartCoroutine(UpdateProgress(operation));

            var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();

            mainMenu = windowsManager.CreateWindow <MainMenuWindow>(MainMenuWindow.prefabPath, Enums.EnumWindowsLayer.Main);
            mainMenu.OnInitialize += OnInitializeHandler;

            base.Initialize(_data);
        }
示例#10
0
        public override void Initialize(object _data)
        {
            data = _data;

            if (gameManager.CheckCurrentScene(ConstantScenes.SPACE_TEST))
            {
                base.Initialize(_data);
            }
            else
            {
                var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();
                loadingWindow = windowsManager.CreateWindow <SceneLoadingWindow>(SceneLoadingWindow.prefabPath, Enums.EnumWindowsLayer.Loading, ConstantScenes.SPACE_TEST);
                loadingWindow.OnSceneLoaded += OnSceneLoadedHandler;
            }
        }
示例#11
0
        private void Create3DUIWindows(PlayerSpaceship _playerSpaceship)
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();

            uiWindow = windowsManager.CreateWindow <SpaceShipTest3DUIWindow>(SpaceShipTest3DUIWindow.prefabPath, Enums.EnumWindowsLayer.World, _playerSpaceship, false);
        }
示例#12
0
        protected override void CustomClose(bool _result)
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager.WindowsManager>();

            windowsManager.CreateWindow <MainMenuWindow>(MainMenuWindow.prefabPath, Enums.EnumWindowsLayer.Main);
        }
示例#13
0
        //TODO
        private void Initialize()
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager>();

            windowsManager.CreateWindow <GameLoadingWindow>(GameLoadingWindow.prefabPath, Enums.EnumWindowsLayer.Loading, ConstantScenes.MAIN_MENU);
        }
示例#14
0
        private void Awake()
        {
            var windowsManager = ComponentLocator.Resolve <WindowsManager>();

            windowsManager.CreateWindow <MainMenuWindow>(MainMenuWindow.prefabPath, Enums.EnumWindowsLayer.Main);
        }
示例#15
0
        private void Awake()
        {
            cachedTransform = transform;

            ComponentLocator.Resolve <Updater>().Register(UpdateType.Default, this);
        }
示例#16
0
 private void OnDestroy()
 {
     ComponentLocator.Resolve <Updater>().Delete(UpdateType.Default, this);
     ComponentLocator.Resolve <Updater>().Delete(UpdateType.Late, this);
 }
示例#17
0
 private void Awake()
 {
     joystick = GetComponent <Joystick>();
     adapter  = (SpaceshipControlMobileAdapter)ComponentLocator.Resolve <InputController>()?.GetAdapter(Enums.EnumInputAdapters.SpaceshipControl);
 }