Exemplo n.º 1
0
    public void Finish(FinishType type = FinishType.Dead)
    {
        if (isFinished)
        {
            return;
        }
        isFinished = true;

        Pause();

        PlayerController player = PlayerController.instance;
        GameObject       finish = GameObject.Instantiate(finishPrefabs[(int)type]);

        string[] messages = null;

        switch (type)
        {
        case FinishType.Dead:
            if (player.Hp <= 0)
            {
                EndingLibraryManager.instance.Unlock(EndingLibraryManager.Type.Hurt);
            }
            messages = Localization.GetStringArray("death");
            MessageManager.instance.onConfirm += OnDeadFinish;
            break;


        case FinishType.Rebirth:
            EndingLibraryManager.instance.Unlock(EndingLibraryManager.Type.Rebirth);
            messages = Localization.GetStringArray("rebirth");
            MessageManager.instance.onConfirm += OnRebirthFinish;
            break;


        case FinishType.RankUp:
            messages = Localization.GetStringArray("rankup");
            MessageManager.instance.onConfirm += OnRankUpFinish;
            break;


        default:
            break;
        }

        MessageManager.instance.PushMessage(messages);
        MessageManager.instance.onConfirm += () =>
        {
            if (finish)
            {
                GameObject.Destroy(finish);
            }
        };

        FadeManager.instance.Fade(Color.clear, new Color(0, 0, 0, .7f), 1, () =>
        {
            MessageManager.instance.Open();
        });

        UM_AdManager.instance.StartInterstitialAd();
    }
Exemplo n.º 2
0
    public static IEnumerator TransitionColor(GameObject[] objs, float duration, FinishType finish, Color initial, Color final)
    {
        float t;
        float elapsed = 0f;

        while (elapsed <= duration)
        {
            t = SmoothLerp(elapsed / duration);
            Color c = Color.Lerp(initial, final, t);
            foreach (GameObject obj in objs)
            {
                SetColor(c, obj, null);
            }
            yield return(new WaitForEndOfFrame());

            elapsed += Time.deltaTime;
        }
        foreach (GameObject obj in objs)
        {
            SetColor(final, obj, null);
        }

        yield return(FinishAction(objs, finish));

        yield return(null);
    }
Exemplo n.º 3
0
    public static IEnumerator TransitionAlpha(GameObject[] objs, float duration, FinishType finish, float initial, float final)
    {
        Color32 startColor = new Color(1f, 1f, 1f, initial);
        Color32 destColor  = new Color(1f, 1f, 1f, final);

        yield return(TransitionColor(objs, duration, finish, startColor, destColor));
    }
Exemplo n.º 4
0
 public static IEnumerator FinishAction(GameObject[] objs, FinishType finish)
 {
     switch (finish)
     {
         case FinishType.None:
             yield return null;
             break;
         case FinishType.Activate:
             foreach (GameObject obj in objs)
             {
                 obj.SetActive(true);
             }
             yield return null;
             break;
         case FinishType.Deactivate:
             foreach (GameObject obj in objs)
             {
                 obj.SetActive(false);
             }
             yield return null;
             break;
         case FinishType.Destroy:
             foreach (GameObject obj in objs)
             {
                 GameObject.Destroy(obj);
             }
             yield return null;
             break;
         default:
             yield return null;
             break;
     }
 }
Exemplo n.º 5
0
    public static IEnumerator TransitionAlpha(GameObject[] objs, float duration, float initial, float final,
                                              FinishType finish = FinishType.None, bool enableSr = false, GameObject exclude = null)
    {
        float t;
        float elapsed = 0f;

        while (elapsed <= duration)
        {
            t = SmoothLerp(elapsed / duration);
            foreach (GameObject obj in objs)
            {
                SetAlpha(initial + t * (final - initial), obj, exclude: exclude, enableSr: enableSr);
            }
            yield return(new WaitForEndOfFrame());

            elapsed += Time.deltaTime;
        }
        foreach (GameObject obj in objs)
        {
            SetAlpha(final, obj);
        }

        yield return(FinishAction(objs, finish));

        yield return(null);
    }
Exemplo n.º 6
0
        public void NotifyPlayerWin(PlayerType type)
        {
            StopBattle();
            FinishType finish = type == PlayerType.PlayerOne ? FinishType.PlayerOneWin : FinishType.PlayerTwoWin;

            lastFinishType = finish;
            StartCoroutine(GameManager.Instance.GetCanvasSystem.InfoTextsSystem.ShowFinishText(finish, true));
        }
Exemplo n.º 7
0
 public void SetupBattle()
 {
     lastFinishType = FinishType.None;
     GameManager.Instance.GetCanvasSystem.ActivatePlayerUIs(false);
     GameManager.Instance.GetPlayer(PlayerType.PlayerOne).Init(GameManager.Instance.PlayerHPAmount);
     GameManager.Instance.GetPlayer(PlayerType.PlayerTwo).Init(GameManager.Instance.PlayerHPAmount);
     GameManager.Instance.ActivatePlayers(true);
     RunCountDown();
 }
