// Use this for initialization void Start () { deathListeners = new List<DeathListener> (); screenAction = GameObject.Find ("Screen").GetComponent<ScreenAction> (); playerSprite = GetComponent<SpriteRenderer> (); playerControl = GetComponent<PlayerControl> (); // playerAnimator = GetComponent<Animator> (); foreach (Transform child in this.gameObject.transform) { if (child.name == "Ghost") { ghosty = child.gameObject; } } if (isLocalPlayer) { hearts = new Image[maxHealth]; // panel = GameObject.Find ("Canvas").transform.FindChild ("Player 0"); for (int i = 0; i < maxHealth; i++) { hearts [i] = GameObject.Find ("Heart" + (i + 1)).GetComponent<Image> (); } // playerAnimator = GetComponent<Animator> (); // playerSprite = GetComponent<SpriteRenderer> (); // foreach (Transform child in this.gameObject.transform) { // if (child.name == "Ghost") { // ghosty = child.gameObject; // } // } } else { // Need to actually use the // panel = GameObject.Find ("Canvas").transform.FindChild ("Player 0"); return; } // healthBarBackground = panel.FindChild ("Health Background").GetComponent<RectTransform> (); // healthBar = healthBarBackground.FindChild ("Health Foreground").GetComponent<RectTransform> (); notificationText = GameObject.Find("Notice").GetComponent<NotificationText> (); }
public async Task <ActionResult> PostNotification(NotificationData notificationData) { Notification notification = new Notification { ProductId = notificationData.ProductId, Type = notificationData.Type, State = 0 }; unitOfWork.Notifications.Add(notification); await unitOfWork.Save(); NotificationText notificationText = new NotificationText { CustomerId = User.FindFirst(ClaimTypes.NameIdentifier).Value, NotificationId = notification.Id, ReviewId = notificationData.ReviewId, TimeStamp = DateTime.Now, Type = 0, Text = notificationData.Comments }; unitOfWork.NotificationText.Add(notificationText); await unitOfWork.Save(); return(Ok()); }
// Use this for initialization void Start() { idStore = GameObject.Find("PlayerManager").GetComponent <PlayerIDs> (); GSManager = GameObject.Find("GameState").GetComponent <GameStateManager> (); notificationText = GameObject.Find("Notice").GetComponent <NotificationText> (); mapGen = GameObject.Find("TileGenParent").GetComponent <MapGen> (); }
public async Task <ActionResult> PostMessage(MessageNotification messageNotification) { Notification notification = new Notification { ProductId = null, Type = 0, State = 0 }; unitOfWork.Notifications.Add(notification); await unitOfWork.Save(); NotificationText notificationText = new NotificationText { CustomerId = User.FindFirst(ClaimTypes.NameIdentifier) != null?User.FindFirst(ClaimTypes.NameIdentifier).Value : null, NotificationId = notification.Id, TimeStamp = DateTime.Now, Type = 0, Text = messageNotification.Message, Email = messageNotification.Email, Name = messageNotification.Name }; unitOfWork.NotificationText.Add(notificationText); await unitOfWork.Save(); return(Ok()); }
private void OnDestroy() { if (s_instance == this) { s_instance = null; } }
// Use this for initialization void Start () { //body = GetComponent<Rigidbody2D> (); transform.parent = null; // detach the egg from the room prefab // if (isServer) { // NetworkServer.Spawn (this.gameObject); // } notificationText = GameObject.Find ("Notice").GetComponent<NotificationText> (); }
void Awake() { Player.instance = this; StateMachine.Reset(); onLevelLoad += () => { NotificationText.Initialize(); }; }
private void Awake() { if (s_instance != null) { Debug.LogError("NotificationText already exists."); } s_instance = this; }
// Use this for initialization void Start() { //body = GetComponent<Rigidbody2D> (); transform.parent = null; // detach the egg from the room prefab // if (isServer) { // NetworkServer.Spawn (this.gameObject); // } notificationText = GameObject.Find("Notice").GetComponent <NotificationText> (); }
public Notification getNotification(bool generateHaveToAct) { int sourceIndex = random.Next(0, sourcesNumber); bool isSilent = random.Next(0, 2) == 0; if (generateHaveToAct) { sourceIndex = mapNameToIndex(); isSilent = false; } string id = Guid.NewGuid().ToString(); NotificationSource notificationSource = (NotificationSource)Enum.GetValues(typeof(NotificationSource)).GetValue(sourceIndex); string sourceName = EnumDescription.getDescription(notificationSource); NotificationImage notificationImage = (NotificationImage)Enum.GetValues(typeof(NotificationImage)).GetValue(sourceIndex); string sourceImage = EnumDescription.getDescription(notificationImage); NotificationColor notificationColor = (NotificationColor)Enum.GetValues(typeof(NotificationColor)).GetValue(sourceIndex); Color sourceColor = EnumDescription.getColor(EnumDescription.getDescription(notificationColor)); Array values = Enum.GetValues(typeof(NotificationAuthor)); int authorIndex = random.Next(values.Length); if (generateHaveToAct) { authorIndex = mapAuthorToIndex(); } NotificationAuthor notificationAuthor = (NotificationAuthor)values.GetValue(authorIndex); string author = EnumDescription.getDescription(notificationAuthor); values = Enum.GetValues(typeof(NotificationIcon)); NotificationIcon notificationIcon = (NotificationIcon)values.GetValue(authorIndex); string icon = EnumDescription.getDescription(notificationIcon); string text; if (sourceIndex == 2 || sourceIndex == 3) // post or youtube { values = Enum.GetValues(typeof(NotificationHeader)); NotificationHeader notificationHeader = (NotificationHeader)values.GetValue(random.Next(values.Length)); text = EnumDescription.getDescription(notificationHeader); } else // messengers { values = Enum.GetValues(typeof(NotificationText)); NotificationText notificationText = (NotificationText)values.GetValue(random.Next(values.Length)); text = EnumDescription.getDescription(notificationText); } if (isSilent) { sourceColor = EnumDescription.getColor(EnumDescription.getDescription(NotificationColor.Silent)); sourceImage = "_silent_"; } long timestamp = DateTime.Now.Ticks; Notification notification = new Notification(id, sourceImage, sourceName, author, icon, text, timestamp, isSilent, sourceColor, generateHaveToAct); Debug.Log(string.Format("Notification which is {0} and has the following data: {1} was created", generateHaveToAct ? "correct" : "incorrect", notification)); return(notification); }
public void fireAction() { if (StateMachine.Instance.State == GameState.FindBox00 || !StateMachine.Instance.State2_BoxFound) { NotificationText.SimpleScreenText("(Ich sollte den Keller nicht ohne Kiste verlassen)"); } else { NotificationText.SimpleScreenText("(Die Tür ist verschraubt, ich muss sie irgendwie öffnen)"); } }
public async Task <ActionResult> UpdateNote(UpdatedNotificationNotes updatedNotificationNotes) { NotificationText updatedNote = await unitOfWork.NotificationText.Get(x => x.NotificationId == updatedNotificationNotes.NotificationId && x.Type == 1); updatedNote.Text = updatedNotificationNotes.NotificationNote; unitOfWork.NotificationText.Update(updatedNote); await unitOfWork.Save(); return(Ok()); }
public async Task <ActionResult> NewNote(UpdatedNotificationNotes updatedNotificationNotes) { NotificationText newNote = new NotificationText { CustomerId = "FF48C7E8FD", NotificationId = updatedNotificationNotes.NotificationId, TimeStamp = DateTime.Now, Text = updatedNotificationNotes.NotificationNote, Type = 1 }; unitOfWork.NotificationText.Add(newNote); await unitOfWork.Save(); return(Ok()); }
internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text) { NotificationError ret; IntPtr ptr; ret = GetTextReferenceType(handle, type, out ptr); if (ptr == IntPtr.Zero) { text = null; } else { text = Marshal.PtrToStringAnsi(ptr); } return(ret); }
internal static ErrorCode GetText(NotificationSafeHandle handle, NotificationText type, out string text) { ErrorCode err; IntPtr ptr; err = GetTextReferenceType(handle, type, out ptr); if (ptr == IntPtr.Zero) { text = null; } else { text = Marshal.PtrToStringAnsi(ptr); } return(err); }
// Use this for initialization void Start() { deathListeners = new List <DeathListener> (); screenAction = GameObject.Find("Screen").GetComponent <ScreenAction> (); playerSprite = GetComponent <SpriteRenderer> (); playerControl = GetComponent <PlayerControl> (); // playerAnimator = GetComponent<Animator> (); foreach (Transform child in this.gameObject.transform) { if (child.name == "Ghost") { ghosty = child.gameObject; } } if (isLocalPlayer) { hearts = new Image[maxHealth]; // panel = GameObject.Find ("Canvas").transform.FindChild ("Player 0"); for (int i = 0; i < maxHealth; i++) { hearts [i] = GameObject.Find("Heart" + (i + 1)).GetComponent <Image> (); } // playerAnimator = GetComponent<Animator> (); // playerSprite = GetComponent<SpriteRenderer> (); // foreach (Transform child in this.gameObject.transform) { // if (child.name == "Ghost") { // ghosty = child.gameObject; // } // } } else { // Need to actually use the // panel = GameObject.Find ("Canvas").transform.FindChild ("Player 0"); return; } // healthBarBackground = panel.FindChild ("Health Background").GetComponent<RectTransform> (); // healthBar = healthBarBackground.FindChild ("Health Foreground").GetComponent<RectTransform> (); notificationText = GameObject.Find("Notice").GetComponent <NotificationText> (); }
private async Task ShowOneNotification(string text) { this.IsVisible = true; NotificationText.Text = text; await Task.WhenAll( NotificationArea.TranslateTo(0, 0, 333, Easing.CubicOut), NotificationText.TranslateTo(0, 0, 500, Easing.CubicOut) ); await Task.Delay(2833); const uint endAnimMs = 500; var endAnimation = new Animation { { 0, 1, new Animation(t => { NotificationText.TranslationX = t; }, 0, _textOffset, Easing.CubicIn, () => NotificationText.TranslationX = -_textOffset) }, { 0.6, 1, new Animation(a => { NotificationArea.TranslationY = a; }, 0, _controlHeight, Easing.CubicIn) } }; endAnimation.Commit(this, "NotifierClose", 16, endAnimMs); await Task.Delay((int)endAnimMs + 32); // Plus an extra two ticks to make sure the onFinish callbacks have time to run. this.IsVisible = false; }
public static void IssueNotification(Players.Player player, string message) { if (!NotificationText.TryGetValue(player, out var notifications)) { notifications = new string[3] { string.Empty, string.Empty, string.Empty }; NotificationText[player] = notifications; } notifications[2] = notifications[1]; notifications[1] = notifications[0]; notifications[0] = message; for (int i = 0; i < notifications.Length; i++) { UIManager.AddorUpdateUILabel("Notification" + i, colonyshared.NetworkUI.UIGeneration.UIElementDisplayType.Global, notifications[i], NotificationSpots[i], colonyshared.NetworkUI.AnchorPresets.MiddleLeft, NotificationWidth, player, 17, colonyshared.NetworkUI.UIGeneration.FontType.Norse, "#e9fce3"); } }
// Use this for initialization void Awake() { //Find the border myBorder = GameObject.Find("Border").transform; //Get the masters collectorMaster = GameObject.Find("Collector").transform; objectsMaster = collectorMaster.Find("Objects Master").transform; alliesMaster = collectorMaster.Find("Allies Master").transform; collectiblesMaster = collectorMaster.Find("Collectibles Master").transform; objectsMasterScript = objectsMaster.GetComponent <Collector>(); alliesMasterScript = alliesMaster.GetComponent <Collector>(); collectiblesMasterScript = collectiblesMaster.GetComponent <Collector>(); notificationText = GameObject.Find("Notification Text").GetComponent <NotificationText>(); introOutroAnim = GameObject.Find("Intro Outro").GetComponent <Animator>(); mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>(); xScreen = GlobalState.GetCameraXBound(mainCamera); yScreen = GlobalState.GetCameraYBound(mainCamera); if (myBorder != null) { borderCollider = myBorder.GetComponent <BoxCollider2D>(); if (borderCollider != null) { //Adjust the collider size as 1.5 size of the screen size (* 2 because size = 2 * xScreen) borderCollider.size = new Vector2(xScreen.y * 1.7f * 2, yScreen.y * 1.3f * 2); xBoundary.x = myBorder.transform.position.x - borderCollider.size.x / 2 + 1; xBoundary.y = myBorder.transform.position.x + borderCollider.size.x / 2 - 1; yBoundary.x = myBorder.transform.position.y - borderCollider.size.y / 2 + 1; yBoundary.y = myBorder.transform.position.y + borderCollider.size.y / 2 - 1; } } }
// Use this for initialization void Start() { noticeText = GameObject.Find("Notice").GetComponent <NotificationText> (); }
public void fireAction() { NotificationText.SimpleScreenText(errorMessage); }
// Use this for initialization void Start() { coinCol = GetComponent <CoinCollector> (); control = GetComponent <PlayerControl> (); shopText = GameObject.Find("Notice").GetComponent <NotificationText> (); }
// Use this for initialization void Start () { coinCol = GetComponent<CoinCollector> (); control = GetComponent<PlayerControl> (); shopText = GameObject.Find ("Notice").GetComponent<NotificationText> (); }
internal static extern NotificationError SetText(NotificationSafeHandle handle, NotificationText type, string text, string key, int args);
internal static extern NotificationError GetTextReferenceType(NotificationSafeHandle handle, NotificationText type, out IntPtr text);
// Use this for initialization void Start () { noticeText = GameObject.Find ("Notice").GetComponent<NotificationText> (); }
// Use this for initialization void Start () { idStore = GameObject.Find ("PlayerManager").GetComponent<PlayerIDs> (); GSManager = GameObject.Find ("GameState").GetComponent<GameStateManager> (); notificationText = GameObject.Find ("Notice").GetComponent<NotificationText> (); mapGen = GameObject.Find ("TileGenParent").GetComponent<MapGen> (); }