Esempio n. 1
0
 private void CheckTeleportReset(AmplifyMotionEffectBase inst)
 {
     if (Vector3.SqrMagnitude(base.transform.position - this.m_lastPosition) > inst.MinResetDeltaDistSqr)
     {
         AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, Time.frameCount + inst.ResetFrameDelay);
     }
 }
Esempio n. 2
0
 // Token: 0x06001F9E RID: 8094 RVA: 0x0018588C File Offset: 0x00183A8C
 public ParticleState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj)
 {
     this.m_particleSystem     = this.m_obj.GetComponent <ParticleSystem>();
     this.m_renderer           = this.m_particleSystem.GetComponent <ParticleSystemRenderer>();
     this.rotationOverLifetime = this.m_particleSystem.rotationOverLifetime;
     this.rotationBySpeed      = this.m_particleSystem.rotationBySpeed;
 }
Esempio n. 3
0
    private static void RecursiveResetMotionAtFrame(Transform transform, AmplifyMotionObjectBase obj, int frame)
    {
        if (obj != null)
        {
            obj.m_resetAtFrame = frame;
        }
        IEnumerator enumerator = transform.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object    obj2       = enumerator.Current;
                Transform transform2 = (Transform)obj2;
                AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(transform2, transform2.GetComponent <AmplifyMotionObjectBase>(), frame);
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
    }
    static void GetValues(AmplifyMotionObjectBase obj)
    {
        // if the object is a Particle System (Shuriken)
        ParticleSystem particleSystem = obj.GetComponent <ParticleSystem>();

        if (particleSystem != null)
        {
            SerializedObject so = null;
            try
            {
                so = new SerializedObject(particleSystem);
            }
            catch
            {
                Debug.LogWarning("[AmplifyMotion] Can't serialize particle system object " + particleSystem.name + ". Aborting.");
                return;
            }

            obj.ParticleSystemDesc.sizeOverLifeTimeActive = so.FindProperty("SizeModule.enabled").boolValue;
            obj.ParticleSystemDesc.sizeBySpeedActive      = so.FindProperty("SizeBySpeedModule.enabled").boolValue;

            if (obj.ParticleSystemDesc.sizeOverLifeTimeActive)
            {
                // size by lifetime
                obj.ParticleSystemDesc.curveSizeOverLifeTime = so.FindProperty("SizeModule.curve.maxCurve").animationCurveValue;
            }
            if (obj.ParticleSystemDesc.sizeBySpeedActive)
            {
                // size by speed
                obj.ParticleSystemDesc.curveBySpeed  = so.FindProperty("SizeBySpeedModule.curve.maxCurve").animationCurveValue;
                obj.ParticleSystemDesc.speedRangeMin = so.FindProperty("SizeBySpeedModule.range.x").floatValue;
                obj.ParticleSystemDesc.speedRangeMax = so.FindProperty("SizeBySpeedModule.range.y").floatValue;
            }
        }
    }
	static void GetValues( AmplifyMotionObjectBase obj )
	{
		// if the object is a Particle System (Shuriken)
		ParticleSystem particleSystem = obj.GetComponent<ParticleSystem>();
		if ( particleSystem != null )
		{
			SerializedObject so = null;
			try
			{
				so = new SerializedObject( particleSystem );
			}
			catch
			{
				Debug.LogWarning( "[AmplifyMotion] Can't serialize particle system object " + particleSystem.name + ". Aborting." );
				return;
			}

			obj.ParticleSystemDesc.sizeOverLifeTimeActive = so.FindProperty( "SizeModule.enabled" ).boolValue;
			obj.ParticleSystemDesc.sizeBySpeedActive = so.FindProperty( "SizeBySpeedModule.enabled" ).boolValue;

			if ( obj.ParticleSystemDesc.sizeOverLifeTimeActive )
			{
				// size by lifetime
				obj.ParticleSystemDesc.curveSizeOverLifeTime = so.FindProperty( "SizeModule.curve.maxCurve" ).animationCurveValue;
			}
			if ( obj.ParticleSystemDesc.sizeBySpeedActive )
			{
				// size by speed
				obj.ParticleSystemDesc.curveBySpeed = so.FindProperty( "SizeBySpeedModule.curve.maxCurve" ).animationCurveValue;
				obj.ParticleSystemDesc.speedRangeMin = so.FindProperty( "SizeBySpeedModule.range.x" ).floatValue;
				obj.ParticleSystemDesc.speedRangeMax = so.FindProperty( "SizeBySpeedModule.range.y" ).floatValue;
			}
		}
	}
