コード例 #1
0
ファイル: TimingTasker.cs プロジェクト: firefishes/FWGame
 public void Start(float totalTime)
 {
     if (!ShouldRun())
     {
         return;
     }
     if (TotalCount > 0)
     {
         RunCounts++;
     }
     mState = 1;
     timeGapper.Start(totalTime);
 }
コード例 #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 AddChangeTask(string taskName, float duringTime, Action <TimeGapper> handler)
        {
            TimeGapper timeGapper;

            if (mStartedChangeTask.Contains(taskName))
            {
                int index = mStartedChangeTask.IndexOf(taskName);
                mFinishTaskIndex.Remove(index);

                timeGapper = mChangeTimes[index];
                timeGapper.Start(duringTime);
                mChangeTimes[index] = timeGapper;
            }
            else
            {
                timeGapper = new TimeGapper();
                timeGapper.Start(duringTime);
                mChangeTimes.Add(timeGapper);

                mStartedChangeTask.Add(taskName);
                mChangeHnadlers[taskName] = handler;
            }
            Owner.UIChanged = true;
        }
コード例 #5
0
        public void Init()
        {
            if (m_Enabled)
            {
                if (mIsInited)
                {
                    mDelayStartTimer.totalTime = m_StartTime;
                }
                else
                {
                    mDelayStartTimer = new TimeGapper
                    {
                        totalTime = m_StartTime,
                        isAnew    = true,
                    };

                    if (m_FX != default)
                    {
                        mEffects = ShipDockApp.Instance.Effects;
                        PoolID   = m_FX.GetInstanceID();
                        mEffects?.CreateSource(PoolID, ref m_FX, m_FXTotal, 0, m_IsDestroyWhenClean);
                    }
                    else
                    {
                    }

                    mIsInited = true;
                }

                mDelayStartTimer.Reset();
                mDelayStartTimer.Start();
            }
            else
            {
            }
        }