Update capturing frames algorithm

This commit is contained in:
nlitkowski 2021-12-19 23:14:58 +01:00
parent a57eb23733
commit 692cc5c82b
1068 changed files with 48 additions and 39 deletions

View File

@ -310,7 +310,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_groundTexture: {fileID: 2800000, guid: 3a2c3f2b4c0a7d2439f0986d7d2910fd, type: 3}
tree1: {fileID: 919132149155446097, guid: da95ac3377c9b0a4aab7d0dc9df6897b, type: 3}
tree2: {fileID: 919132149155446097, guid: f365d0b8165dee64090078bd32ea2865, type: 3}
tree1: {fileID: 919132149155446097, guid: f365d0b8165dee64090078bd32ea2865, type: 3}
tree2: {fileID: 919132149155446097, guid: da95ac3377c9b0a4aab7d0dc9df6897b, type: 3}
tree3: {fileID: 919132149155446097, guid: 95a1be15bb6b7fb4d84b724ff227966c, type: 3}
renderedTrees: []

View File

@ -344,9 +344,10 @@ public class Main : MonoBehaviour
RenderTexture.active = currentRT;
++FrameCounter;
string path = Path.Combine(Application.dataPath, "..", "..", "capturedframe", "capturedframe" + "_" + tree1.name + "_" + FrameCounter.ToString() + ".png");
byte[] bytes = offscreenTexture.EncodeToPNG();
File.WriteAllBytes(Application.dataPath + "/capturedframe/capturedframe" + FrameCounter.ToString() + ".png", bytes);
Debug.Log(Application.dataPath + "/capturedframe/capturedframe" + FrameCounter.ToString() + ".png");
File.WriteAllBytes(path, bytes);
Debug.Log(path);
UnityEngine.Object.Destroy(offscreenTexture);
@ -359,8 +360,20 @@ public class Main : MonoBehaviour
GameObject SelectRandomTree()
{
List<GameObject> list = new List<GameObject> { tree1, tree2, tree3 };
int index = UnityEngine.Random.Range(0, list.Count - 1);
return list[index];
// parszywy kod ale nie mam teraz weny
int rnd = UnityEngine.Random.Range(0, 11);
if (rnd == 10)
{
return list[2];
}
if (rnd == 9)
{
return list[1];
}
else
{
return list[0];
}
}
#endregion
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Some files were not shown because too many files have changed in this diff Show More