Ejemplo n.º 1
0
        /// <inheritdoc/>
        public override ISensor[] CreateSensors()
        {
#if (UNITY_EDITOR)
            if (Application.isPlaying)
            {
                EditorUtil.HideBehaviorParametersEditor();

                CoroutineUtil.Stop(this, m_Debug_OnSensorCreated);
                m_Debug_OnSensorCreated = new InvokeAfterFrames(
                    this, Debug_ToggleDrawGridBuffer).Coroutine;
            }
#endif


            m_GridSensor = new GridSensor(
                m_SensorName, m_GridBuffer, m_CompressionType, m_ObservationType);

            if (m_ObservationStacks > 1)
            {
                return(new ISensor[]
                {
                    new StackingSensor(m_GridSensor, m_ObservationStacks)
                });
            }

            return(new ISensor[] { m_GridSensor });
        }
Ejemplo n.º 2
0
 public void Clear()
 {
     if (_updateRoutine != null)
     {
         CoroutineUtil.Stop(_updateRoutine);
         _updateRoutine = null;
     }
     _transform = null;
 }
Ejemplo n.º 3
0
    IEnumerator GetKeyRoutine(float time)
    {
        yield return(new WaitForSeconds(time));

        UIManager._Instance.SetSysMsgInfo(SystemMessage._getKey);

        CoroutineUtil.Stop(_getKeyRoutine);
        _getKeyRoutine = null;
    }
Ejemplo n.º 4
0
 void ClearMeet()
 {
     if (_plotRoutine != null)
     {
         CoroutineUtil.Stop(_plotRoutine);
         ClearMeetRoutine();
     }
     if (_addPlayerRoutine != null)
     {
         CoroutineUtil.Stop(_addPlayerRoutine);
         ClearAddPlayerRoutine();
     }
 }
Ejemplo n.º 5
0
 public void Init(Pos pos, Transform transform)
 {
     _transform = transform;
     _anim      = _transform.GetComponentInChildren <Animator>();
     SetPos(pos);
     if (_updateRoutine != null)
     {
         CoroutineUtil.Stop(_updateRoutine);
         _updateRoutine = null;
     }
     _updateRoutine = UpdateRoutine();
     CoroutineUtil.Start(_updateRoutine);
 }