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); }
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); }
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); }
public void ChangeBulletAppearance(Bullet bullet, Sprite sprite, EMaterial material) { bullet.Bounds = sprite.bounds; bullet.UVs = sprite.rect; bullet.Material = material; SetupBullet(bullet); }
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); }
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 + "\" }" ); } }
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); }
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); }
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; } }
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); }
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; }
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 }); } } }
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); }
/// <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; }
public static Material GetPointsMaterial(EClass pClass) { EMaterial material = GetClassMaterial(pClass); return(materials.MaterialList[materialSet[material][0]]); }
public static string Name(this EMaterial material) { return(""); }
/// <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; }
private static void AddMaterial(string pName, float pColorIntensity, EMaterial pType = EMaterial.None) { AddMaterial(pName, pColorIntensity, pColorIntensity, pColorIntensity, pType); }
public Bazar(int id, string nombre, string marca, double precioUnitario, EMaterial material) : base(id, nombre, marca, precioUnitario) { this.material = material; }
/// <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; }
public void SetMaterial(EMaterial s) { _material = s; }
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)); }
/// <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; }
/// <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; }
public Bullet AddBullet(Sprite sprite, EType type, EMaterial material, Color32 color) { return(AddBullet(sprite, type, material, color, Vector3.zero)); }