Beispiel #1
0
	public override void Init( AsBaseEntity _entity)
	{
		base.Init( _entity);

		_entity.SetNavPathDistance( GetNavPathDistance);

		if( m_kController == null)
		{
			CharacterController attached = gameObject.AddComponent<CharacterController>();
			if( attached == null)
				Debug.LogError( "AsMover::InterInit: attaching controller failed");
			else
			{
				m_kController = attached;

				// default setting, ilmeda
//				if( eEntityType.USER == m_Entity.EntityType)
//				{
					m_kController.center = new Vector3( 0.0f, 1.0f, 0.0f);
					m_kController.height = 2.0f;
//				}
			}
		}

		m_Entity.SetCharacterController( m_kController);
		m_kController.slopeLimit = 70f;
	}