public IList <RootBranch> GetRootChangesetForBranch(string tfsPathBranchToCreate, int lastChangesetIdToCheck = -1, string tfsPathParentBranch = null) { var branchChangesets = _script.Changesets.Where(c => c.IsBranchChangeset); var firstBranchChangeset = branchChangesets.FirstOrDefault(c => c.BranchChangesetDatas.BranchPath == tfsPathBranchToCreate); var rootBranches = new List <RootBranch>(); if (firstBranchChangeset != null) { do { var rootBranch = new RootBranch( firstBranchChangeset.BranchChangesetDatas.RootChangesetId, firstBranchChangeset.Id, firstBranchChangeset.BranchChangesetDatas.BranchPath ); rootBranch.IsRenamedBranch = DeletedBranchesPathes.Contains(rootBranch.TfsBranchPath); rootBranches.Add(rootBranch); firstBranchChangeset = branchChangesets.FirstOrDefault(c => c.BranchChangesetDatas.BranchPath == firstBranchChangeset.BranchChangesetDatas.ParentBranch); } while (firstBranchChangeset != null); rootBranches.Reverse(); return(rootBranches); } rootBranches.Add(new RootBranch(-1, tfsPathBranchToCreate)); return(rootBranches); }
/* * public void StartRoot(EnemyMovement eM, float castingTime, GameObject targetPlayer, int damage, Vector3 pos, float rootTime, GameObject rootBranchPrefab) * { * StartCoroutine(RootCoroutine(eM, castingTime, targetPlayer, damage, pos, rootTime, rootBranchPrefab)); * } */ public IEnumerator RootCoroutine(EnemySkill eK, EnemyMovement eM, float castingTime, GameObject targetPlayer, int damage, Vector3 pos, float rootTime, GameObject rootBranchPrefab) { eM.agent.isStopped = true; eK.isCasting = true; yield return(new WaitForSecondsRealtime(castingTime)); eM.agent.isStopped = false; eK.isCasting = false; GameManager.gameManager.TakeDamage(targetPlayer, damage, pos, false); GameManager.gameManager.UIManager.QuoteOnDamage("enemy", targetPlayer); isRoot = true; RootBranch branch = Instantiate(rootBranchPrefab).GetComponent <RootBranch>(); branch.targetPlayer = targetPlayer; branch.rootTime = rootTime; yield return(new WaitForSecondsRealtime(rootTime)); isRoot = false; }