Inheritance: MonoBehaviour
Example #1
0
	void OnTriggerEnter(Collider other){
		
		FootstepSurface newobject = other.GetComponent<FootstepSurface> ();
		
		if(newobject != null){
			
			if(m_StandingOn == null){
				m_StandingOn = newobject;
			}
			if(m_StandingOn.m_Priority <= newobject.m_Priority){
				m_StandingOn = newobject;
			}
			
			if(m_StandingOn.m_UseFootstepSurface){
				m_Parameter.setValue(m_StandingOn.m_Surface);
			}

			else if (surfaceTexture != null) {
				//modified by peter
				float temp;
				if(surfaceTexture.m_SurfaceType < 2){
					temp = surfaceTexture.m_SurfaceType;
				}
				else temp = 2;
				m_Parameter.setValue(temp);
			}
		}
	}
Example #2
0
	//when the foot leaves the ground we can once again take a step
	void OnTriggerExit(Collider other){
		if(other.GetComponent<FootstepSurface>() != null){
			if(m_StandingOn == other.GetComponent<FootstepSurface>())
			{
				m_StandingOn = null;
			}
		}
	}