Exemplo n.º 8
0
        public void EndMainRowStatus(WorkflowDbContext context, FinishType finishType)
        {
            string sql = "UPDATE {0} SET  " +
                         " {2}  " +
                         " {1}_WF_STATUS = @WF_STATUS , " +
                         " {1}_WF_IS_END = @WF_IS_END , " +
                         " {1}_WF_TIME = @WF_TIME " +
                         " WHERE FID = @FID";
            string statusSql              = Prefix + "_STEP_NAME = @STEP_NAME ,";
            List <SqlParameter> list      = new List <SqlParameter>();
            SqlParameter        statusPar = new SqlParameter("@WF_IS_END", (int)finishType);
            SqlParameter        fidParm   = new SqlParameter("@FID", FID)
            {
                DbType = DbType.String
            };
            SqlParameter wftimeParm = new SqlParameter("@WF_TIME", context.Now)
            {
                DbType = DbType.DateTime
            };

            list.Add(statusPar);
            list.Add(fidParm);
            list.Add(wftimeParm);
            string sql0 = string.Format(sql, MainTableName, Prefix, "");

            switch (finishType)
            {
            case FinishType.ReturnBegin:
                break;

            case FinishType.Abort:
                //fMainRow[prefix + "WF_STATUS"] = "终止";
                list.Add(new SqlParameter("@WF_STATUS", "终止"));
                //fMainRow[prefix + "STEP_NAME"] = "__abort";
                list.Add(new SqlParameter("@STEP_NAME", "__abort"));
                sql0 = string.Format(sql, MainTableName, Prefix, statusSql);
                break;

            case FinishType.OverTryTimes:
                //fMainRow[prefix + "WF_STATUS"] = "重试错误终止";
                list.Add(new SqlParameter("@WF_STATUS", "重试错误终止"));
                break;

            case FinishType.Error:
                // fMainRow[prefix + "WF_STATUS"] = "错误终止";
                list.Add(new SqlParameter("@WF_STATUS", "错误终止"));
                break;

            default:
                list.Add(new SqlParameter("@WF_STATUS", "结束"));
                break;
            }
            context.RegisterSqlCommand(sql0, list.ToArray());
        }
Exemplo n.º 9
0
 public void NotifyDraw()
 {
     StopBattle();
     if (!isDrawNotifying)
     {
         isDrawNotifying = true;
         lastFinishType  = FinishType.Draw;
         StartCoroutine(GameManager.Instance.GetCanvasSystem.InfoTextsSystem.ShowFinishText(FinishType.Draw));
     }
     else
     {
         return;
     }
 }
Exemplo n.º 10
0
 public void NotifyTimeOut()
 {
     StopBattle();
     lastFinishType = FinishType.TimeOut;
     if (GameManager.Instance.GetPlayer(PlayerType.PlayerOne).HP > GameManager.Instance.GetPlayer(PlayerType.PlayerTwo).HP)
     {
         NotifyPlayerDie(PlayerType.PlayerTwo);
     }
     else if (GameManager.Instance.GetPlayer(PlayerType.PlayerTwo).HP > GameManager.Instance.GetPlayer(PlayerType.PlayerOne).HP)
     {
         NotifyPlayerDie(PlayerType.PlayerOne);
     }
     StartCoroutine(GameManager.Instance.GetCanvasSystem.InfoTextsSystem.ShowFinishText(FinishType.TimeOut));
 }
Exemplo n.º 11
0
    public void RaceEnd(FinishType finishState)
    {
        if (!isGamePlaying)
        {
            return;
        }

        switch (finishState)
        {
        case FinishType.Finish:
            Spots_Count();

            float personalTrackRecord = DesignConstStorage.PersonalTrackRecord[Game_Manager.Instance.track_manager.Current_Track_Name];
            if (personalTrackRecord > Game_Manager.Instance.record_manager.Record_Time)
            {
                Game_Manager.Instance.SetTimeRecord(Game_Manager.Instance.track_manager.Current_Track_Name, Game_Manager.Instance.record_manager.Record_Time);
                Debug.LogWarning(Game_Manager.Instance.track_manager.Current_Track_Name);
            }
            break;

        case FinishType.FalseStart:
            Game_Manager.Instance.ui_manager.Fail_Racing_Reason_Text.text = MyLocalization.Exchange("falsestart");
            Tip_Text.text = MyLocalization.Exchange("tip_1");
            break;

        case FinishType.OutOfControl:
            Game_Manager.Instance.ui_manager.Fail_Racing_Reason_Text.text = MyLocalization.Exchange("speeding");
            Tip_Text.text = MyLocalization.Exchange("tip_2");
            break;

        case FinishType.PassThrough:
            Game_Manager.Instance.ui_manager.Fail_Racing_Reason_Text.text = MyLocalization.Exchange("brakefailure");
            Tip_Text.text = MyLocalization.Exchange("tip_3");
            break;
        }

        isGamePlaying = false;

        //시간 계산.
        //시간 기반으로 점수 구해서 할까 아니면 그냥 시간+@를 할까?
        //게임 보상도 넣어야..

        //팝업 결과창
        //확인 하면 UI로

        Game_Manager.Instance.EndOfRace(finishState == FinishType.Finish);
    }
