Ejemplo n.º 1
0
	void Start () 
	{
		prefAnimation.onClick.AddListener (clickPref);
		nextAnimation.onClick.AddListener(clickNext);


		animation1 = model1.GetComponent("MD2Model") as MD2Model;
		animation2 = model2.GetComponent("MD2Model") as MD2Model;
		animation3 = model3.GetComponent("MD2Model") as MD2Model;

		if (!animation1) 
		{
			Debug.LogError("game object dont have md2");
		}
		if (!animation2) 
		{
			Debug.LogError("game object dont have md2");
		}
		if (!animation3) 
		{
			Debug.LogError("game object dont have md2");
		}

	}
 /// <summary>
 /// Initiates loading of the model through the content pipeline using
 /// the content importer and processor.  Also loads texture through
 /// content pipeline. (Must use an XNA friendly texture format like
 /// *.tga, *.png, *.bmp, *.jpg. Native Quake *.pcx files won't load.
 /// </summary>
 /// <param name="graphics">Graphics device handle needed to initialize vertex buffer.</param>
 /// <param name="model">Name of model and file path.</param>
 /// <param name="skin">Name of texture and file path.</param>
 /// <param name="content">Content manager object for loading through pipeline.</param>
 public void LoadModel(GraphicsDevice graphics, string model, 
     string skin, ContentManager content)
 {
     md2         = content.Load<MD2Model>(model);
     numFaces    = md2.numFaces;
     texture     = content.Load<Texture2D>(skin);
     InitializeVertexBuffer(graphics);
 }