Exemple #1
0
 /// <summary>
 /// 初始化默认管理器
 /// </summary>
 public void InitDefaultManagers()
 {
     _timerManager = new TimerManager();
     AddManager(_timerManager);
     _stageManager = new StageManager();
     AddManager(_stageManager);
     _pathManager = new PathManager();
     AddManager(_pathManager);
     _logManager = new LogManager();
     AddManager(_logManager);
     _langManager = new LangManager();
     AddManager(_langManager);
     _socketManager = new SocketManager();
     AddManager(_socketManager);
     _tableManager = new TableManager();
     AddManager(_tableManager);
     _objectPoolManager = new ObjectPoolManager();
     AddManager(_objectPoolManager);
     _fileManager = new FileManager();
     AddManager(_fileManager);
     _resourceManager = new ResourceManager();
     AddManager(_resourceManager);
     _assetManager = new AssetManager();
     AddManager(_assetManager);
     _audioManager = new AudioManager();
     AddManager(_audioManager);
     _sceneManager = new ScenesManager();
     AddManager(_sceneManager);
     _touchManager = new TouchManager();
     AddManager(_touchManager);
     _platformManager = new PlatformManager();
     AddManager(_platformManager);
 }
Exemple #2
0
 /// <summary>
 /// Unity3d OnEnable callback.
 /// </summary>
 protected virtual void OnEnable()
 {
     manager = TouchManager.Instance;
     if (manager == null)
     {
         throw new InvalidOperationException("TouchManager instance is required!");
     }
 }
Exemple #3
0
        public TouchScreen(ITouchManager iTouchManager, double height, double width, uint pixelsH, uint pixelsW, TouchScreenType touchScreenType) : base(height, width, pixelsH, pixelsW)
        {
            this.iTouchManager           = iTouchManager;
            iTouchManager.OnAddTouch    += AddTouch;
            iTouchManager.OnRemoveTouch += RemoveTouch;

            SetTouchHandler();
        }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        pathRendererParent = new GameObject("PathRenderer");

        touchManager = TouchManager.Instance;

        // Init material for path renderer
        if (!movableObject)
        {
            pathRendererMaterial = new Material(Shader.Find("Particles/Additive"));
        }
    }
Exemple #5
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(this);
                return;
            }

            manager = TouchManager.Instance;

            gameObject.hideFlags = HideFlags.HideInHierarchy;
            DontDestroyOnLoad(gameObject);
        }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        touchManager = TouchManager.Instance;

        if (right == null)
        {
            initialize();
        }

        SpriteRenderer sr = gameObject.GetComponent <SpriteRenderer>();

        if (sr != null)
        {
            Vector3 position = right.transform.position;
            position.x = sr.bounds.max.x;
            position.y = gameObject.transform.position.y;
            position.z = -5f;
            right.transform.position = position;
            position.x = sr.bounds.min.x;
            position.y = gameObject.transform.position.y;
            position.z = -5f;
            left.transform.position = position;

            position                  = top.transform.position;
            position.y                = sr.bounds.max.y;
            position.x                = gameObject.transform.position.x;
            position.z                = -5f;
            top.transform.position    = position;
            position.y                = sr.bounds.min.y;
            position.x                = gameObject.transform.position.x;
            position.z                = -5f;
            bottom.transform.position = position;
        }

        top.GetComponent <PressGesture>().Pressed    += buttonPressedHandler;
        right.GetComponent <PressGesture>().Pressed  += buttonPressedHandler;
        bottom.GetComponent <PressGesture>().Pressed += buttonPressedHandler;
        left.GetComponent <PressGesture>().Pressed   += buttonPressedHandler;

        calculateOriginalDimensions();
    }
