internal void RegisterCamera(AmplifyMotionCamera camera)
    {
        Camera component = camera.GetComponent <Camera>();

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

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

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

            default:
                throw new Exception("[AmplifyMotion] Invalid object type.");
            }
            camera.RegisterObject(this);
            this.m_states.Add(component, value);
        }
    }
示例#2
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);
        }
    }
示例#3
0
 // Token: 0x0600095E RID: 2398 RVA: 0x00049B1C File Offset: 0x00047D1C
 internal static void UnregisterCamera(AmplifyMotionCamera cam)
 {
     foreach (AmplifyMotionObjectBase amplifyMotionObjectBase in AmplifyMotionEffectBase.m_activeObjects.Values)
     {
         amplifyMotionObjectBase.UnregisterCamera(cam);
     }
     AmplifyMotionEffectBase.m_activeCameras.Remove(cam.GetComponent <Camera>());
 }
示例#4
0
 internal static void RegisterCamera(AmplifyMotionCamera cam)
 {
     m_activeCameras.Add(cam.GetComponent <Camera>(), cam);
     foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values)
     {
         obj.RegisterCamera(cam);
     }
 }
示例#5
0
 internal static void UnregisterCamera(AmplifyMotionCamera cam)
 {
     foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values)
     {
         obj.UnregisterCamera(cam);
     }
     m_activeCameras.Remove(cam.GetComponent <Camera>());
 }
 internal static void RegisterCamera(AmplifyMotionCamera cam)
 {
     AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent <Camera>(), cam);
     foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values)
     {
         current.RegisterCamera(cam);
     }
 }
示例#7
0
    internal void OnUpdateTransform(AmplifyMotionCamera owner, bool starting)
    {
        MotionState state;

        if (m_states.TryGetValue(owner.GetComponent <Camera>(), out state))
        {
            state.UpdateTransform(starting);
        }
    }
示例#8
0
    internal static void RegisterCamera(AmplifyMotionCamera cam)
    {
        //Debug.Log( "Registering AmplifyMotionCamera: " + cam.name );

        m_activeCameras.Add(cam.GetComponent <Camera>(), cam);
        foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values)
        {
            obj.RegisterCamera(cam);
        }
    }
示例#9
0
 // Token: 0x0600095D RID: 2397 RVA: 0x00049AA8 File Offset: 0x00047CA8
 internal static void RegisterCamera(AmplifyMotionCamera cam)
 {
     if (!AmplifyMotionEffectBase.m_activeCameras.ContainsValue(cam))
     {
         AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent <Camera>(), cam);
     }
     foreach (AmplifyMotionObjectBase amplifyMotionObjectBase in AmplifyMotionEffectBase.m_activeObjects.Values)
     {
         amplifyMotionObjectBase.RegisterCamera(cam);
     }
 }
示例#10
0
    internal void UnregisterCamera(AmplifyMotionCamera camera)
    {
        MotionState state;
        Camera      actual = camera.GetComponent <Camera>();

        if (m_states.TryGetValue(actual, out state))
        {
            camera.UnregisterObject(this);

            m_states.Remove(actual);
        }
    }
    internal void UnregisterCamera(AmplifyMotionCamera camera)
    {
        Camera      component = camera.GetComponent <Camera>();
        MotionState motionState;

        if (this.m_states.TryGetValue(component, out motionState))
        {
            camera.UnregisterObject(this);
            if (this.m_states.TryGetValue(component, out motionState))
            {
                motionState.Shutdown();
            }
            this.m_states.Remove(component);
        }
    }
