예제 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #2
0
        public StatTile()
        {
            InitializeComponent();

            // Initialisation des polices :
            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                txtNumber.Font      = new Font(Fonts.bold, 25);
                txtDescription.Font = new Font(Fonts.regular, 14);
            }

            // Initialisation des effets de survol :
            List <Control> bg = new List <Control>()
            {
                this
            };
            List <Control> fg = new List <Control>()
            {
                txtDescription, txtIcon, txtNumber
            };

            hover = new HoverController(bg, fg, this);

            hover.bg_default = Colors.lightBlue;
            hover.bg_hover   = Colors.blue;
            hover.bg_pressed = Colors.green;

            hover.fg_default = Colors.blue;
            hover.fg_hover   = Colors.white;
            hover.fg_pressed = Colors.white;
        }
예제 #3
0
    private void Start()
    {
        curPosition  = transform.position;
        lastPosition = transform.position;

        soundSources    = GetComponents <AudioSource>();
        hoverController = GameObject.FindObjectOfType <HoverController>();
        hoverController.onBorderCollision += PlayBorderCollisionSound;
    }
예제 #4
0
 /// <summary>
 /// Triggered by Unity UI. If enabled set text to be displayed if user continues to hover
 /// </summary>
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (Application.isMobilePlatform)
     {
         if (HoverController.DisplayHoverNoDelay(_hoverText))
         {
             HoverController.SetHoverObject(transform);
         }
     }
     else
     {
         if (HoverController.DisplayHover(_hoverText))
         {
             HoverController.SetHoverObject(transform);
         }
     }
 }
예제 #5
0
        #pragma warning restore 0414

        public HoverProvider(
            RoslynCompilationWorkspace compilationWorkspace,
            ScriptContext context,
            Func <string, SourceText> getSourceTextByModelId)
        {
            this.context = context
                           ?? throw new ArgumentNullException(nameof(context));

            this.getSourceTextByModelId = getSourceTextByModelId
                                          ?? throw new ArgumentNullException(nameof(getSourceTextByModelId));

            controller = new HoverController(compilationWorkspace);

            providerTicket = context.GlobalObject.xiexports.monaco.RegisterWorkbookHoverProvider(
                "csharp",
                (ScriptFunc)ProvideHover);
        }
예제 #6
0
    private void PrepareGame()
    {
        SaveGameManager.Load();

        Score        = SaveGameManager.saveFile.score;
        MaxScore     = SaveGameManager.saveFile.highScore;
        CurrentLevel = SaveGameManager.saveFile.levelReached;

        ParseWavesProgression();
        player = Instantiate(playerPrefab, new Vector3(0, 9, 0), Quaternion.identity);

        //var hoverController = player.GetComponent<HoverController>();

        hoverController = GameObject.FindObjectOfType <HoverController>();
        hoverController.onPlayerFire  += Shoot;
        hoverController.onPlayerDeath += GrantDestroyPlayer;
        //hoverController.onProjectileSpawn += StartListenProjectileEvents;

        ChangeGameState(gameState.game);
        //onLevelChange?.Invoke(CurrentLevel);
        Invoke("StartSpawningEnemies", 1f);
    }
예제 #7
0
        public CloseBtn()
        {
            InitializeComponent();

            hover = new HoverController(new List <Control>()
            {
                this
            }, new List <Control>()
            {
                icon
            }, this);

            hover.bg_default = Color.Transparent;
            hover.bg_hover   = Colors.red;
            hover.bg_pressed = Colors.lightRed;

            hover.fg_default = Colors.black;
            hover.fg_hover   = Color.White;
            hover.fg_pressed = Color.White;

            icon.Text = Char.ConvertFromUtf32(0xE711);
        }
예제 #8
0
        public EventPreview()
        {
            InitializeComponent();

            // Initialisation des icones :
            iconParticipants.Text = char.ConvertFromUtf32(0xEBDA);

            // Initialisation des polices :
            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                txtTitle.Font        = new Font(Fonts.bold, 14);
                txtDate.Font         = new Font(Fonts.regular, 10);
                txtParticipants.Font = new Font(Fonts.book, 10);
            }

            // Initialisation de l'effet de survol
            hover = new HoverController(new List <Control>()
            {
                this
            }, new List <Control>()
            {
                txtDate, txtParticipants, txtTitle, iconParticipants
            }, this);
            hover.bg_default = Colors.lightBlue;
            hover.bg_hover   = Colors.blue;
            hover.bg_pressed = Colors.green;
            hover.fg_default = Colors.blue;
            hover.fg_hover   = Colors.white;
            hover.fg_pressed = Colors.white;

            // Ajout de l'évènement Click à tout les controles
            foreach (Control ctrl in Controls)
            {
                ctrl.Click += new System.EventHandler(EventPreview_Click);
            }
        }
예제 #9
0
 /// <summary>
 /// Triggered by Unity UI. If enabled hide hover pop-up
 /// </summary>
 public void OnPointerExit(PointerEventData eventData)
 {
     HoverController.HideHover();
 }