Ejemplo n.º 1
0
    private bool InitializeType()
    {
        Renderer component = base.GetComponent <Renderer>();

        if (AmplifyMotionEffectBase.CanRegister(base.gameObject, false) && component != null)
        {
            if (component.GetType() == typeof(MeshRenderer))
            {
                this.m_type = ObjectType.Solid;
            }
            else if (component.GetType() == typeof(SkinnedMeshRenderer))
            {
                if (base.GetComponent <Cloth>() != null)
                {
                    this.m_type = ObjectType.Cloth;
                }
                else
                {
                    this.m_type = ObjectType.Skinned;
                }
            }
            AmplifyMotionEffectBase.RegisterObject(this);
        }
        return(component != null);
    }
Ejemplo n.º 2
0
 // Token: 0x06000964 RID: 2404 RVA: 0x00049DDC File Offset: 0x00047FDC
 internal static void TryRegister(GameObject gameObj, bool autoReg)
 {
     if (AmplifyMotionEffectBase.CanRegister(gameObj, autoReg) && gameObj.GetComponent <AmplifyMotionObjectBase>() == null)
     {
         AmplifyMotionObjectBase.ApplyToChildren = false;
         gameObj.AddComponent <AmplifyMotionObjectBase>();
         AmplifyMotionObjectBase.ApplyToChildren = true;
     }
 }
Ejemplo n.º 3
0
    bool InitializeType()
    {
        Renderer renderer = GetComponent <Renderer>();

        if (AmplifyMotionEffectBase.CanRegister(gameObject, false))
        {
                #if !UNITY_PRE_5_3
            ParticleSystem particleRenderer = GetComponent <ParticleSystem>();
            if (particleRenderer != null)
            {
                m_type = AmplifyMotion.ObjectType.Particle;
                AmplifyMotionEffectBase.RegisterObject(this);
            }
            else
                #endif
            if (renderer != null)
            {
                // At this point, Renderer is guaranteed to be one of the following
                if (renderer.GetType() == typeof(MeshRenderer))
                {
                    m_type = AmplifyMotion.ObjectType.Solid;
                }
                        #if UNITY_4
                else if (renderer.GetType() == typeof(ClothRenderer))
                {
                    m_type = AmplifyMotion.ObjectType.Cloth;
                }
                        #endif
                else if (renderer.GetType() == typeof(SkinnedMeshRenderer))
                {
                                #if !UNITY_4
                    if (GetComponent <Cloth>() != null)
                    {
                        m_type = AmplifyMotion.ObjectType.Cloth;
                    }
                    else
                                #endif
                    m_type = AmplifyMotion.ObjectType.Skinned;
                }

                AmplifyMotionEffectBase.RegisterObject(this);
            }
        }

        // No renderer? disable it, it is here just for adding children
        return(renderer != null);
    }