Esempio n. 6
0
	public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_particleSystem = m_obj.GetComponent<ParticleSystem>();
		m_renderer = m_particleSystem.GetComponent<ParticleSystemRenderer>();
		rotationOverLifetime = m_particleSystem.rotationOverLifetime;
		rotationBySpeed = m_particleSystem.rotationBySpeed;
	}
Esempio n. 7
0
 // Token: 0x06000960 RID: 2400 RVA: 0x00049BCC File Offset: 0x00047DCC
 internal static void RegisterObject(AmplifyMotionObjectBase obj)
 {
     AmplifyMotionEffectBase.m_activeObjects.Add(obj.gameObject, obj);
     foreach (AmplifyMotionCamera camera in AmplifyMotionEffectBase.m_activeCameras.Values)
     {
         obj.RegisterCamera(camera);
     }
 }
 // Token: 0x06001F8A RID: 8074 RVA: 0x00184E43 File Offset: 0x00183043
 public MotionState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
 {
     this.m_error       = false;
     this.m_initialized = false;
     this.m_owner       = owner;
     this.m_obj         = obj;
     this.m_transform   = obj.transform;
 }
Esempio n. 9
0
 // Token: 0x06000961 RID: 2401 RVA: 0x00049C34 File Offset: 0x00047E34
 internal static void UnregisterObject(AmplifyMotionObjectBase obj)
 {
     foreach (AmplifyMotionCamera camera in AmplifyMotionEffectBase.m_activeCameras.Values)
     {
         obj.UnregisterCamera(camera);
     }
     AmplifyMotionEffectBase.m_activeObjects.Remove(obj.gameObject);
 }
Esempio n. 10
0
 public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
 #if UNITY_4
     m_cloth = m_obj.GetComponent <InteractiveCloth>();
 #else
     m_cloth = m_obj.GetComponent <Cloth>();
 #endif
 }
Esempio n. 11
0
    // Token: 0x06000965 RID: 2405 RVA: 0x00049E08 File Offset: 0x00048008
    internal static void TryUnregister(GameObject gameObj)
    {
        AmplifyMotionObjectBase component = gameObj.GetComponent <AmplifyMotionObjectBase>();

        if (component != null)
        {
            UnityEngine.Object.Destroy(component);
        }
    }
Esempio n. 12
0
    internal static void TryUnregister(GameObject gameObj)
    {
        AmplifyMotionObjectBase comp = gameObj.GetComponent <AmplifyMotionObjectBase>();

        if (comp != null)
        {
            Destroy(comp);
        }
    }
	public MotionState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
	{
		m_error = false;
		m_initialized = false;

		m_owner = owner;
		m_obj = obj;
		m_transform = obj.transform;
	}
Esempio n. 14
0
    public MotionState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
    {
        // TEMPORARY
        //m_name = obj.name;

        m_error       = false;
        m_initialized = false;

        m_owner = owner;
        m_obj   = obj;
    }
	public MotionState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
	{
		// TEMPORARY
		//m_name = obj.name;

		m_error = false;
		m_initialized = false;

		m_owner = owner;
		m_obj = obj;
	}
Esempio n. 16
0
 private static void RecursiveResetMotionAtFrame(Transform transform, AmplifyMotionObjectBase obj, int frame)
 {
     if (obj != null)
     {
         obj.m_resetAtFrame = frame;
     }
     foreach (object obj2 in transform)
     {
         Transform transform2 = (Transform)obj2;
         AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(transform2, transform2.GetComponent <AmplifyMotionObjectBase>(), frame);
     }
 }
Esempio n. 17
0
    static void RecursiveResetMotionAtFrame(Transform transform, AmplifyMotionObjectBase obj, int frame)
    {
        if (obj != null)
        {
            obj.m_resetAtFrame = frame;
        }

        foreach (Transform child in transform)
        {
            RecursiveResetMotionAtFrame(child, child.GetComponent <AmplifyMotionObjectBase>(), frame);
        }
    }
