public CharacterMovingCommand(int _PanelSlot) { Type = SharedData.realCommandID; PanelSlot = _PanelSlot; mapGen = MapGenerator.GetMapGenerator(); sa = StartActions.GetStartActions(); }
void Start() { sa = StartActions.GetStartActions(); if (sa == null) { Debug.LogError("EdgeTrigger: Startaction is null!"); } highData = transform.GetComponent <HeightData>(); }
// Use this for initialization void Start() { trapAnim = transform.GetComponent<Animation>(); sa = StartActions.GetStartActions(); if (sa == null) { Debug.LogError("SwitchLaser: StartActions is null!"); } trapHighData = transform.GetComponent<TrapHeightData>(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
/// <summary> /// 设置系统的执行顺序和优先级,这部分操作考虑交给中间层来做 /// </summary> public static void SetSystemUpdate() { foreach (DestroySystem system in systemDict.Values) { //在这里按照顺序调用start,start可为空,并按顺序将系统加入update,默认是加入的,如果不要则在初始化的时候将needupdate改成false StartActions.Add(system.Start); if (system.needUpdate) { UpdateActions.Add(system.Update); } } }
public FV(int _PanelSlot, int fvNumber) { Type = SharedData.realCommandID; PanelSlot = _PanelSlot; FvNumber = fvNumber; if (fvNumber == 1) { Img = Resources.Load <Sprite>(SharedData.fv1Icon); } else { Img = Resources.Load <Sprite>(SharedData.fv2Icon); } sa = StartActions.GetStartActions(); }
public string GenerateStartActionsFromBase(StartActions baseStartActions) { baseStartActions.BookInfo = new StartActions.BookInformation { Asin = curBook.Asin, ContentType = "EBOK", Timestamp = Functions.UnixTimestampMilliseconds(), RefTagSuffix = "AAAgAAA", ImageUrl = curBook.ImageUrl, Erl = -1 }; if (!string.IsNullOrEmpty(curBook.Series?.Position)) { baseStartActions.Data.SeriesPosition = new StartActions.SeriesPosition { PositionInSeries = Convert.ToInt32(double.Parse(curBook.Series.Position)), TotalInSeries = curBook.Series.Total, SeriesName = curBook.Series.Name }; } baseStartActions.Data.FollowSubscriptions = new StartActions.AuthorSubscriptions { Subscriptions = new [] { new Subscription { Asin = curBook.AuthorAsin, Name = curBook.Author, ImageUrl = curBook.AuthorImageUrl } } }; baseStartActions.Data.AuthorSubscriptions = baseStartActions.Data.FollowSubscriptions; baseStartActions.Data.PopularHighlightsText.LocalizedText.Replace("%NUMPASSAGES%", $"{curBook.notableClips?.Count ?? 0}"); baseStartActions.Data.PopularHighlightsText.LocalizedText.Replace("%NUMHIGHLIGHTS%", $"{curBook.notableClips?.Sum(c => c.Likes) ?? 0}"); baseStartActions.Data.GrokShelfInfo.Asin = curBook.Asin; baseStartActions.Data.BookDescription = Extensions.BookInfoToBook(curBook, true); baseStartActions.Data.CurrentBook = baseStartActions.Data.BookDescription; baseStartActions.Data.AuthorBios = new AuthorBios { Authors = new [] { new Author { // TODO: Check mismatched fields from curbook and authorprofile Asin = _authorProfile.Asin, Name = curBook.Author, Bio = _authorProfile.Biography, ImageUrl = _authorProfile.ImageUrl } } }; baseStartActions.Data.AuthorRecs = new Recs { Class = "recommendationList", Recommendations = _authorProfile.OtherBooks.Select(bk => Extensions.BookInfoToBook(bk, false)).ToArray() }; baseStartActions.Data.ReadingTime.Hours = curBook.ReadingHours; baseStartActions.Data.ReadingTime.Minutes = curBook.ReadingMinutes; baseStartActions.Data.ReadingTime.FormattedTime.Replace("%HOURS%", curBook.ReadingHours.ToString()); baseStartActions.Data.ReadingTime.FormattedTime.Replace("%MINUTES%", curBook.ReadingMinutes.ToString()); baseStartActions.Data.PreviousBookInTheSeries = Extensions.BookInfoToBook(curBook.Series?.Previous, true); baseStartActions.Data.ReadingPages.PagesInBook = curBook.PagesInBook; try { return(Functions.ExpandUnicode(JsonConvert.SerializeObject(baseStartActions))); } catch (Exception ex) { _logger.Log("An error occurred creating the StartActions template: " + ex.Message + "\r\n" + ex.StackTrace); } return(null); }