public override void Execute(int time, ref IShipDockEntitas target) { base.Execute(time, ref target); mRole = target as ICommonRole; #if LOG_TRY_CATCH_ROLE && UNITY_EDITOR try { #endif mRoleInput = mRole.RoleInput; #if LOG_TRY_CATCH_ROLE && UNITY_EDITOR } catch (System.Exception error) { Testers.Tester.Instance.Log(TesterRPG.Instance, TesterRPG.LOG, "error:".Append(error.Message)); } #endif if (mRoleInput == default) { return; } int phaseName = mRoleInput.RoleInputPhase; switch (phaseName) { default: int allowCalled = mAllowCalleds.ContainsKey(phaseName) ? mAllowCalleds[phaseName] : 0; mRoleInput.AdvancedInputPhase(phaseName, allowCalled); break; } }
public bool HandleGroundedMovement(ref IRoleInput input, ref CommonRoleAnimatorInfo animatorInfo) { // check whether conditions are right to allow a jump: bool isNameGrounded = animatorInfo.IsMovementBlendTree; bool result = input.IsJump() && !input.IsCrouch() && isNameGrounded; return(result); }
public void ScaleCapsuleForCrouching(ICommonRole roleEntitas, ref IRoleInput roleInput) { roleEntitas.IsGroundedAndCrouch = roleEntitas.IsGrounded && roleInput.IsCrouch(); if (roleEntitas.IsGroundedAndCrouch) { if (roleInput.IsCrouching()) { return; } CommonRoleMustSubgroup subgroup = roleEntitas.RoleMustSubgroup; subgroup.capsuleHeight /= 2f; subgroup.capsuleCenter /= 2f; roleEntitas.RoleMustSubgroup = subgroup; } }
public void FillToSceneComponent(RoleComponent roleComponent) { int max = roleExecuableInfos.Length; for (int i = 0; i < max; i++) { var item = roleExecuableInfos[i]; if (item.isExecuteInScene) { roleComponent.ActiveRoleInputPhase(item.phaseName, true); } else { IRoleInput roleInput = roleComponent.RoleEntitas.RoleInput; roleInput.ActiveEntitasPhase(item.phaseName, true); } } }
public override void Execute(int time, ref IShipDockEntitas target) { base.Execute(time, ref target); mRoleItem = target as ICommonRole; if (mRoleItem == default) { return; } mRoleData = mRoleItem.RoleDataSource; mRoleInput = mRoleItem.RoleInput; mAnimatorInfo = mRoleItem.RoleAnimatorInfo; if (mRoleItem.IsUserControlling && (mRoleInput != default) && mRoleInput.ShouldGetUserInput) { CheckUserInput(); mRoleInput.ShouldGetUserInput = false; } }
private void SyncInfos() { m_RoleCompInfo.SetHp(mRole.RoleDataSource.Hp); m_RoleCompInfo.SetSpeed(mRole.SpeedCurrent); if (m_NavMeshAgent != default) { m_NavMeshAgent.speed = mRole.SpeedCurrent; } if (mRoleInput == default) { mRoleInput = mRole.RoleInput; } mRoleInput.SetDeltaTime(Time.deltaTime); if (!mIsRoleNameSynced && !string.IsNullOrEmpty(mRole.Name)) { mIsRoleNameSynced = true; name = mRole.Name; } }
protected virtual void InitRolePhases(IRoleInput roleInput) { }