示例#12
0
    internal void RegisterCamera(AmplifyMotionCamera camera)
    {
        Camera actual = camera.GetComponent <Camera>();

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

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

                        #if UNITY_3 || UNITY_4
            case AmplifyMotionObjectType.Cloth:
                state = new AmplifyMotion.ClothState(camera, this); break;
                        #endif
            default:
                throw new Exception("[AmplifyMotion] Invalid object type.");
            }

            m_fixedStep = false;
                #if UNITY_3 || UNITY_4
            if (m_type == AmplifyMotionObjectType.Cloth)
            {
                m_fixedStep = true;
            }
            else if (m_type == AmplifyMotionObjectType.Solid)
                #else
            if (m_type == AmplifyMotionObjectType.Solid)
                #endif
            {
                Rigidbody rb = GetComponent <Rigidbody>();
                if (rb != null && rb.interpolation == RigidbodyInterpolation.None)
                {
                    m_fixedStep = true;
                }
            }

            camera.RegisterObject(this);

            m_states.Add(actual, state);
        }
    }
 private void OnDestroy()
 {
     AmplifyMotionCamera[] array  = this.m_linkedCameras.Values.ToArray <AmplifyMotionCamera>();
     AmplifyMotionCamera[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         AmplifyMotionCamera amplifyMotionCamera = array2[i];
         if (amplifyMotionCamera != null && amplifyMotionCamera.gameObject != base.gameObject)
         {
             Camera component = amplifyMotionCamera.GetComponent <Camera>();
             if (component != null)
             {
                 component.targetTexture = null;
             }
             UnityEngine.Object.DestroyImmediate(amplifyMotionCamera);
         }
     }
     this.DestroyRenderTextures();
     this.DestroyMaterials();
 }
	internal void RegisterCamera( AmplifyMotionCamera camera )
	{
		Camera actual = camera.GetComponent<Camera>();
		if ( ( actual.cullingMask & ( 1 << gameObject.layer ) ) != 0 && !m_states.ContainsKey( actual ) )
		{
			MotionState state =null;
			switch ( m_type )
			{
				case AmplifyMotionObjectType.Solid:
					state = new AmplifyMotion.SolidState( camera, this ); break;
				case AmplifyMotionObjectType.Skinned:
					state = new AmplifyMotion.SkinnedState( camera, this );	break;
			#if UNITY_3 || UNITY_4
				case AmplifyMotionObjectType.Cloth:
					state = new AmplifyMotion.ClothState( camera, this ); break;
			#endif
				default:
					throw new Exception( "[AmplifyMotion] Invalid object type." );
			}

			m_fixedStep = false;
		#if UNITY_3 || UNITY_4
			if ( m_type == AmplifyMotionObjectType.Cloth )
				m_fixedStep = true;
			else if ( m_type == AmplifyMotionObjectType.Solid )
		#else
			if ( m_type == AmplifyMotionObjectType.Solid )
		#endif
			{
				Rigidbody rb = GetComponent<Rigidbody>();
				if ( rb != null && rb.interpolation == RigidbodyInterpolation.None )
					m_fixedStep = true;
			}

			camera.RegisterObject( this );

			m_states.Add( actual, state );
		}		
	}
	internal static void RegisterCamera( AmplifyMotionCamera cam )
	{
		m_activeCameras.Add( cam.GetComponent<Camera>(), cam );
		foreach ( AmplifyMotionObjectBase obj in m_activeObjects.Values )
			obj.RegisterCamera( cam );
	}
 internal static void UnregisterCamera(AmplifyMotionCamera cam)
 {
     foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values)
     {
         current.UnregisterCamera(cam);
     }
     AmplifyMotionEffectBase.m_activeCameras.Remove(cam.GetComponent<Camera>());
 }
	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 static void UnregisterCamera( AmplifyMotionCamera cam )
	{
		foreach ( AmplifyMotionObjectBase obj in m_activeObjects.Values )
			obj.UnregisterCamera( cam );
		m_activeCameras.Remove( cam.GetComponent<Camera>() );
	}
	internal void OnUpdateTransform( AmplifyMotionCamera owner, bool starting )
	{
		AmplifyMotion.MotionState state;
		if ( m_states.TryGetValue( owner.GetComponent<Camera>(), out state ) )
		{
			if ( !state.Error )
				state.UpdateTransform( starting );
		}
	}
	internal void UnregisterCamera( AmplifyMotionCamera camera )
	{
		AmplifyMotion.MotionState state;
		Camera actual = camera.GetComponent<Camera>();
		if ( m_states.TryGetValue( actual, out state ) )
		{
			camera.UnregisterObject( this );

			if ( m_states.TryGetValue( actual, out state ) )
				state.Shutdown();

			m_states.Remove( actual );
		}
	}
 internal static void RegisterCamera(AmplifyMotionCamera cam)
 {
     AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent<Camera>(), cam);
     foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values)
     {
         current.RegisterCamera(cam);
     }
 }