Beispiel #1
0
    public void Land(GameObject starGO)
    {
        Landed = true;

        StarMovement prevStarMovement = CurrentStar.GetComponent <StarMovement>();

        if (prevStarMovement != null)
        {
            prevStarMovement.Stopped = false;
        }

        CurrentStar = starGO.transform;
        transform.SetParent(CurrentStar);
        transform.localPosition = Vector3.zero;
        Star star = CurrentStar.GetComponent <Star>();

        if (star != null)
        {
            star.ReceiveLink();
            _collectedStars.AddStar(star);
            star.GetComponent <StarMovement>().Stopped = true;
        }

        _linker.EndActiveLink();
    }
Beispiel #2
0
        public Boolean AddCurrentStar(CurrentStar currentSatr)
        {
            String sql = @"INSERT INTO [current_star]([current_id], [user_id], [star_date])
                          VALUES(@current_id, @user_id, @star_date)";

            String query = @"SELECT COUNT([id]) 
                             FROM [current_star] 
                             WHERE [current_id] = @current_id 
                               AND [user_id] = @user_id";

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@current_id", currentSatr.CurrentId),
                new SqlParameter("@user_id", currentSatr.UserId),
                new SqlParameter("@star_date", currentSatr.StarDate)
            };

            Int32 line = -1;

            if ((Int32)connector.Execute("scalar", query, parameters) == 0)
            {
                line = (Int32)connector.Execute("non", sql, parameters);
            }

            return(line <= 0 ? false : true);
        }
        public void StarPresentationCutscene(CurrentStar star)
        {
            ConfigService configService = new ConfigService();

            configService.GetConfig(this, (config) => {
                string textToShow = string.Format(starPresentationCutsceneText, star.starName, star.starProperty, config.wishesNeeded - star.wishesReceived);
                textController.ShowText(textToShow, onComplete: ConfigureYesOrNoButtons);
            });
        }
Beispiel #4
0
        /// <summary>
        /// Updates this StarSystem for the new time.
        /// </summary>
        /// <param name="deltaSeconds">Change in seconds since last update.</param>
        public void Update(int deltaSeconds)
        {
            // Update the position of all planets. This should probably be in something like the construction tick in Aurora.
            foreach (Star CurrentStar in Stars)
            {
                CurrentStar.UpdatePosition(deltaSeconds);

                // Since the star moved, update the JumpPoint position.
                foreach (JumpPoint CurrentJumpPoint in JumpPoints)
                {
                    CurrentJumpPoint.UpdatePosition();
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Updates this StarSystem for the new time.
        /// </summary>
        /// <param name="deltaSeconds">Change in seconds since last update.</param>
        public void Update(int deltaSeconds)
        {
            // Update the position of all planets. This should probably be in something like the construction tick in Aurora.
            foreach (Star CurrentStar in Stars)
            {
                // The system primary will cause a divide by zero error currently as it has no orbit.
                if (CurrentStar != Stars[0])
                {
                    CurrentStar.UpdatePosition(deltaSeconds);

                    // Since the star moved, update the JumpPoint position.
                    foreach (JumpPoint CurrentJumpPoint in JumpPoints)
                    {
                        CurrentJumpPoint.UpdatePosition();
                    }
                }

                foreach (Planet CurrentPlanet in CurrentStar.Planets)
                {
                    CurrentPlanet.UpdatePosition(deltaSeconds);
                }
            }
        }
Beispiel #6
0
        // 收藏动态
        protected void StarBtn_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            try
            {
                if (!IsSignIn())
                {
                    Response.Redirect(URL_SIGNIN);
                    return;
                }

                Int64 userId    = GetUserId();
                Int64 currentId = GetCurrentId();

                if (userId != 0 || currentId != 0)
                {
                    CurrentStar currentStar = new CurrentStar()
                    {
                        CurrentId = currentId,
                        UserId    = userId,
                        StarDate  = DateTime.Now.ToLocalTime()
                    };

                    Boolean isOk = CurrentStarService.AddCurrentStar(currentStar);

                    if (isOk)
                    {
                        btn.Text = "收藏成功";
                    }
                }
            }
            catch (Exception ex)
            {
                PromptInfo.Text = ex.Message;
            }
        }
Beispiel #7
0
 /// <summary>
 /// 添加动态收藏
 /// </summary>
 /// <param name="currentSatr"></param>
 /// <returns></returns>
 public static Boolean AddCurrentStar(CurrentStar currentSatr)
 {
     return(iDao.AddCurrentStar(currentSatr));
 }