Esempio n. 1
0
    /// <summary>
    /// Создание нового "сетевого" шара
    /// </summary>
    public void CreateOne(int id, int texId, float diam, float speed, float x)
    {
        RemoteBall rb = GameObject.CreatePrimitive(PrimitiveType.Sphere).AddComponent <RemoteBall>();

        rb.Id       = id;
        rb.TexId    = texId;
        rb.Diameter = diam;
        rb.Speed    = speed;
        rb.gameObject.transform.position = new Vector3(x, 10f, 0f);
        remoteBalls.Add(rb);
    }
Esempio n. 2
0
    /// <summary>
    /// Удаление "сетевого" шара. Если новые очки больше наших, значит шар убит игроком - рисуем эффект.
    /// </summary>
    public void DestroyOne(int id, int points)
    {
        RemoteBall rBall = remoteBalls.Find(ball => ball.Id == id);

        if (points > Points)
        {
            Points = points;
            if (rBall != null)
            {
                Instantiate(LoadingManager.Smoke, rBall.gameObject.transform.position + new Vector3(0, 0, 1), Quaternion.identity);
            }
        }
        if (rBall != null)
        {
            Destroy(rBall.gameObject);
        }
    }