コード例 #1
0
 public Vector3 Update(float time)
 {
     mTime.TimeAdvanced(time);
     Current      = Vector3.Lerp(Current, target, (mTime.totalTime - mTime.time) / mTime.totalTime);
     IsCompoleted = Vector3.Distance(Current, target) <= 0.1f;
     return(Current);
 }
コード例 #2
0
 private void ShowRolePhaseInGUI(ref ICommonRole roleEntitas, ref string content)
 {
     if (!mTimerForPhaseGUI.TimeAdvanced(Time.deltaTime) && mPhasesQueueForGUI.Count < 10)
     {
         if (!mPhasesQueueForGUI.Contains(roleEntitas.RoleInput.RoleInputPhase))
         {
             mPhasesQueueForGUI.Enqueue(roleEntitas.RoleInput.RoleInputPhase);
         }
     }
     else
     {
         mTimerForPhaseGUI.totalTime = 2f;
         mTimerForPhaseGUI.Start();
         mPhaseContentGUI = string.Empty;
         while (mPhasesQueueForGUI.Count > 0)
         {
             mPhaseContentGUI = mPhaseContentGUI.Append(mPhasesQueueForGUI.Dequeue().ToString(), ", ");
         }
         mPhasesQueueForGUI.Clear();
     }
     GUILayout.Label("Current role phase: " + mPhaseContentGUI, mEnemyLabelStyle);
 }
コード例 #3
0
        public void UpdatePhysicsCheck(ref Transform transform, bool isTrigger, bool isCollider)
        {
            if (m_CheckGapper.isStart)
            {
                m_CheckGapper.TimeAdvanced(Time.deltaTime);
                return;
            }
            else
            {
                m_CheckGapper.Start();
            }

            if (SubgroupID == int.MaxValue)
            {
                return;
            }
            mCollidersOverlay = Physics.OverlapSphere(transform.position, mRayAndHitInfo.radius, mRayAndHitInfo.layerMask);
            int max = mCollidersOverlay != default ? mCollidersOverlay.Length : 0;

            if (max > 0)
            {
                "log: Update physics start check, SubgroupID = {0}".Log(SubgroupID.ToString());
                int id;
                for (int i = 0; i < max; i++)
                {
                    mColliderItem = mCollidersOverlay[i];
                    id            = mColliderItem.GetInstanceID();
                    if (id != SubgroupID)
                    {
                        AddColliding(id, isTrigger, isCollider, out _);
                    }
                }
            }
            mCommonColliderMapper.PhysicsChecked(SubgroupID);
#if UNITY_EDITOR
            UpdateInfoForEditor();
#endif
        }
コード例 #4
0
 public void UpdateFX()
 {
     if (!mIsReleased && m_Enabled)
     {
         if (mFXInstance == default)
         {
             if (mDelayStartTimer.totalTime > 0f)
             {
                 if (!mDelayStartTimer.IsFinised)
                 {
                     bool flag = mDelayStartTimer.TimeAdvanced(Time.deltaTime);
                     if (flag)
                     {
                         CreateFX();//延后创建计时完毕,创建特效对象
                     }
                     else
                     {
                     }
                 }
                 else
                 {
                 }
             }
             else
             {
                 CreateFX();//无延时,直接创建特效对象
             }
         }
         else
         {
         }
     }
     else
     {
     }
 }