/// <summary> /// Awake is called before start /// </summary> private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } currentObjects = new List <GameObject>(); }
public void StartLog(TextFeed textFeed) { nameText.text = textFeed.name; consoleLog.Clear(); foreach (string consoleTextFeed in textFeed.consoleTextFeed) { consoleLog.Enqueue(consoleTextFeed); } DisplayNextLog(); }
public IHttpActionResult CreateFeed(string Text, string imageurl, string videourl) { FeedRepository db = new FeedRepository(); UserRepository userRep = new UserRepository(); User user = userRep.GetUserByEmail(User.Identity.Name); if (Text == null || Text == "") { throw new Exception("Text was empty"); } if (imageurl == null && videourl == null) { TextFeed textfeed = new TextFeed(); textfeed.Id = Guid.NewGuid(); textfeed.Text = Text; textfeed.CreatedAt = DateTime.Now; textfeed.CreatorId = user.Id; db.CreateTextFeed(textfeed); return(Ok()); } if (imageurl != null) { ImageFeed imageFeed = new ImageFeed(); imageFeed.Id = Guid.NewGuid(); imageFeed.Text = Text; imageFeed.CreatedAt = DateTime.Now; imageFeed.CreatorId = user.Id; imageFeed.ImageUrl = imageurl; db.CreateImageFeed(imageFeed); return(Ok()); } if (videourl != null) { VideoFeed videoFeed = new VideoFeed(); videoFeed.Id = Guid.NewGuid(); videoFeed.DescriptionText = Text; videoFeed.CreatedAt = DateTime.Now; videoFeed.CreatorId = user.Id; videoFeed.VideoUrl = videourl; db.CreateVideoFeed(videoFeed); return(Ok()); } throw new Exception("No feed was created."); }
public IHttpActionResult UpdateRespect(Guid FeedId, bool Upvote) { FeedRepository db = new FeedRepository(); TextFeed textFeed = db.GetTextFeed(FeedId); ImageFeed ImageFeed = db.GetImageFeed(FeedId); VideoFeed VideoFeed = db.GetVideoFeed(FeedId); Feed feed = null; if (textFeed != null) { feed = textFeed; } if (ImageFeed != null) { feed = ImageFeed; } if (VideoFeed != null) { feed = VideoFeed; } if (Upvote) { feed.Respect++; } else { feed.Respect--; } if (textFeed != null) { db.UpdateTextFeed((TextFeed)feed); } if (ImageFeed != null) { db.UpdateImageFeed((ImageFeed)feed); } if (VideoFeed != null) { db.UpdateVideoFeed((VideoFeed)feed); } return(Ok()); }
public void CreateTextFeed(TextFeed feed) { db.FeedTexts.Add(feed); db.SaveChanges(); }
public void UpdateTextFeed(TextFeed feed) { db.FeedTexts.Attach(feed); db.Entry(feed).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
private void AddDataToTextFeed() { TextFeed.AppendText(Environment.NewLine + " >> " + _readData.Replace("\0", string.Empty)); }