public void setCollider(types type, frames frame) { if (frame != frames.clear) { switch ((int)type) { case (int)types.idle: localCollider.SetPath (0, idle [(int)frame].GetPath (0)); break; case (int)types.run: localCollider.SetPath (0, run [(int)frame].GetPath (0)); break; case (int)types.jump: localCollider.SetPath (0, jump [(int)frame].GetPath (0)); break; case (int)types.fall: localCollider.SetPath (0, fall [(int)frame].GetPath (0)); break; case (int)types.land: localCollider.SetPath (0, land [(int)frame].GetPath (0)); break; case (int)types.neutral_light: localCollider.SetPath (0, neutralLight [(int)frame].GetPath (0)); break; default: localCollider.SetPath (0, neutralHeavy [(int)frame].GetPath (0)); break; } return; } localCollider.pathCount = 0; }
void ChangeCursor(types type, Color color) { if (type == types.NONE) { image.enabled = false; } else { image.enabled = true; } color.a = 0.75f; image.color = color; if (type == lastType) { return; } lastType = type; switch (type) { case types.READ: image.sprite = read; break; case types.SIMPLE: image.sprite = simple; break; case types.CLICK: image.sprite = click; break; } }
void Update() { if (type == types.NORMAL) { return; } if (type == types.DASHING_FORWARD) { if (offset.z > offset_Dash_Z) { type = types.DASHING_BACK; } offset.z += Time.deltaTime * 100; } else if (type == types.DASHING_BACK) { offset.z -= Time.deltaTime * 10; } if (offset.z < 0) { offset.z = 0; type = types.NORMAL; } }
public Missile() { this.gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube); Vector3 v = Player.player.obj.transform.position; v.y += 3; v.z += 5; v.x += 5; gameObject.name = "bullet"; gameObject.transform.position = v; //gameObject.transform.localScale.Set(1, 1, 1); gameObject.GetComponent <MeshRenderer>().material.shader = Shader.Find("Standard (Vertex Color)"); gameObject.GetComponent <MeshRenderer>().material.EnableKeyword("_VERTEXCOLOR"); gameObject.GetComponent <Renderer> ().enabled = true; gameObject.AddComponent <Rigidbody> (); gameObject.GetComponent <Renderer>().material.color = new Color32(250, 200, 100, 255); // target = Player.player.obj.transform; // ifTarget = true; gameObject.transform.rotation = Player.player.obj.transform.rotation; //gameObject.transform.Rotate (Vector3.up*90); // gameObject.GetComponent<Rigidbody>().AddForce(gameObject.transform.forward * speed * Time.deltaTime); gameObject.GetComponent <Rigidbody>().velocity = (gameObject.transform.forward * speed * Time.deltaTime); gameObject.AddComponent <MissileCollision> (); gameObject.GetComponent <MissileCollision> ().missile = this; type = types.MISSILE; }
void Gil() { Events.OnSoundFXLoop("GilPowa"); powerUpGil.SetActive(true); type = types.GIL; character.PowerupActivated(type); }
private void get_token() { tok_type = 0; int j = 0; Array.Clear(token, 0, token.Length); string separator = "+-*/()"; if (exp_ptr.Length == i) { return; } if (separator.IndexOf(exp_ptr[i]) != -1) { tok_type = types.DELIMITER; token[j] = exp_ptr[i]; i++; } else if ((int)exp_ptr[i] >= 48 && (int)exp_ptr[i] <= 57) { do { token[j] = exp_ptr[i]; i++; j++; if (exp_ptr.Length == i) { break; } } while ((int)exp_ptr[i] >= 48 && (int)exp_ptr[i] <= 57); tok_type = types.NUMBER; } }
void OnCameraChroma(types type) { simpleLut.enabled = true; this.type = type; StartCoroutine(Tint(Color.red, 0.005f)); //StartCoroutine (ChangeHue (150, 1)); }
public void ChooseUpgrade(types index) { switch (index) { case types.HP: FindObjectOfType <UI>().SetHp(FindObjectOfType <Player>().hp, true); FindObjectOfType <Player>().maxHp += 1; FindObjectOfType <Player>().hp += 1; break; case types.Attack: FindObjectOfType <UI>().SetAttack(FindObjectOfType <Player>().attack, true); FindObjectOfType <Player>().attack += 1; break; case types.AttackSpeed: FindObjectOfType <UI>().SetAttackSpeed(FindObjectOfType <Player>().attackSpeed, true); FindObjectOfType <Player>().attackSpeed += 1; FindObjectOfType <Light>().SetAttackSpeed(FindObjectOfType <Player>().attackSpeed); break; } foreach (Transform t in transform) { Destroy(t.gameObject); } FindObjectOfType <GameManager>().StartGame(); }
public void AddNewArgument(types type) { AmiArgument newArg = new AmiArgument(); newArg.type = type; argumentValues.Add(newArg); }
public Chambre(int numero, types type, categories categories, int prix) { this.numero = numero; this.type = type; this.categories = categories; this.prix = prix; }
void OnHeroPowerUpOff() { PlayParticles(); character.Idle(); Debug.Log("OnHeroPowerUpOff termino : " + type); Events.OnSoundFX("PowerUpOff"); if (type == types.MOTO) { Events.OnSoundFXLoop(""); character.OnSetHeroState(true); if (powerUp != null) { Destroy(powerUp.gameObject); } Events.OnResetSpeed(); } else if (type == types.GIL) { Events.OnSoundFXLoop(""); powerUpGil.SetActive(false); } character.hero.ResetState(); character.Jump("pungaJump"); type = types.NONE; }
private void SpellButton_MouseDown(object sender, MouseEventArgs e) { rnd = new Random(); timer = 0; adv = comboBoxAdvantage.SelectedIndex; th = player.SpellAttackModifier; dice = player.Spells[Spells.SelectedIndex].DiceType; nodice = player.Spells[Spells.SelectedIndex].DiceNumber; mod = player.Spells[Spells.SelectedIndex].DamageModifier; type = player.Spells[Spells.SelectedIndex].DamageType; DC = player.SpellSaveDC; save = player.Spells[Spells.SelectedIndex].AttackSave; textBoxAtkRoll.Text = ""; textBoxDmgRoll.Text = ""; textBoxSaveRoll.Text = ""; if (monster == null) { return; } else if (player.Spells[Spells.SelectedIndex].AlwaysHits) { damageRoll(false, false); checkDeadness(int.Parse(HP.Text)); } else if (save == 0) { timer1.Start(); } else { timer2.Start(); } }
public void ChangeType(types newType, int id) { Transform container = GetContainer(id); Utils.RemoveAllChildsIn(container); Defender defender = null; switch (newType) { case types.BOW_ATTACK: defender = defenderBow; break; case types.SOLDIERS: return; //defender = defenderZone; break; } Defender newDefender = Instantiate(defender); newDefender.transform.SetParent(container); newDefender.transform.localEulerAngles = Vector3.zero; newDefender.transform.localPosition = Vector3.zero; }
void Gil() { Events.OnSoundFXLoop("GilPowa"); powerUpGil.SetActive(true); type = types.GIL; character.PowerupActivated(type); }
void OnPowerUpOn(int powerUpActive) { tutorialPanel.SetActive(true); if (playerId > 2) { tutorialPanel.transform.localScale = new Vector3(-1, 1, 1); } panel.SetActive(true); bar.gameObject.SetActive(true); switch (powerUpActive) { case 1: type = types.BOOST; BoostAsset.gameObject.SetActive(true); tutorialField.text = "BOOST"; break; case 2: type = types.PAUSE_ME; PauseMeAsset.gameObject.SetActive(true); tutorialField.text = "DON'T TAP"; break; case 3: type = types.PAUSE_OTHERS; PauseOthersAsset.gameObject.SetActive(true); tutorialField.text = "TROLL"; break; } iTween.ValueTo(gameObject, iTween.Hash( "from", 0, "to", 1, "time", timeToReset, "onupdate", "OnBarUpdate", "oncomplete", "OnBarComplete" )); }
public Chambre() { this.numero = 0; this.type = types.Individuelle; this.categories = categories.Confort; this.prix = 0; }
// Use this for initialization void Start() { type = types.AFONSO; state = 1; ok = false; inited = false; }
void OnTutorial(types type, System.Action OnDone) { panel.SetActive(true); this.OnDone = OnDone; Reset(); GetTutorial(type).panel.SetActive(true); }
public void setCollider(types type, frames frame) { if (frame != frames.clear) { switch ((int)type) { case (int)types.idle: localCollider.SetPath(0, idle[(int)frame].GetPath(0)); break; case (int)types.run: localCollider.SetPath(0, run[(int)frame].GetPath(0)); break; case (int)types.neutral_light: localCollider.SetPath(0, neutralLight[(int)frame].GetPath(0)); break; default: localCollider.SetPath(0, neutralHeavy[(int)frame].GetPath(0)); break; } return; } localCollider.pathCount = 0; }
public void DashForward() { if (type == types.NORMAL) { type = types.DASHING_FORWARD; cb.madRoller.Play("dashForward"); } }
internal figure(types type, bool isFill, float width, Color color, Point point) : base(width, color, point) { _type = type; _x = point.X; _y = point.Y; _isFill = isFill; }
//public View() //{ // _elements = new SortedList<string, Element>(); //} //public View(string name) //{ // this._name = name; // _elements = new SortedList<string, Element>(); //} public View(string name, int width, int height) { typeOfView = GetType(name); _name = name; this.width = width; this.height = height; _elements = new SortedList <string, Element>(); }
bool isThisHand(types _type) { if (this.type == _type) { return(true); } return(false); }
public void Create(float pUsage, float mProduction, float bTime, float adjFactor, types t) { powerUsage = pUsage; buildTime = bTime; buildTimeLeft = bTime; state = states.Building; type = t; }
public ItemTOC(types T, int o, int c) { type = T; opened = o; closed = c; ord = (int)type; label = labels[ord]; }
//Overloaded constructor public Piece(teams team, types type, Vector2 position) { Team = team; Type = type; Position = position; DrawPosition = position; MovedInTurn = 0; }
public static AbstractDAOFactory getFactory(types type) { if (type.Equals(types.SQL_FACTORY)) { return(new SQLFactory()); } return(null); }
public void Idle(types _type) { if (!isThisHand(_type) || state == states.IDLE) { return; } state = states.IDLE; anim.Play("idle"); }
public void Pointer(types _type) { if (!isThisHand(_type) || state == states.POINTER) { return; } state = states.POINTER; anim.Play("pointer"); }
public void Grab(types _type) { if (!isThisHand(_type) || state == states.GRAB) { return; } state = states.GRAB; anim.Play("grab"); }
public Card(int value, Vector3 position, GameObject prefab, types cardType, state cardState) { active = true; this.value = value; this.cardType = cardType; this.cardState = cardState; this.position = position; gameObject = GameObject.Instantiate(prefab, position, Quaternion.identity); }
public void Notify(string m, string c, types type) { this.m = m; this.c = c; t = type; Thread a = new Thread(dummyThread); a.Start(); }
/// <summary> /// Create a new media item with the type and tracknumber. /// The reason for not collecting all info in the constructor is that it gets /// ripped out of the database consequitively. /// </summary> /// <param name="type">Media Type</param> /// <param name="tracknum">Track Number</param> public MediaItem(types type, long tracknum) { this.title = null; this.filename = null; this.album = null; this.artist = null; this.type = type; this.trackid = tracknum; }
void Moto() { type = types.MOTO; powerUp = Instantiate(powerUp1) as PowerUpOn; powerUp.transform.SetParent(powerUpsContainer.transform); powerUp.transform.localScale = Vector3.one; powerUp.transform.localPosition = Vector3.zero; powerUp.Init(10); character.OnSetHeroState(false); Events.OnChangeSpeed(2, true); }
void OnPowerUp(types newType) { if (type != types.SORETE) return; // Events.OnBarInit(newType); Events.OnSoundFX("PowerUpItem"); switch (newType) { case types.SORETE: //Moto(); break; } }
public void adaptCollider() { if (typeImport != "") { typeImport = typeList.ToString(); } foreach (KeyValuePair<string, types> _obj in dicoEnv) { if(typeImport == _obj.Key) { typeList = _obj.Value; } } }
/// <summary> /// Constructor for AddPoly. /// </summary> /// <param name="accRobot">Whether or not previous AddPoly had checked this</param> /// <param name="field">mainField from GUI. Need this to check for reduntant names</param> /// <param name="subfields">List of names of subfields from GUI. Need this to check for reduntant names</param> public AddPoly(bool accRobot, List<string> w, List<string> o, List<string> r, List<string> f) { InitializeComponent(); drawType = types.none; finished = false; this.accRobot = accRobot; AccRobot.Checked = accRobot; items = new List<string>[] { w, o, r, f}; AccRobot.Hide(); ErrorName.Hide(); ErrorType.Hide(); ErrorName2.Hide(); }
void OnSetSpecialItem(int _id, bool active) { if (active) { if (_id < 100) type = types.CASCO; else type = types.TRANSPORT; this.id = _id; } else { Events.OnResetSpeed(); type = types.NONE; this.id = 0; } }
//private static function loadImage(file: String, origDimensions: Vector2, dimensions: Vector2): ColorStorage public override vectorx.ColorStorage loadImage(string file, types.Vector2 srcDim, types.Vector2 dstDim) { if (!file.EndsWith(".svg")) { return GetBitmapDataFromFile (file); } var colorStorage = new vectorx.ColorStorage ((int)dstDim.x, (int)dstDim.y, null); var asset = Resources.Load(file) as TextAsset; var xml = Xml.parse (asset.text); var svg = vectorx.svg.SvgContext.parseSvg (xml); var scaleX = dstDim.x / srcDim.x; var scaleY = dstDim.y / srcDim.y; var transform = lib.ha.core.geometry.AffineTransformer.scaler (scaleX, scaleY); var svgContext = new vectorx.svg.SvgContext (); svgContext.renderVectorBinToColorStorage (svg, colorStorage, transform); return colorStorage; }
public static void addLog(types type, string prefix, string text, string errorInfo) { if (type == types.OK) { m_type = "OK"; } else if (type == types.WARNING) { m_type = "Warning"; } else if (type == types.ERROR) { m_type = "Error"; } else { m_type = "Undefined"; } //std::cout << "<" + m_type + "> " + "[" + prefix + "] " + text + " Info: " + errorInfo << std::endl; //logMessages.push_back("<" + m_type + "> " + "[" + prefix + "] " + text + " Info:" + errorInfo); Console.WriteLine("<" + m_type + "> " + "[" + prefix + "] " + text + " Info: " + errorInfo); }
static void Main(string[] args) { AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); if (args.Length < 2) { if (args[1] == "vmware") { running = true; type = types.Vmware; } else if (args[1] == "broche") { running = true; type = types.Broche; } else { throw new ArgumentNullException("Not a correct argument"); } } Debugger.Run(); }
public MapObject() { this.type = types.WALL; this.row = 0; this.col = 0; }
public void updateType(types type, short value) { tx((byte)type, value); }
public questionClassifier(String ip) { ip = ip.Trim(); opText = ip; ipType = getSentenceType(); }
private void Wall_Click(object sender, EventArgs e) { drawType = types.walls; AccRobot.Show(); }
AssertEquals(types[0], Float.class);
public void ChallengesReceived() { infoLoaded = true; type = types.RECEIVED; LoadData(); }
private void Region_Click(object sender, EventArgs e) { drawType = types.regions; AccRobot.Hide(); }
/// <summary> /// When Add is clicked, it switches to Done. A popup of AddPoly appears asking for /// what type of new item is desired. Then the actual drawing is commenced. /// If one wishes to stop before finishing a object, region, or field, click Stop and /// the shape will be deleted. /// If one wishes to stop creating walls, then click Stop and that set of walls will remain. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Add_Click(object sender, EventArgs e) { if (Add.Text == "Add") //Button said add so new polygon { AddPoly popup = new AddPoly(accRobot, mainField.walls.Keys.ToList<string>(), mainField.objects.Keys.ToList<string>(), mainField.regions.Keys.ToList<string>(), subFields.Keys.ToList<string>()); popup.ShowDialog(); accRobot = popup.accRobot; if (popup.finished) { Add.Text = "Stop"; rend.Tool = polyTool; newName = popup.name; drawType = popup.drawType; Ctrl_press.Show(); } popup.Dispose(); } else //Button said Stop so stop current job. { if (drawType == types.walls && newPoly.Count > 1) { double thickness = accRobot ? robotR : wallR; mainField.addWall(newName, newPoly.points, thickness); List<Polygon> comp = new List<Polygon>(); foreach (List<Polygon> p in mainField.walls.Values) { comp.AddRange(p); } wallsRend.Polygons = comp; Walls_Box.Items.Add(newName); } else if (newPoly.Count > 2) { bool intersects = false; Vector2 v2 = newPoly[0] - newPoly[newPoly.Count - 1]; DEASL.Core.Mathematics.Shapes.LineSegment line2 = new DEASL.Core.Mathematics.Shapes. LineSegment(newPoly[0] - 0.00001 * v2, newPoly[newPoly.Count - 1] + 0.00001 * v2); for (int i = 1; i < newPoly.Count; i++) { Vector2 temp; DEASL.Core.Mathematics.Shapes.LineSegment ls = new DEASL.Core.Mathematics. Shapes.LineSegment(newPoly[i], newPoly[i - 1]); if (ls.Intersect(line2, out temp)) { intersects = true; break; } } if (intersects) { Error intersect = new Error(errorTypes.Intersect); intersect.ShowDialog(); intersect.Dispose(); } else { AddPolygon(); } } resetParameters(); Ctrl_press.Hide(); } }
/// <summary> /// 初期化 /// </summary> /// <param name="root"></param> /// <param name="material"></param> public void Setup( SpriteRoot root, types.NodeType nodeType, Material material ) { root_ = root; root.AddPart( this ); isNull_ = nodeType == types.NodeType.kNull; if ( !isNull_ ) { // NULLノードでなければレンダラ生成 var r = new GameObject( name, typeof( SpritePartRenderer ) ); renderer_ = r.GetComponent<SpritePartRenderer>(); renderer_.material = material; root.AddSprite( renderer_ ); renderer_.Setup( this ); SetupVertices(); } keyFrames_ = new KeyFrame[root_.TotalFrames]; for ( int i = 0; i < root_.TotalFrames; ++i ) { keyFrames_[i] = KeyFrame.Create(); } }
public void Add(types a) { Add((byte)a); }
void OnPowerUp(types newType) { if (type != types.NONE) return; Events.OnBarInit(newType); Events.OnSoundFX("PowerUpItem"); switch (newType) { case types.MOTO: Moto(); break; case types.CHUMBO: Chumbo(); break; case types.GIL: Gil(); break; } PlayParticles(); }
void Chumbo() { type = types.CHUMBO; character.PowerupActivated(type); }
private void Object_Click(object sender, EventArgs e) { drawType = types.objects; AccRobot.Show(); }
public MapObject(types t, int row, int col) { this.type = t; this.row = row; this.col = col; }
private void Field_Click(object sender, EventArgs e) { drawType = types.fields; AccRobot.Hide(); }
AssertEquals(types[1], Double.class);
private void get_token() { tok_type = 0; int j = 0; Array.Clear(token, 0, token.Length); string separator = "+-*/()"; if (exp_ptr.Length == i) return; if (separator.IndexOf(exp_ptr[i]) != -1) { tok_type = types.DELIMITER; token[j] = exp_ptr[i]; i++; } else if ((int)exp_ptr[i] >= 48 && (int)exp_ptr[i] <= 57) { do { token[j] = exp_ptr[i]; i++; j++; if (exp_ptr.Length == i) break; } while ((int)exp_ptr[i] >= 48 && (int)exp_ptr[i] <= 57); tok_type = types.NUMBER; } }
void OnHeroPowerUpOff() { PlayParticles(); character.Idle(); Debug.Log("OnHeroPowerUpOff termino : " + type); Events.OnSoundFX("PowerUpOff"); if (type == types.MOTO) { Events.OnSoundFXLoop(""); character.OnSetHeroState(true); if (powerUp != null) Destroy(powerUp.gameObject); Events.OnResetSpeed(); } else if (type == types.GIL) { Events.OnSoundFXLoop(""); powerUpGil.SetActive(false); } character.hero.ResetState(); character.Jump("pungaJump"); type = types.NONE; }
public void ChallengesMade() { infoLoaded = true; type = types.MADE; LoadData(); }