Esempio n. 1
0
        public void DrawMoveGizmos()
        {
                        #if UNITY_EDITOR
            if (m_Owner == null || m_creature_control.Creature.Move.CurrentTarget == null)
            {
                return;
            }

            TargetObject _target = m_creature_control.Creature.Move.CurrentTarget;

            Vector3 _move_position         = m_creature_control.Creature.Move.MovePosition;
            Vector3 _target_move_position  = _target.TargetMovePosition;
            float   _move_stop_distance    = m_creature_control.Creature.Move.CurrentMove.MoveStopDistance;
            float   _move_lateral_variance = m_creature_control.Creature.Move.CurrentMove.MoveLateralVariance;

            Vector3 _owner_pos = m_Owner.transform.position;
            _owner_pos.y            = GetLevel();
            _move_position.y        = GetLevel();
            _target_move_position.y = GetLevel();



            CustomGizmos.OffsetPath(_owner_pos, 2, _move_position, _move_stop_distance);      // PATH FROM CREATURE TO NEXT MOVE POSITION
            CustomGizmos.Circle(_move_position, _move_stop_distance, 5, false);               // STOP DISTANCE RANGE

            if (m_creature_control.Creature.Move.CurrentMove.Type != MoveType.ESCAPE)
            {
                CustomGizmos.OffsetPath(_move_position, _move_stop_distance, _target_move_position, _target.TargetStopDistance);                      // PATH NEXT MOVE POSITION TO TARGET MOVE POSITION
            }
            if (_move_lateral_variance > 0)
            {
                float _max_range = _move_stop_distance + _move_lateral_variance;

                CustomGizmos.ZickZackCircle(_move_position, _move_lateral_variance, "", false); // RANDOM RANGE
                CustomGizmos.Circle(_move_position, _max_range, 5, true);                       // MAX MOVE RANGE
            }
                        #endif
        }