Exemplo n.º 1
0
    public Text AddText(string str, Dialogue pannel, EType type, EMaterial material, ETextStyle style,
                        Vector3 position, float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
    {
        // To cache in pool (or reuse instances)
        Text text = new Text(_fonts[0], style, 40, str);

        // Number of composites needed
        int strlen = (str == null ? 0 : str.Length);

        if (style == ETextStyle.SHADOW)
        {
            strlen *= 2;
        }

        AddComposites(text, strlen, type, material);
        text.Material = material;
        text.pannel   = pannel;

        text.CopyData(null, type, material, position, speed, angle, acc, ang_vec);

        PullAdd(text);
        SetupBullet(text);

        // Add the bullet to active list
        text.Active = true;
        _active.Add(text);

        return(text);
    }
Exemplo n.º 2
0
    public Bullet AddBullet(Sprite sprite, EType type, EMaterial material, Color32 color, Vector3 position, Vector3 scale,
                            float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
    {
        Bullet bullet = PullBullet(type, material);

        bullet.CopyData(sprite, type, material, color, position, scale, speed, angle, acc, ang_vec);

        if (type == EType.NIGHTMARE || type == EType.DREAM)
        {
            //bullet.Position.z = Layering.Bullet;
            StartCoroutine(bullet._Appear(0.5f));
        }

        // Update some of the bullet data
        if (sprite != null)
        {
            bullet.UVs    = sprite.rect;
            bullet.Bounds = sprite.bounds;
        }

        SetupBullet(bullet);

        // Add the bullet to active list
        bullet.Active = true;
        _active.Add(bullet);

        return(bullet);
    }
Exemplo n.º 3
0
    public Bullet AddBullet(Sprite sprite, EType type, EMaterial material, Vector3 position, float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
    {
        Bullet bullet = AddBullet(sprite, type, material);

        bullet.CopyData(sprite, type, material, position, speed, angle, acc, ang_vec);
        return(bullet);
    }
Exemplo n.º 4
0
 public void ChangeBulletAppearance(Bullet bullet, Sprite sprite, EMaterial material)
 {
     bullet.Bounds   = sprite.bounds;
     bullet.UVs      = sprite.rect;
     bullet.Material = material;
     SetupBullet(bullet);
 }
Exemplo n.º 5
0
 public Bullet ChangeBulletAppearance(Bullet bullet, Sprite sprite, EMaterial material)
 {
     CleanBullet(bullet);
     bullet.Bounds   = sprite.bounds;
     bullet.UVs      = sprite.rect;
     bullet.Material = material;
     SetupBullet(bullet);
     return(bullet);
 }
Exemplo n.º 6
0
 public string InstMaterial(EMaterial Material, string Usuario)
 {
     try
     {
         return(Data.InstMaterial(Material, Usuario));
     }
     catch (Exception Exception)
     {
         throw Exception;
     }
 }
 public void InstMaterial(EMaterial Material)
 {
     try
     {
         var Usuario = Authentication.UserLogued.Usuario;
         Material.Empresa.Id = Authentication.UserLogued.Empresa.Id;
         Utils.WriteMessage(Mantenimiento.InstMaterial(Material, Usuario));
     }
     catch (Exception Exception)
     {
         Utils.Write(
             ResponseType.JSON,
             "{ Code: 2, ErrorMessage: \"" + Exception.Message + "\" }"
             );
     }
 }
Exemplo n.º 8
0
        public List <EMaterial> FiltroProducto(string filtro, int Empresa)
        {
            List <EMaterial> lUbigeo = new List <EMaterial>();

            using (var Connection = GetConnection(this.BaseDeDatos))
            {
                try
                {
                    Connection.Open();
                    SetQuery("LOG_BusquedaMaterial");
                    CreateHelper(Connection);
                    AddInParameter("@Filltro", filtro);
                    AddInParameter("@IdEmpresa", Empresa);
                    using (var Reader = ExecuteReader())
                    {
                        while (Reader.Read())
                        {
                            EMaterial obj = new EMaterial();
                            obj.IdMaterial       = int.Parse(Reader["iIdMat"].ToString());
                            obj.Nombre           = Reader["sNomMaterial"].ToString(); //documento
                            obj.Codigo           = Reader["sCodMaterial"].ToString(); //
                            obj.PrecioCompra     = float.Parse(Reader["fPrecioCompra"].ToString());
                            obj.PrecioVenta      = float.Parse(Reader["fPrecioVenta"].ToString());
                            obj.Categoria.Nombre = Reader["Categoria"].ToString();
                            obj.Marca.Nombre     = Reader["Marca"].ToString();
                            obj.Unidad.Nombre    = Reader["Unidad"].ToString();
                            obj.Descuento        = double.Parse(Reader["descuento"].ToString());
                            obj.PrecioUnidad     = float.Parse(Reader["nUnidad"].ToString());
                            obj.PrecioDocena     = float.Parse(Reader["nDocena"].ToString());
                            obj.PrecioCaja       = float.Parse(Reader["ncaja"].ToString());
                            lUbigeo.Add(obj);
                        }
                    }
                }
                catch (Exception Exception)
                {
                    throw Exception;
                }
                finally
                {
                    Connection.Close();
                }
            }
            return(lUbigeo);
        }
Exemplo n.º 9
0
    public Bullet AddBullet(Sprite sprite, EType type, EMaterial material)
    {
        Bullet bullet = PullBullet(type, material);

        // Update some of the bullet data
        if (sprite != null)
        {
            bullet.UVs    = sprite.rect;
            bullet.Bounds = sprite.bounds;
        }

        SetupBullet(bullet);

        // Add the bullet to active list
        bullet.Active = true;
        _active.Add(bullet);

        return(bullet);
    }
Exemplo n.º 10
0
    public void CopyData(Sprite sprite, EType type, EMaterial material,
                         Vector3 position, float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
    {
        Position         = position;
        PreviousPosition = position;
        Direction        = new Vector3(0, 0);
        Sprite           = sprite;
        Type             = type;
        Material         = material;
        Speed            = speed;
        Angle            = angle;
        Acceleration     = acc;
        AngularVelocity  = ang_vec;

        if (sprite != null)
        {
            UVs    = sprite.rect;
            Bounds = sprite.bounds;
        }
    }
Exemplo n.º 11
0
    public Bullet PullBullet(EType type, EMaterial material)
    {
        if (_available.Count == 0)
        {
            Debug.LogWarning("No available quads, failed to add bullet");
            return(null);
        }

        int    index  = _available.Dequeue();
        Bullet bullet = _bullets[index];

        // Get an available Index and set Time to 0
        bullet.Index       = index;
        bullet.CurrentTime = 0;

        bullet.Type     = type;
        bullet.Material = material;

        return(bullet);
    }
Exemplo n.º 12
0
    public void AddComposites(Composite composite, int size, EType type, EMaterial material, Sprite sprite = null)
    {
        if (_available.Count < 0)
        {
            Debug.LogWarning("No available quads, failed to add bullet");
            return;
        }

        composite._composites = new Bullet[size]; // New here :(

        int index = _active.Count;

        for (int i = 0; i < size; ++i)
        {
            Bullet bullet = AddBullet(sprite, type, material);
            bullet.Owner             = EOwner.GROUP;
            composite._composites[i] = bullet;
        }

        composite._nb_composites = size;
    }
Exemplo n.º 13
0
        private static void AddMaterial(string pName, float pR, float pG, float pB, EMaterial pType = EMaterial.None)
        {
            Material mat = new Material(pName);

            mat.DiffuseReflectivity = new Color(pR, pG, pB);
            materials.MaterialList.Add(mat);
            int newMatIndex = materials.MaterialList.Count - 1;

            if (pType != EMaterial.None)
            {
                if (materialSet.ContainsKey(pType))
                {
                    materialSet[pType].Add(newMatIndex);
                }
                else
                {
                    materialSet.Add(pType, new List <int> {
                        newMatIndex
                    });
                }
            }
        }
Exemplo n.º 14
0
    public Laser AddLaser(Sprite sprite, EType type, EMaterial material, BezierCurve curve, int num_segments, float length, float width,
                          Vector3 position, float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
    {
        // To cache in pool (surely)
        Laser laser = new Laser(curve, length, width);

        AddComposites(laser, num_segments, type, material, sprite);
        PullAdd(laser);

        laser.CopyData(sprite, type, material, position, speed, angle, acc, ang_vec);
        for (int i = 0; i < num_segments; ++i)
        {
            laser._composites[i].CopyData(sprite, type, material, Vector3.zero, speed, angle);
        }

        // Update laser once (vertices)
        laser.SetupVertices(_vertices[0], _colors[0]); // To update

        // Add the bullet to active list
        laser.Active = true;
        _active.Add(laser);

        return(laser);
    }
Exemplo n.º 15
0
 /// <summary>
 /// Constructor que permite instanciar una cinta métrica.Se usa en el test consola y en el form.
 /// </summary>
 /// <param name="distribuidor">Distribuidor del producto.</param>
 /// <param name="precio">Precio del producto</param>
 /// <param name="origen">Origen del producto.</param>
 /// <param name="largoCinta">Longitud de la cinta.</param>
 /// <param name="material">Material de la cinta.</param>
 public CintaMetrica(EDistribuidor distribuidor, float precio, EOrigen origen, ELargoCintaMts largoCinta, EMaterial material)
     : this(distribuidor, precio, origen)
 {
     this.largoCinta = largoCinta;
     this.material   = material;
 }
 private void radUpper_Checked(object sender, RoutedEventArgs e)
 {
     eMats = EMaterial.Upper;
 }
 private void radOutsole_Checked(object sender, RoutedEventArgs e)
 {
     eMats = EMaterial.Outsole;
 }
Exemplo n.º 18
0
        public static Material GetPointsMaterial(EClass pClass)
        {
            EMaterial material = GetClassMaterial(pClass);

            return(materials.MaterialList[materialSet[material][0]]);
        }
Exemplo n.º 19
0
 public static string Name(this EMaterial material)
 {
     return("");
 }
Exemplo n.º 20
0
 /// <summary>
 /// Constructor de la clase.
 /// </summary>
 /// <param name="distribuidor">Distribuidor de la herramineta.</param>
 /// <param name="precio">Precio de la herramienta.</param>
 /// <param name="origen">Origen de la escalera.</param>
 /// <param name="tamaño">Tamaño de la escalera de tipo enumerado.</param>
 /// <param name="material">Material de la escalera de tipo enumerado.</param>
 public Escalera(EDistribuidor distribuidor, float precio, EOrigen origen, ETamaño tamaño, EMaterial material)
     : this(distribuidor, precio, origen)
 {
     this.tamaño   = tamaño;
     this.material = material;
 }
Exemplo n.º 21
0
 private static void AddMaterial(string pName, float pColorIntensity, EMaterial pType = EMaterial.None)
 {
     AddMaterial(pName, pColorIntensity, pColorIntensity, pColorIntensity, pType);
 }
Exemplo n.º 22
0
 public Bazar(int id, string nombre, string marca, double precioUnitario, EMaterial material) : base(id, nombre, marca, precioUnitario)
 {
     this.material = material;
 }
Exemplo n.º 23
0
 /// <summary>
 /// Creates the entity with id, name and material.
 /// </summary>
 /// <param name="id">ID of the entity.</param>
 /// <param name="name">Name of the entity.</param>
 /// <param name="material">Material of the entity.</param>
 public Product(string name, EMaterial material) : this()
 {
     this.NameProduct     = name;
     this.MaterialProduct = material;
 }
Exemplo n.º 24
0
 public void SetMaterial(EMaterial s)
 {
     _material = s;
 }
Exemplo n.º 25
0
 public Bullet AddBullet(Sprite sprite, EType type, EMaterial material, Color32 color, Vector3 position,
                         float speed = 0, float angle = 0, float acc = 0, float ang_vec = 0)
 {
     return(AddBullet(sprite, type, material, color, position, Vector3.one, speed, angle, acc, ang_vec));
 }
Exemplo n.º 26
0
 /// <summary>
 /// Creates the instance with the name of the piece and its material
 /// </summary>
 /// <param name="pieceType">Name of the entity.</param>
 /// <param name="metalType">Type of metal of the entity</param>
 /// <param name="material">Material of the entity</param>
 /// <param name="materials">Dictionary of materials Bucket</param>
 public RobotPiece(EPieceType pieceType, EMetalType metalType, EMaterial material, List <MaterialBucket> materials)
     : this(pieceType, metalType, material)
 {
     this.materials = materials;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Creates the instance with the name of the piece and its material
 /// </summary>
 /// <param name="pieceType">Name of the entity.</param>
 /// <param name="metalType">Type of metal of the entity</param>
 /// <param name="material">Material of the entity</param>
 public RobotPiece(EPieceType pieceType, EMetalType metalType, EMaterial material) : base(pieceType.ToString(), material)
 {
     this.materials = new List <MaterialBucket>();
     this.metalType = metalType;
     this.PieceType = pieceType;
 }
Exemplo n.º 28
0
 public Bullet AddBullet(Sprite sprite, EType type, EMaterial material, Color32 color)
 {
     return(AddBullet(sprite, type, material, color, Vector3.zero));
 }