コード例 #1
0
ファイル: BloomScreen.cpp プロジェクト: citruslee/mutiny
void BloomScreen::onAwake()
{
  BloomCamera::create();
  playerGo = new GameObject("Player");
  playerGo->getTransform()->setPosition(Vector3(-10, 0, -10));

  MeshRenderer* playerMr = playerGo->addComponent<MeshRenderer>();
  playerMr->setMaterial(Resources::load<Material>("shaders/Internal-MeshRendererTexture"));
  playerMr->getMaterial()->setMainTexture(Resources::load<Texture2d>("models/curuthers/Whiskers_diffuse").cast<Texture>());

  arc<Mesh> mesh = Resources::load<Mesh>("models/curuthers/curuthers");
  MeshFilter* playerMf = playerGo->addComponent<MeshFilter>();
  playerMf->setMesh(mesh);
}
コード例 #2
0
ファイル: LayerScreen.cpp プロジェクト: jjiezheng/mutiny
void LayerScreen::onAwake()
{
  cameraGo = LayerCamera::create();

  playerGo = new GameObject("Player");
  //playerGo->setLayer(1 << 1);
  playerGo->getTransform()->setPosition(Vector3(0, 0, 0));

  MeshRenderer* playerMr = playerGo->addComponent<MeshRenderer>();
  playerMr->setMaterial(Resources::load<Material>("shaders/textured"));
  playerMr->getMaterial()->setMainTexture(Resources::load<Texture2d>("models/curuthers/Whiskers_diffuse"));

  Mesh* mesh = Resources::load<Mesh>("models/curuthers/curuthers");
  MeshFilter* playerMf = playerGo->addComponent<MeshFilter>();
  playerMf->setMesh(mesh);
  
  
}