Esempio n. 18
0
 private void doRemove()
 {
     ParticleSystem[] componentsInChildren = base.transform.GetComponentsInChildren <ParticleSystem>(true);
     ParticleSystem[] array = componentsInChildren;
     for (int i = 0; i < array.Length; i++)
     {
         ParticleSystem          particleSystem = array[i];
         AmplifyMotionObjectBase component      = particleSystem.GetComponent <AmplifyMotionObjectBase>();
         if (component)
         {
             UnityEngine.Object.Destroy(component);
         }
     }
 }
Esempio n. 19
0
 private void Update()
 {
     if (this.fish.spearedBool)
     {
         if (!this.amb)
         {
             this.amb = base.gameObject.AddComponent <AmplifyMotionObjectBase>();
         }
         else
         {
             this.amb.enabled = true;
         }
         this.tr.position = this.refPos.position;
     }
     else if (this.amb)
     {
         this.amb.enabled = false;
     }
 }
Esempio n. 20
0
	internal static void UnregisterObject( AmplifyMotionObjectBase obj )
	{
		foreach ( AmplifyMotionCamera cam in m_activeCameras.Values )
			obj.UnregisterCamera( cam );
		m_activeObjects.Remove( obj.gameObject );
	}
 public void RegisterObject(AmplifyMotionObjectBase obj)
 {
     m_affectedObjectsTable.Add(obj);
     m_affectedObjectsChanged = true;
 }
Esempio n. 22
0
 public void ResetMotionNow()
 {
     AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, Time.frameCount);
 }
 public SolidState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
     : base(owner, obj)
 {
     m_meshRenderer = m_obj.GetComponent<MeshRenderer>();
 }
	public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_particleSystem = m_obj.GetComponent<ParticleSystem>();
		m_meshRenderer = m_particleSystem.GetComponent<Renderer>().GetComponent<ParticleSystemRenderer>();
	}
Esempio n. 25
0
 public void ResetMotionAtFrame(int frame)
 {
     AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, frame);
 }
 internal static void UnregisterObject(AmplifyMotionObjectBase obj)
 {
     foreach (AmplifyMotionCamera current in AmplifyMotionEffectBase.m_activeCameras.Values)
     {
         obj.UnregisterCamera(current);
     }
     AmplifyMotionEffectBase.m_activeObjects.Remove(obj.gameObject);
 }
	public void RegisterObject( AmplifyMotionObjectBase obj )
	{
		m_affectedObjectsTable.Add( obj );
		m_affectedObjectsChanged = true;
	}
 public ParticleState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
     m_particleSystem = m_obj.GetComponent <ParticleSystem>();
     m_meshRenderer   = m_particleSystem.GetComponent <Renderer>().GetComponent <ParticleSystemRenderer>();
 }
Esempio n. 29
0
 public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
     m_cloth = m_obj.GetComponent <Cloth>();
 }
 public SkinnedState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
     : base(owner, obj)
 {
     m_skinnedRenderer = m_obj.GetComponent<SkinnedMeshRenderer>();
 }
Esempio n. 31
0
 // Token: 0x06001FAF RID: 8111 RVA: 0x001863AF File Offset: 0x001845AF
 public SkinnedState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj)
 {
     this.m_renderer = this.m_obj.GetComponent <SkinnedMeshRenderer>();
 }
Esempio n. 32
0
	internal static void RegisterObject( AmplifyMotionObjectBase obj )
	{
		m_activeObjects.Add( obj.gameObject, obj );
		foreach ( AmplifyMotionCamera cam in m_activeCameras.Values )
			obj.RegisterCamera( cam );
	}
 public void UnregisterObject(AmplifyMotionObjectBase obj)
 {
     m_affectedObjectsTable.Remove(obj);
     m_affectedObjectsChanged = true;
 }
	public ClothState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_cloth = m_obj.GetComponent<InteractiveCloth>();
	}
	public void UnregisterObject( AmplifyMotionObjectBase obj )
	{
		m_affectedObjectsTable.Remove( obj );
		m_affectedObjectsChanged = true;
	}
 internal static void RegisterObject(AmplifyMotionObjectBase obj)
 {
     AmplifyMotionEffectBase.m_activeObjects.Add(obj.gameObject, obj);
     foreach (AmplifyMotionCamera current in AmplifyMotionEffectBase.m_activeCameras.Values)
     {
         obj.RegisterCamera(current);
     }
 }
Esempio n. 37
0
 public SolidState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
     m_meshRenderer = m_obj.GetComponent <MeshRenderer>();
 }
Esempio n. 38
0
 public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
     this.m_cloth = this.m_obj.GetComponent<Cloth>();
 }