Пример #1
0
    internal void RegisterCamera(AmplifyMotionCamera camera)
    {
        Camera actual = camera.GetComponent <Camera>();

        if ((actual.cullingMask & (1 << gameObject.layer)) != 0 && !m_states.ContainsKey(actual))
        {
            AmplifyMotion.MotionState state = null;
            switch (m_type)
            {
            case AmplifyMotion.ObjectType.Solid:
                state = new AmplifyMotion.SolidState(camera, this); break;

            case AmplifyMotion.ObjectType.Skinned:
                state = new AmplifyMotion.SkinnedState(camera, this); break;

            case AmplifyMotion.ObjectType.Cloth:
                state = new AmplifyMotion.ClothState(camera, this); break;

                        #if !UNITY_PRE_5_3
            case AmplifyMotion.ObjectType.Particle:
                state = new AmplifyMotion.ParticleState(camera, this); break;
                        #endif
            default:
                throw new Exception("[AmplifyMotion] Invalid object type.");
            }

            camera.RegisterObject(this);

            m_states.Add(actual, state);
        }
    }
	internal void RegisterCamera( AmplifyMotionCamera camera )
	{
		Camera actual = camera.GetComponent<Camera>();
		if ( ( actual.cullingMask & ( 1 << gameObject.layer ) ) != 0 && !m_states.ContainsKey( actual ) )
		{
			AmplifyMotion.MotionState state = null;
			switch ( m_type )
			{
				case AmplifyMotion.ObjectType.Solid:
					state = new AmplifyMotion.SolidState( camera, this ); break;
				case AmplifyMotion.ObjectType.Skinned:
					state = new AmplifyMotion.SkinnedState( camera, this );	break;
				case AmplifyMotion.ObjectType.Cloth:
					state = new AmplifyMotion.ClothState( camera, this ); break;
			#if !UNITY_PRE_5_3
				case AmplifyMotion.ObjectType.Particle:
					state = new AmplifyMotion.ParticleState( camera, this ); break;
			#endif
				default:
					throw new Exception( "[AmplifyMotion] Invalid object type." );
			}

			camera.RegisterObject( this );

			m_states.Add( actual, state );
		}
	}