В твоем случае тебе надо делать так:
function Update()
{
if(networkView.isMine)
{
if(Input.GetKeyDown(KeyCode.F5))
{
Application.CaptureScreenshot("Screenshoot.png");
StreamWriter writer = new StreamWriter("Log.txt", true)
writer.Write("Вы сделали скриншот!" + System.Environment.NewLine);
writer.Close();
}
Одновременно открыть файл для записи в нескольких местах нельзя.
либо так:
public class Logger
{
public static function Log(message:String)
{
StreamWriter writer = new StreamWriter("Log.txt", true)
writer.Write(message + System.Environment.NewLine);
writer.Close();
}
}
function Update()
{
if(networkView.isMine)
{
if(Input.GetKeyDown(KeyCode.F5))
{
Application.CaptureScreenshot("Screenshoot.png");
Logger.Log(("Вы сделали скриншот!");
}
}
}