Exemplo n.º 12
0
 public Vehicle(Vehicle copy)
 {
     Index                  = copy.Index;
     ID                     = copy.ID;
     ParentID               = copy.ParentID;
     WheelType              = copy.WheelType;
     CarName                = copy.CarName;
     CarBrand               = copy.CarBrand;
     DamageLimit            = copy.DamageLimit;
     Flags                  = copy.Flags;
     BoostLength            = copy.BoostLength;
     VehicleRank            = copy.VehicleRank;
     BoostCapacity          = copy.BoostCapacity;
     DisplayStrength        = copy.DisplayStrength;
     padding0               = copy.padding0;
     AttribSysCollectionKey = copy.AttribSysCollectionKey;
     ExhaustName            = copy.ExhaustName;
     ExhaustID              = copy.ExhaustID;
     EngineID               = copy.EngineID;
     EngineName             = copy.EngineName;
     ClassUnlockStreamHash  = copy.ClassUnlockStreamHash;
     padding1               = copy.padding1;
     CarShutdownStreamID    = copy.CarShutdownStreamID;
     CarReleasedStreamID    = copy.CarReleasedStreamID;
     AIMusicHash            = copy.AIMusicHash;
     AIExhaustIndex         = copy.AIExhaustIndex;
     AIExhaustIndex2        = copy.AIExhaustIndex2;
     AIExhaustIndex3        = copy.AIExhaustIndex3;
     padding2               = copy.padding2;
     Unknown                = copy.Unknown;
     Category               = copy.Category;
     VehicleAndBoostType    = copy.VehicleAndBoostType;
     VehicleType            = copy.VehicleType;
     BoostType              = copy.BoostType;
     FinishType             = copy.FinishType;
     MaxSpeedNoBoost        = copy.MaxSpeedNoBoost;
     MaxSpeedBoost          = copy.MaxSpeedBoost;
     Color                  = copy.Color;
     ColorType              = copy.ColorType;
     DisplaySpeed           = copy.DisplaySpeed;
     DisplayBoost           = copy.DisplayBoost;
     padding3               = copy.padding3;
 }
Exemplo n.º 13
0
    public static IEnumerator FinishAction(GameObject[] objs, FinishType finish)
    {
        switch (finish)
        {
        case FinishType.None:
            yield return(null);

            break;

        case FinishType.Activate:
            foreach (GameObject obj in objs)
            {
                obj.SetActive(true);
            }
            yield return(null);

            break;

        case FinishType.Deactivate:
            foreach (GameObject obj in objs)
            {
                obj.SetActive(false);
            }
            yield return(null);

            break;

        case FinishType.Destroy:
            foreach (GameObject obj in objs)
            {
                GameObject.Destroy(obj);
            }
            yield return(null);

            break;

        default:
            yield return(null);

            break;
        }
    }
Exemplo n.º 14
0
    public static IEnumerator Resize(Transform t, Vector3 destScale, float duration, FinishType finish = FinishType.None)
    {
        float   elapsed    = 0f;
        Vector3 startScale = t.localScale;

        do
        {
            t.localScale = Vector3.Lerp(startScale, destScale, SmoothLerp(elapsed / duration));
            yield return(new WaitForEndOfFrame());

            if (t.gameObject == null)
            {
                yield break;
            }
            elapsed += Time.deltaTime;
        } while (elapsed <= duration);
        t.localScale = destScale;

        FinishAction(new GameObject[] { t.gameObject }, finish);
    }
Exemplo n.º 15
0
        public void NotifyPlayerDie(PlayerType type)
        {
            StopBattle();
            switch (type)
            {
            case PlayerType.PlayerOne: {
                GameManager.Instance.GetPlayer(PlayerType.PlayerTwo).AddWin();
                lastFinishType = FinishType.PlayerTwoWin;
                StartCoroutine(GameManager.Instance.GetCanvasSystem.InfoTextsSystem.ShowFinishText(FinishType.PlayerTwoWin));
                break;
            }

            case PlayerType.PlayerTwo:
            {
                GameManager.Instance.GetPlayer(PlayerType.PlayerOne).AddWin();
                lastFinishType = FinishType.PlayerOneWin;
                StartCoroutine(GameManager.Instance.GetCanvasSystem.InfoTextsSystem.ShowFinishText(FinishType.PlayerOneWin));
                break;
            }
            }
        }
