Пример #1
0
 public void AddElement(string value)
 {
     string[] arr = GetModel <string[]>();
     Algs.IncreseArray(ref arr, arr.Length + 1);
     arr[arr.Length - 1] = value;
     SetModel(arr);
 }
Пример #2
0
    public void Fire(IShot shot, Vector3 start, Vector3 dir, float speed, float lifeTime, ShipController friend)
    {
        if (count == shots.Length)
        {
            int l  = shots.Length;
            int wl = shots.Length * 2 + 1;
            Algs.IncreseArray(ref shots, wl);
            Algs.IncreseArray(ref verts, wl * size);
            Algs.IncreseArray(ref uvs, wl * size);

            for (int i = l; i < wl; i++)
            {
                shots[i] = new SShot();
            }
        }

        shots[count].pos      = start;
        shots[count].back     = shots[count].pos;
        shots[count].velocity = dir * speed;
        shots[count].dead     = Time.time + lifeTime;
        shots[count].friend   = friend;
        shots[count].shot     = shot;
        count++;
    }