Exemple #7
0
        /// <summary>
        /// Unity3d Start handler.
        /// </summary>
        protected virtual void OnEnable()
        {
            // TouchManager might be different in another scene
            touchManager           = TouchManager.Instance;
            gestureManagerInstance = GestureManager.Instance as GestureManagerInstance;

            if (touchManager == null)
            {
                Debug.LogError("No TouchManager found! Please add an instance of TouchManager to the scene!");
            }
            if (gestureManagerInstance == null)
            {
                Debug.LogError("No GesturehManager found! Please add an instance of GesturehManager to the scene!");
            }

            if (sendMessageTarget == null)
            {
                sendMessageTarget = gameObject;
            }
            Reset();
        }
    // Use this for initialization
    void Start()
    {
        touchManager = TouchManager.Instance;

        pathBtn.GetComponent <PressGesture>().Pressed              += buttonPressedHandler;
        replaceBtn.GetComponent <PressGesture>().Pressed           += buttonPressedHandler;
        removeBtn.GetComponent <PressGesture>().Pressed            += buttonPressedHandler;
        resetBtn.GetComponent <PressGesture>().Pressed             += buttonPressedHandler;
        exitBtn.GetComponent <PressGesture>().Pressed              += buttonPressedHandler;
        pathSliderTab.GetComponent <PressGesture>().Pressed        += buttonPressedHandler;
        jumpSliderTab.GetComponent <PressGesture>().Pressed        += buttonPressedHandler;
        moveSliderTab.GetComponent <PressGesture>().Pressed        += buttonPressedHandler;
        aiHorizMoveSliderTab.GetComponent <PressGesture>().Pressed += buttonPressedHandler;
        cameraBtn.GetComponent <PressGesture>().Pressed            += buttonPressedHandler;
        saveBtn.GetComponent <PressGesture>().Pressed              += buttonPressedHandler;
        loadBtn.GetComponent <PressGesture>().Pressed              += buttonPressedHandler;
        snapToGridBtn.GetComponent <PressGesture>().Pressed        += buttonPressedHandler;
        bottomCamCanvas.GetComponent <PressGesture>().Pressed      += buttonPressedHandler;

        bottomCamCanvas.GetComponent <ReleaseGesture>().Released += buttonReleasedHandler;
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        touchManager = TouchManager.Instance;
        levelManager = LevelManager.instance;

        for (int i = 0; i < panBtns.Length; i++)
        {
            panBtns[i].GetComponent <PressGesture>().Pressed    += buttonPressedHandler;
            panBtns[i].GetComponent <ReleaseGesture>().Released += buttonReleasedHandler;
        }
        for (int i = 0; i < zoomBtns.Length; i++)
        {
            zoomBtns[i].GetComponent <PressGesture>().Pressed    += buttonPressedHandler;
            zoomBtns[i].GetComponent <ReleaseGesture>().Released += buttonReleasedHandler;
        }

        targetBtn.GetComponent <PressGesture>().Pressed    += buttonPressedHandler;
        targetBtn.GetComponent <ReleaseGesture>().Released += buttonReleasedHandler;

        previousTime = Time.realtimeSinceStartup;
    }
Exemple #10
0
        public override async Task LoadContent()
        {
            await base.LoadContent();

            AddCancelButton();

            touches = ScreenManager.Game.Services.GetService <ITouchManager>();

            var stack = new StackLayout()
            {
                Alignment  = StackAlignment.Bottom,
                Horizontal = HorizontalAlignment.Left,
                Vertical   = VerticalAlignment.Bottom
            };

            stack.Position = new Point(ResolutionBuddy.Resolution.ScreenArea.Left, ResolutionBuddy.Resolution.ScreenArea.Bottom);

            var label = new Label("butt", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };

            stack.AddItem(label);

            label = new Label("nuts", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);
            AddItem(stack);

            stack = new StackLayout()
            {
                Alignment  = StackAlignment.Bottom,
                Horizontal = HorizontalAlignment.Center,
                Vertical   = VerticalAlignment.Bottom
            };
            stack.Position = new Point(ResolutionBuddy.Resolution.ScreenArea.Center.X, ResolutionBuddy.Resolution.ScreenArea.Bottom);

            label = new Label("butt", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);

            label = new Label("nuts", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);
            AddItem(stack);

            stack = new StackLayout()
            {
                Alignment  = StackAlignment.Bottom,
                Horizontal = HorizontalAlignment.Right,
                Vertical   = VerticalAlignment.Bottom
            };
            stack.Position = new Point(ResolutionBuddy.Resolution.ScreenArea.Right, ResolutionBuddy.Resolution.ScreenArea.Bottom);

            label = new Label("butt", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);

            label = new Label("nuts", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);
            AddItem(stack);

            stack = new StackLayout()
            {
                Alignment  = StackAlignment.Left,
                Horizontal = HorizontalAlignment.Right,
                Vertical   = VerticalAlignment.Center
            };
            stack.Position = new Point(ResolutionBuddy.Resolution.ScreenArea.Left, ResolutionBuddy.Resolution.ScreenArea.Center.Y);

            label = new Label("butt", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);

            label = new Label("nuts", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);
            AddItem(stack);

            stack = new StackLayout()
            {
                Alignment  = StackAlignment.Right,
                Horizontal = HorizontalAlignment.Right,
                Vertical   = VerticalAlignment.Center
            };
            stack.Position = new Point(ResolutionBuddy.Resolution.ScreenArea.Right, ResolutionBuddy.Resolution.ScreenArea.Center.Y);

            label = new Label("butt", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);

            label = new Label("nuts", Content, FontSize.Small)
            {
                HasOutline    = true,
                HasBackground = false
            };
            stack.AddItem(label);
            AddItem(stack);
        }
 /// <summary>
 /// Unity OnDestroy callback.
 /// </summary>
 protected virtual void OnDisable()
 {
     manager = null;
 }
 /// <summary>
 /// Unity OnEnable callback.
 /// </summary>
 protected virtual void OnEnable()
 {
     manager = TouchManager.Instance;
     if (manager == null) throw new InvalidOperationException("TouchManager instance is required!");
 }
