示例#1
0
        public void SetSteering(ESteeringType type, Location target = null)
        {
            if (_steering != null)
            {
                _steering.Release();
            }

            _steering = SteeringTable.instance.GetFreeSteering(type, _body, _steeringProperties, target);

            _body.ResetBody();
        }
示例#2
0
        public Steering GetFreeSteering(ESteeringType type, Body character, SteeringProperties properties, Location target = null)
        {
            if (type == ESteeringType.None)
            {
                return(null);
            }

            Steering steering = (Steering)_pools[(int)type].GetFreeResource();

            steering.Init(character, properties, target);

            return(steering);
        }
示例#3
0
        private void DisplaySteering()
        {
            EditorGUI.indentLevel++;

            EditorGUILayout.HelpBox("Set the asked steering to the SteeringComponent.", MessageType.Info);

            _steeringType = (ESteeringType)EditorGUILayout.EnumPopup("type", _steeringType);

            if (GUILayout.Button("Load Steering"))
            {
                _targetObject.SetSteering(_steeringType);
            }

            EditorGUILayout.Space();

            EditorGUI.indentLevel--;
        }