OK, I am doing a C# script about dragging objects from the files to a box(drag and drop files), but the problem is that when I copy this script and save it I get 2 erros saying me:
Assets/Standard Assets/File.cs(5,47): error CS0246: The type or namespace name `DragEventArgs' could not be found. Are you missing a using directive or an assembly reference?
So I don't know what exactly is saying(I dont know what is the error) so I decide to investigate and I found I have to put System.Windows.Forms;(but I am not sure if is that) but I save it and gives me an error that that word dosent exist. Here is the script I copy:
using UnityEngine;
using System.Collections;
using System;
public class File : MonoBehaviour {
private void textBox1_DragEnter(object sender,DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Copy;
}
private void textBox1_DragDrop(object sender,DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
var objPaths = (string[])(e.Data.GetData(DataFormats.FileDrop));
if (objPaths != null && objPaths.Length > 0 && File.Exists(objPaths[0]))
{
MessageBox.Show(string.Format("Filename: {0}", objPaths[0]));
using (TextReader tr = new StreamReader(objPaths[0]))
textBox1.Text = tr.ReadToEnd();
}
}
}
}
So please could some one point me in the right direction of I need to do to solve this problem.
Thanks.. In advance.