Exemplo n.º 16
0
        public IEnumerator ShowFinishText(FinishType finishType, bool isGameOver = false)
        {
            switch (finishType)
            {
            case FinishType.PlayerOneWin: finalText.text = "Player One WINS"; break;

            case FinishType.PlayerTwoWin: finalText.text = "Player Two WINS"; break;

            case FinishType.Draw:
                finalText.text = "DRAW!";
                GameManager.Instance.GetFightManager.isDrawNotifying = false;
                break;

            case FinishType.TimeOut: finalText.text = "TIME OUT!"; break;
            }
            finalText.gameObject.SetActive(true);
            yield return(new WaitForSeconds(2));

            finalText.gameObject.SetActive(false);
            GameManager.Instance.GetFightManager.HandleRoundFinish(isGameOver);
        }
Exemplo n.º 17
0
 public void HandleRoundFinish(bool isGameOver)
 {
     if (isGameOver)
     {
         lastFinishType = FinishType.GameOver;
         GameManager.Instance.ActivatePlayers(false);
         StopBattle();
         GameManager.Instance.GetPlayer(PlayerType.PlayerOne).ResetWins();
         GameManager.Instance.GetPlayer(PlayerType.PlayerTwo).ResetWins();
         GameManager.Instance.GetCanvasSystem.GetPlayerUI(PlayerType.PlayerOne).ResetRounds();
         GameManager.Instance.GetCanvasSystem.GetPlayerUI(PlayerType.PlayerTwo).ResetRounds();
         GameManager.Instance.GetCanvasSystem.ActivatePlayerUIs(false);
         GameManager.Instance.GetCanvasSystem.GetMainMenu.ShowMenu();
     }
     else
     {
         if (lastFinishType != FinishType.GameOver)
         {
             SetupBattle();
         }
     }
 }
Exemplo n.º 18
0
            public static bool Recognization(RichWall richWall)
            {
                _wall         = richWall.wall;
                _finishType   = richWall.finishType;
                _length       = _wall.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble();
                _level_bottom =
                    _doc.GetElement(_wall.get_Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElementId()) as Level;
                _level_top =
                    _doc.GetElement(_wall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE).AsElementId()) as Level;
                _offset_bottom = _wall.get_Parameter(BuiltInParameter.WALL_BASE_OFFSET).AsDouble();
                _offset_top    = _wall.get_Parameter(BuiltInParameter.WALL_TOP_OFFSET).AsDouble();
                _noConsHeight  = _wall.get_Parameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM).AsDouble();

                _direction = GetWallDirection(_wall);
                if (_direction == Direction.Undefined)
                {
                    _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.SkewWall);
                    return(false);
                }

                return(true);
            }