Exemple #13
0
 /// <summary>
 /// Unity3d OnDisable callback.
 /// </summary>
 protected virtual void OnDisable()
 {
     manager = null;
 }
Exemple #14
0
        public void InitLayoutView(ITouchManager touchManager)
        {
            SoundToggleButtonPosition = new Point(126, 1925);

            touchManager.PushClickRect(new TouchRect(SoundToggleButtonPosition.X, SoundToggleButtonPosition.Y, 200, 200, soundToggleTrigger, true));
        }
        public void Init()
        {
            mainLayer = Renderer.CreateLayer(_width, _height, Layout);
            Renderer.AddLayer(mainLayer);

            TouchManager = new TouchManager(this._game.Client);



            this.LobbyOverlay      = Renderer.GetImage("lobby.lobby");
            this.ProfileOverlay    = Renderer.GetImage("lobby.profile");
            this.GoldCoinOverlay   = Renderer.GetImage("coinBoxOverlay");
            this.SilverCoinOverlay = Renderer.GetImage("silverCoinBoxOverlay");
            this.LobbyBackground   = Renderer.GetImage("lobby.wideBackground");

            this.AllRoomsOverlay  = Renderer.GetImage("lobby.allRooms");
            this.FeaturedOverlay  = Renderer.GetImage("lobby.featuredText");
            this.FavoritesOverlay = Renderer.GetImage("lobby.favoritesText");

            this.EyeOverlay    = Renderer.GetImage("lobby.eyeBall");
            this.DollarOverlay = Renderer.GetImage("lobby.dollarSign");
            this.StarOverlay   = Renderer.GetImage("lobby.favoritesStar");

            this.SelectedOverlay = Renderer.GetImage("lobby.selectedButton");

            this.CreateRoomTextOverlay = Renderer.GetImage("lobby.createNewRoomText");
            this.OrangeButtonOverlay   = Renderer.GetImage("lobby.orangeButton");
            this.PlusOverlay           = Renderer.GetImage("lobby.plus");

            this.ScrollBarOverlay       = Renderer.GetImage("lobby.scrollBar");
            this.ScrollBarButtonOverlay = Renderer.GetImage("lobby.scrollButton");



            this.LobbyOverlayPosition      = new Point(45, 14);
            this.ProfileOverlayPosition    = new Point(192, 9);
            this.GoldCoinOverlayPosition   = new Point(349, 3);
            this.SilverCoinOverlayPosition = new Point(610, 3);
            this.LobbyBackgroundPosition   = new Point(11, 45);


            this.AllRoomsButtonPosition  = new Point(30, 55);
            this.FeaturedButtonPosition  = new Point(205, 55);
            this.FavoritesButtonPosition = new Point(380, 55);

            this.ButtonIconOffset = new Point(25, 25);
            this.ButtonTextOffset = new Point(100, 25);

            this.CreateRoomPosition = new Point(565, 55);

            this.CreateRoomIconOffset = new Point(25, 25);
            this.CreateRoomTextOffset = new Point(100, 25);

            this.RoomsPosition = new Point(12, 110);

            RoomButtonColor          = new Color(230, 230, 230);
            AlternateRoomButtonColor = new Color(191, 191, 191);

            ScrollBarPosition = new Point((int)(LobbyOverlayPosition.X + LobbyBackground.Width - ScrollBarButtonOverlay.Center.X - 50), RoomsPosition.Y);

            RoomButtonSize = new Size(745, 90);

            NumberOfRoomsVisible = 5;
            createTouches();

            Layout.UIManager.CreateTextBox(new Rectangle(CreateRoomPosition, OrangeButtonOverlay.Width, OrangeButtonOverlay.Height), this);

            Rooms = new List <LobbyRoom>()
            {
                new LobbyRoom()
                {
                    Name = "Room Name 1"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 2"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 3"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 4"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 5"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 6"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 7"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 8"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 9"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 10"
                },
            };
        }
Exemple #16
0
        /// <summary>
        /// Unity3d Start handler.
        /// </summary>
        protected virtual void OnEnable()
        {
            // TouchManager might be different in another scene
            touchManager = TouchManager.Instance;
            gestureManagerInstance = GestureManager.Instance as GestureManagerInstance;

            if (touchManager == null) Debug.LogError("No TouchManager found! Please add an instance of TouchManager to the scene!");
            if (gestureManagerInstance == null) Debug.LogError("No GesturehManager found! Please add an instance of GesturehManager to the scene!");

            if (sendMessageTarget == null) sendMessageTarget = gameObject;
            Reset();
        }
 public void InitLayoutView(ITouchManager touchManager)
 {
     createAnimation();
 }
 public void InitLayoutView(ITouchManager touchManager)
 {
 }