示例#1
0
    void InstReceiver(float x, float y, List <string> time, int num)
    {
        GameObject temp = Instantiate(ReceiverPrefab);

        temp.name = "Reciever" + num;
        Receiver _receiver = temp.GetComponent <Receiver> ();

        _receiver.X    = x;
        _receiver.Y    = y;
        _receiver.Time = new List <float>();
        for (int i = num; i < time.Count; i += 3)
        {
            _receiver.Time.Add(float.Parse(time [i]));
        }
        _receiver.CalculateDist();
        temp.transform.position = new Vector3(x, y, 0);
        Receivers.Add(temp);
    }