Exemplo n.º 19
0
 public static IEnumerator FadeOut(GameObject[] objs, float duration, FinishType finish)
 {
     yield return(TransitionAlpha(objs, duration, finish, 1f, 0f));
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="finishType"></param>
 public FinishedEventArgs(FinishType finishType)
 {
     Type = finishType;
 }
Exemplo n.º 21
0
 /// <summary>
 ///     Event triggers whenever the thread is finished by itself or canceled by the user
 /// </summary>
 /// <param name="finishType"></param>
 protected virtual void OnThreadFinished(FinishType finishType)
 {
     ThreadFinished?.Invoke(this, new FinishedEventArgs(finishType));
 }
Exemplo n.º 22
0
        private void ShowCompetitionEndScoreEx(CompetitionType type, CompetitionLevel level, string competitionName)
        {
            mCurrentScore += mMoodScoreBonus;
            int currentMoneyReward = 0x0;
            List <EquestrianCenter.PositionScoring> positionScoringTuning = EquestrianCenter.PositionScoringTuning;

            if (mCompetitionType == CompetitionType.Racing)
            {
                RaceShuffle();
            }
            mCurrentPosition = GetPlaceInRace(type, level, EquestrianCenter.kNumberOfCompetitors, mCurrentScore, out currentMoneyReward);
            Responder.Instance.HudModel.UpdateCompetitionStanding(this);
            FinishType poorFinish = FinishType.PoorFinish;

            if ((mCurrentPosition >= EquestrianCenter.kPositionsForFinishTypes[0x1]) && (mCurrentPosition < EquestrianCenter.kPositionsForFinishTypes[0x0]))
            {
                poorFinish = FinishType.StandardFinish;
            }
            else if (mCurrentPosition == EquestrianCenter.kPositionsForFinishTypes[0x2])
            {
                poorFinish = FinishType.Victory;
            }
            RidingSkill skill = Actor.SimDescription.SkillManager.GetSkill <RidingSkill>(SkillNames.Riding);

            skill.AddPoints(EquestrianCenter.kSkillPointsAdded[0x0]);
            bool flag = type == CompetitionType.CrossCountry;

            if ((flag || (type == CompetitionType.Racing)) && !Horse.BuffManager.HasElement(BuffNames.PetSkillFatigue))
            {
                Horse.SimDescription.SkillManager.GetSkill <Racing>(SkillNames.Racing).AddPoints(EquestrianCenter.kSkillPointsAdded[0x1]);
            }
            if ((flag || (type == CompetitionType.Jumping)) && !Horse.BuffManager.HasElement(BuffNames.PetSkillFatigue))
            {
                Horse.SimDescription.SkillManager.GetSkill <Jumping>(SkillNames.Jumping).AddPoints(EquestrianCenter.kSkillPointsAdded[0x2]);
            }
            if (currentMoneyReward != 0x0)
            {
                if (skill.IsEquestrianChampion())
                {
                    currentMoneyReward = (int)(currentMoneyReward * RidingSkill.EquestrianChampionPrizeMultiplier);
                }
                Actor.ModifyFunds(currentMoneyReward);
                skill.UpdateXpForEarningMoney(currentMoneyReward);
                EventTracker.SendEvent(new JockeyEvent(EventTypeId.kJockeyEvent, Actor, currentMoneyReward));
            }

            string str = Localization.LocalizeString(false, "UI/Caption/HudCompetitionPanel/Place:Position" + mCurrentPosition, new object[0x0]);

            switch (poorFinish)
            {
            case FinishType.PoorFinish:
                if (Actor.IsActiveSim)
                {
                    Audio.StartSound("sting_eques_poor_finish");
                }

                if ((StoryProgression.Main.Skills.MatchesAlertLevel(Actor)) || (StoryProgression.Main.Skills.MatchesAlertLevel(Horse)))
                {
                    Sim.ActiveActor.ShowTNSIfSelectable(TNSNames.EquestrianCenterPoorFinish, null, Actor, new object[] { Horse, Actor, str, competitionName });
                }
                return;

            case FinishType.StandardFinish:
                if (Actor.IsActiveSim)
                {
                    Audio.StartSound("sting_eques_standard_finish");
                }

                if ((StoryProgression.Main.Skills.MatchesAlertLevel(Actor)) || (StoryProgression.Main.Skills.MatchesAlertLevel(Horse)))
                {
                    Sim.ActiveActor.ShowTNSIfSelectable(TNSNames.EquestrianCenterStandardFinish, null, Actor, new object[] { Horse, Actor, str, competitionName });
                }
                return;

            case FinishType.Victory:
                RidingSkill.WonCompetition(Actor.SimDescription, Horse.SimDescription, type, level);
                if (Actor.IsActiveSim)
                {
                    Audio.StartSound("sting_eques_victory_finish");
                }
                if (!Target.mPlayerHasParticipatedAndWon)
                {
                    Target.mPlayerHasParticipatedAndWon = true;
                    EventTracker.SendEvent(new EquestrianCompetitionEvent(EventTypeId.kEquestrianCompetition, Actor.FirstName, Actor.IsFemale, Horse.FirstName, Horse.IsFemale, competitionName));
                }

                if ((StoryProgression.Main.Skills.MatchesAlertLevel(Actor)) || (StoryProgression.Main.Skills.MatchesAlertLevel(Horse)))
                {
                    Sim.ActiveActor.ShowTNSIfSelectable(TNSNames.EquestrianCenterVictory, null, Actor, new object[] { Horse, Actor, competitionName });
                }
                AddCompetitionTrophy(type, level);
                return;
            }
        }
Exemplo n.º 23
0
 public RichWall(Wall wall, FinishType finishType)
 {
     this.wall = wall;
     this.finishType = finishType;
 }
Exemplo n.º 24
0
 public static IEnumerator FadeOut(GameObject[] objs, float duration,
                                   FinishType finish = FinishType.None, bool enableSr = false, GameObject exclude = null)
 {
     yield return(TransitionAlpha(objs, duration, 1f, 0f, finish));
 }
Exemplo n.º 25
0
        protected override bool Execute()
        {
            WorkflowDbContext dbContext = Source as WorkflowDbContext;
            EndStepConfig     config    = Config as EndStepConfig;
            AutoProcessor     processor = null;
            WorkflowContent   content   = WorkflowInstUtil.CreateContent(WorkflowRow);

            if (!string.IsNullOrEmpty(config.PlugRegName))
            {
                try
                {
                    processor         = AtawIocContext.Current.FetchInstance <AutoProcessor>(config.PlugRegName);
                    processor.Config  = config;
                    processor.Source  = Source;
                    processor.Content = content;
                    processor.Execute(WorkflowRow);
                }
                catch (Exception ex)
                {
                    string mesg = string.Format(ObjectUtil.SysCulture,
                                                "程序出现异常,异常信息是:{0}{1}{0}堆栈信息是:{0}{2}",
                                                Environment.NewLine, ex.Message, ex.StackTrace);
                    AtawTrace.WriteFile(LogType.WorkFlowError, mesg);;

                    // AtawTrace.WriteFile();
                    throw new PlugInException(config, config.Error, ex);
                }
            }
            FinishType finishType = FinishType.Normal;

            if (config.EnableModify)
            {
                finishType = FinishType.ModifiedNormal;
            }
            //-----
            ////新增实例历史
            // "WI_ID",
            //"WI_WD_NAME", "WI_CONTENT_XML", "WI_NAME", "WI_CREATE_DATE", "WI_CREATE_USER",
            //"WI_REF_LIST", "WI_IS_TIMEOUT","WI_TIMEOUT_DATE", "WI_NEXT_EXE_DATE", "WI_PRIORITY" ,
            //"WI_STATUS", "WI_ERROR_TYPE","WI_RETRY_TIMES","WI_MAX_RETRY_TIMES","WI_WE_ID",
            //"WI_PARENT_ID","WI_PC_FLAG"
            WF_WORKFLOW_INST_HIS wfi_His = new WF_WORKFLOW_INST_HIS();

            //copy
            wfi_His.WI_ID              = WorkflowRow.WI_ID;
            wfi_His.WI_WD_NAME         = WorkflowRow.WI_WD_NAME;
            wfi_His.WI_CONTENT_XML     = WorkflowRow.WI_CONTENT_XML;
            wfi_His.WI_NAME            = WorkflowRow.WI_NAME;
            wfi_His.WI_CREATE_DATE     = WorkflowRow.WI_CREATE_DATE;
            wfi_His.WI_CREATE_USER     = WorkflowRow.WI_CREATE_USER;
            wfi_His.WI_REF_LIST        = WorkflowRow.WI_REF_LIST;
            wfi_His.WI_IS_TIMEOUT      = WorkflowRow.WI_IS_TIMEOUT;
            wfi_His.WI_TIMEOUT_DATE    = WorkflowRow.WI_TIMEOUT_DATE;
            wfi_His.WI_NEXT_EXE_DATE   = WorkflowRow.WI_NEXT_EXE_DATE;
            wfi_His.WI_PRIORITY        = WorkflowRow.WI_PRIORITY;
            wfi_His.WI_STATUS          = WorkflowRow.WI_STATUS;
            wfi_His.WI_ERROR_TYPE      = WorkflowRow.WI_ERROR_TYPE;
            wfi_His.WI_RETRY_TIMES     = WorkflowRow.WI_RETRY_TIMES;
            wfi_His.WI_MAX_RETRY_TIMES = WorkflowRow.WI_MAX_RETRY_TIMES;
            wfi_His.WI_WE_ID           = WorkflowRow.WI_WE_ID;
            wfi_His.WI_PARENT_ID       = WorkflowRow.WI_PARENT_ID;
            wfi_His.WI_PC_FLAG         = WorkflowRow.WI_PC_FLAG;
            //赋值
            wfi_His.WI_END_DATE  = dbContext.Now;
            wfi_His.WI_END_STATE = (int)finishType;
            if (!string.IsNullOrEmpty(WorkflowRow.WI_PROCESS_ID))
            {
                wfi_His.WI_END_USER = WorkflowRow.WI_PROCESS_ID;
            }
            else
            {
                wfi_His.WI_END_USER = GlobalVariable.UserId.ToString();
            }
            //附加
            dbContext.WF_WORKFLOW_INST_HIS.Add(wfi_His);
            ////copy步骤历史
            string wiId = WorkflowRow.WI_ID;
            List <WF_STEP_INST>     stepList    = dbContext.WF_STEP_INST.Where(a => a.SI_WI_ID == wiId).ToList();
            List <WF_STEP_INST_HIS> stepListHis = new List <WF_STEP_INST_HIS>();

            foreach (var step in stepList)
            {
                //------------
                WF_STEP_INST_HIS his = new WF_STEP_INST_HIS();
                his.SI_WI_ID             = step.SI_WI_ID;
                his.SI_CURRENT_STEP      = step.SI_CURRENT_STEP;
                his.SI_CURRENT_STEP_NAME = step.SI_CURRENT_STEP_NAME;
                his.SI_END_DATE          = step.SI_END_DATE;

                his.SI_FLOW_TYPE        = step.SI_FLOW_TYPE;
                his.SI_ID               = step.SI_ID;
                his.SI_INDEX            = step.SI_INDEX;
                his.SI_IS_TIMEOUT       = step.SI_IS_TIMEOUT;
                his.SI_LAST_MANUAL      = step.SI_LAST_MANUAL;
                his.SI_LAST_MANUAL_NAME = step.SI_LAST_MANUAL_NAME;
                his.SI_LAST_STEP        = step.SI_LAST_STEP;
                his.SI_LAST_STEP_NAME   = step.SI_LAST_STEP_NAME;
                his.SI_NOTE             = step.SI_NOTE;
                his.SI_PRIORITY         = step.SI_PRIORITY;
                his.SI_PROCESS_DATE     = step.SI_PROCESS_DATE;
                his.SI_PROCESS_ID       = step.SI_PROCESS_ID;
                his.SI_RECEIVE_DATE     = step.SI_RECEIVE_DATE;
                his.SI_RECEIVE_ID       = step.SI_RECEIVE_ID;
                his.SI_SEND_DATE        = step.SI_SEND_DATE;
                his.SI_SEND_ID          = step.SI_SEND_ID;
                his.SI_START_DATE       = step.SI_START_DATE;
                his.SI_STATUS           = step.SI_STATUS;
                his.SI_STEP_TYPE        = step.SI_STEP_TYPE;
                his.SI_TIME_SPAN        = step.SI_TIME_SPAN;
                his.SI_TIMEOUT_DATE     = step.SI_TIMEOUT_DATE;

                dbContext.WF_STEP_INST.Remove(step);
                dbContext.WF_STEP_INST_HIS.Add(his);
            }
            //新增最后一个步骤到历史
            WF_STEP_INST_HIS his_step = new WF_STEP_INST_HIS();

            // dbContext.WF_STEP_INST_HIS.Add(his_step);
            StepUtil.CopyWorkflowToStepHis(dbContext, WorkflowRow, his_step, FlowAction.Flow);
            dbContext.WF_STEP_INST_HIS.Add(his_step);
            ////更新主表信息
            //删除视力表

            content.EndMainRowStatus(Source as WorkflowDbContext, finishType);
            ////主表转移先不做
            ////--提交
            dbContext.WF_WORKFLOW_INST.Remove(WorkflowRow);
            Source.Submit();
            return(false);
        }
Exemplo n.º 26
0
 public static IEnumerator FadeOut(GameObject obj, float duration,
                                   FinishType finish = FinishType.None, bool enableSr = false, GameObject exclude = null)
 {
     yield return(FadeOut(new GameObject[] { obj }, duration, finish, enableSr, exclude));
 }
Exemplo n.º 27
0
 public RichWall(Wall wall, FinishType finishType)
 {
     this.wall       = wall;
     this.finishType = finishType;
 }
Exemplo n.º 28
0
 public static IEnumerator FadeOut(GameObject[] objs, float duration, FinishType finish)
 {
     yield return TransitionAlpha(objs, duration, finish, 1f, 0f);
 }
Exemplo n.º 29
0
    public static IEnumerator TransitionColor(GameObject[] objs, float duration, FinishType finish, Color initial, Color final)
    {
        float t;
        float elapsed = 0f;

        while (elapsed <= duration)
        {
            t = SmoothLerp(elapsed / duration);
            Color c = Color.Lerp(initial, final, t);
            foreach (GameObject obj in objs)
            {
                SetColor(c, obj, null);
            }
            yield return new WaitForEndOfFrame();
            elapsed += Time.deltaTime;
        }
        foreach (GameObject obj in objs)
        {
            SetColor(final, obj, null);
        }

        yield return FinishAction(objs, finish);

        yield return null;
    }
Exemplo n.º 30
0
    public static IEnumerator TransitionAlpha(GameObject[] objs, float duration, FinishType finish, float initial, float final)
    {
        Color32 startColor = new Color(1f, 1f, 1f, initial);
        Color32 destColor = new Color(1f, 1f, 1f, final);

        yield return TransitionColor(objs, duration, finish, startColor, destColor);
    }
Exemplo n.º 31
0
        public static void Abort(IUnitOfData source, WF_WORKFLOW_INST WorkflowRow, FinishType finishType = FinishType.Abort)
        {
            WorkflowDbContext    dbContext = source as WorkflowDbContext;
            WorkflowContent      content   = WorkflowInstUtil.CreateContent(WorkflowRow);
            WF_WORKFLOW_INST_HIS wfi_His   = new WF_WORKFLOW_INST_HIS();

            //copy
            wfi_His.WI_ID              = WorkflowRow.WI_ID;
            wfi_His.WI_WD_NAME         = WorkflowRow.WI_WD_NAME;
            wfi_His.WI_CONTENT_XML     = WorkflowRow.WI_CONTENT_XML;
            wfi_His.WI_NAME            = WorkflowRow.WI_NAME;
            wfi_His.WI_CREATE_DATE     = WorkflowRow.WI_CREATE_DATE;
            wfi_His.WI_CREATE_USER     = WorkflowRow.WI_CREATE_USER;
            wfi_His.WI_REF_LIST        = WorkflowRow.WI_REF_LIST;
            wfi_His.WI_IS_TIMEOUT      = WorkflowRow.WI_IS_TIMEOUT;
            wfi_His.WI_TIMEOUT_DATE    = WorkflowRow.WI_TIMEOUT_DATE;
            wfi_His.WI_NEXT_EXE_DATE   = WorkflowRow.WI_NEXT_EXE_DATE;
            wfi_His.WI_PRIORITY        = WorkflowRow.WI_PRIORITY;
            wfi_His.WI_STATUS          = WorkflowRow.WI_STATUS;
            wfi_His.WI_ERROR_TYPE      = WorkflowRow.WI_ERROR_TYPE;
            wfi_His.WI_RETRY_TIMES     = WorkflowRow.WI_RETRY_TIMES;
            wfi_His.WI_MAX_RETRY_TIMES = WorkflowRow.WI_MAX_RETRY_TIMES;
            wfi_His.WI_WE_ID           = WorkflowRow.WI_WE_ID;
            wfi_His.WI_PARENT_ID       = WorkflowRow.WI_PARENT_ID;
            wfi_His.WI_PC_FLAG         = WorkflowRow.WI_PC_FLAG;
            //赋值
            wfi_His.WI_END_DATE  = dbContext.Now;
            wfi_His.WI_END_STATE = (int)finishType;
            if (!string.IsNullOrEmpty(WorkflowRow.WI_PROCESS_ID))
            {
                wfi_His.WI_END_USER = WorkflowRow.WI_PROCESS_ID;
            }
            else
            {
                wfi_His.WI_END_USER = GlobalVariable.UserId.ToString();
            }
            //附加
            dbContext.WF_WORKFLOW_INST_HIS.Add(wfi_His);
            ////copy步骤历史
            string wiId = WorkflowRow.WI_ID;
            List <WF_STEP_INST>     stepList    = dbContext.WF_STEP_INST.Where(a => a.SI_WI_ID == wiId).ToList();
            List <WF_STEP_INST_HIS> stepListHis = new List <WF_STEP_INST_HIS>();

            foreach (var step in stepList)
            {
                //------------
                WF_STEP_INST_HIS his = new WF_STEP_INST_HIS();
                his.SI_WI_ID             = step.SI_WI_ID;
                his.SI_CURRENT_STEP      = step.SI_CURRENT_STEP;
                his.SI_CURRENT_STEP_NAME = step.SI_CURRENT_STEP_NAME;
                his.SI_END_DATE          = step.SI_END_DATE;

                his.SI_FLOW_TYPE        = step.SI_FLOW_TYPE;
                his.SI_ID               = step.SI_ID;
                his.SI_INDEX            = step.SI_INDEX;
                his.SI_IS_TIMEOUT       = step.SI_IS_TIMEOUT;
                his.SI_LAST_MANUAL      = step.SI_LAST_MANUAL;
                his.SI_LAST_MANUAL_NAME = step.SI_LAST_MANUAL_NAME;
                his.SI_LAST_STEP        = step.SI_LAST_STEP;
                his.SI_LAST_STEP_NAME   = step.SI_LAST_STEP_NAME;
                his.SI_NOTE             = step.SI_NOTE;
                his.SI_PRIORITY         = step.SI_PRIORITY;
                his.SI_PROCESS_DATE     = step.SI_PROCESS_DATE;
                his.SI_PROCESS_ID       = step.SI_PROCESS_ID;
                his.SI_RECEIVE_DATE     = step.SI_RECEIVE_DATE;
                his.SI_RECEIVE_ID       = step.SI_RECEIVE_ID;
                his.SI_SEND_DATE        = step.SI_SEND_DATE;
                his.SI_SEND_ID          = step.SI_SEND_ID;
                his.SI_START_DATE       = step.SI_START_DATE;
                his.SI_STATUS           = step.SI_STATUS;
                his.SI_STEP_TYPE        = step.SI_STEP_TYPE;
                his.SI_TIME_SPAN        = step.SI_TIME_SPAN;
                his.SI_TIMEOUT_DATE     = step.SI_TIMEOUT_DATE;

                dbContext.WF_STEP_INST.Remove(step);
                dbContext.WF_STEP_INST_HIS.Add(his);
            }
            //新增最后一个步骤到历史
            WF_STEP_INST_HIS his_step = new WF_STEP_INST_HIS();

            // dbContext.WF_STEP_INST_HIS.Add(his_step);
            StepUtil.CopyWorkflowToStepHis(dbContext, WorkflowRow, his_step, FlowAction.Flow);
            dbContext.WF_STEP_INST_HIS.Add(his_step);
            ////更新主表信息
            //删除视力表

            content.EndMainRowStatus(dbContext, finishType);
            ////主表转移先不做
            ////--提交
            dbContext.WF_WORKFLOW_INST.Remove(WorkflowRow);
            dbContext.Submit();
        }
Exemplo n.º 32
0
            public static bool Recognization(RichWall richWall)
            {
                _wall = richWall.wall;
                _finishType = richWall.finishType;
                _length = _wall.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble();
                _level_bottom =
                    _doc.GetElement(_wall.get_Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElementId()) as Level;
                _level_top =
                    _doc.GetElement(_wall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE).AsElementId()) as Level;
                _offset_bottom = _wall.get_Parameter(BuiltInParameter.WALL_BASE_OFFSET).AsDouble();
                _offset_top = _wall.get_Parameter(BuiltInParameter.WALL_TOP_OFFSET).AsDouble();
                _noConsHeight = _wall.get_Parameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM).AsDouble();

                _direction = GetWallDirection(_wall);
                if (_direction == Direction.Undefined)
                {
                    _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.SkewWall);
                    return false;
                }

                return true;
            }
Exemplo n.º 33
0
 public static IEnumerator TransitionAlpha(GameObject obj, float duration, float initial, float final,
                                           FinishType finish = FinishType.None, bool enableSr = false, GameObject exclude = null)
 {
     yield return(TransitionAlpha(new GameObject[] { obj }, duration, initial, final, finish, enableSr, exclude));
 }
Exemplo n.º 34
0
 public LayerStoreResult(Layer parent)
     : base(parent)
 {
     // Set defaults.
     this.FinishType = FinishType.Biome;
 }