Ejemplo n.º 1
0
 public void Awake()
 {
     if (m_vtm == null)
     {
         m_vtm = GetComponent <VertExmotion>();
     }
 }
Ejemplo n.º 2
0
        void Start()
        {
            if (m_vtm == null)
            {
                m_vtm = GetComponent <VertExmotion>();
            }

            if (m_vtm == null)
            {
                //there's no VertExmotion component, let's add it
                m_vtm            = gameObject.AddComponent <VertExmotion>();
                m_vtm.m_editMode = false;//close edition pannel

                //set the paint data
                MeshFilter mf = GetComponent <MeshFilter>();
                m_vtm.m_vertexColors = new Color32[mf.sharedMesh.vertexCount];
                for (int i = 0; i < m_vtm.m_vertexColors.Length; ++i)
                {
                    m_vtm.m_vertexColors[i] = Color.white;//set the weight to 1 on each channel
                }
                mf.mesh.colors32 = m_vtm.m_vertexColors;
            }

            for (int i = 0; i < m_sensorCount; ++i)
            {
                CreateSensor();
            }
        }
Ejemplo n.º 3
0
        void Awake()
        {
            m_vtm              = GetComponent <VertExmotion>();
            m_selfCollider     = GetComponent <SphereCollider>();
            m_collisionSensors = new List <VertExmotionSensorBase>();
            m_rigidbody        = GetComponent <Rigidbody>();

            m_fallingSensor = m_vtm.CreateSensor("Falling");
            m_fallingSensor.m_params.translation.motionFactor = 0f;//disable wobble FX on falling sensors
            m_vtm.AddSensor(m_fallingSensor);
        }
Ejemplo n.º 4
0
        public void ChangeTarget(VertExmotion newtarget)
        {
            if (m_target != null)
            {
                m_target.m_VertExmotionSensors.Remove(m_sensor);
            }

            m_target = newtarget;

            if (m_target != null)
            {
                m_target.m_VertExmotionSensors.Add(m_sensor);
            }
        }
Ejemplo n.º 5
0
 void Start()
 {
     m_vtm = GetComponent <VertExmotion>();
 }