private void Start() { Playermovement = GetComponent <Playermovement>(); coin = GameObject.Find("score").GetComponent <coin>(); score = GameObject.Find("score").GetComponent <score>(); highscore = GameObject.Find("score").GetComponent <highscore>(); }
public static void load_ddls() { //coin statistic string[] files = System.IO.Directory.GetFiles(Application.StartupPath + PATH_STATISTICS, "*.dll"); foreach (var f in files) { statistics.Add(Path.GetFileName(f).Replace(".dll", "")); } //miners files = System.IO.Directory.GetFiles(Application.StartupPath + PATH_MINERS, "*.dll"); foreach (var f in files) { string name = Path.GetFileName(f).Replace(".dll", ""); System.Reflection.Assembly DLL = null; if (File.Exists(f)) { DLL = System.Reflection.Assembly.LoadFile(f); if (DLL != null) { Type t = DLL.GetType(name + ".Call"); var m = t.GetMethod("get_available_miners"); if (m == null) { MessageBox.Show("Method get_available_miners was not found in " + name + ".dll"); } else { var a = Activator.CreateInstance(t); Dictionary <string, string> result = (Dictionary <string, string>)m.Invoke(a, new Object[] { }); foreach (var d in result) { miners.Add(d.Key, d.Value); } } } } else { MessageBox.Show("File " + f + " not found"); } } //coins files = System.IO.Directory.GetFiles(Application.StartupPath + PATH_COINS, "*.png"); foreach (var f in files) { string name = Path.GetFileName(f).Replace(".png", ""); string[] exp = baseFunc.base_func.explode("_", name); if (exp.Length >= 2) { coin c = new coin(); c.name = exp[0]; c.abr = exp[1]; c.file = Path.GetFileName(f); coins.Add(exp[0], c); } } }
public ActionResult DeleteConfirmed(byte id) { coin coin = db.coins.Find(id); db.coins.Remove(coin); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,coinname")] coin coin) { if (ModelState.IsValid) { db.Entry(coin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(coin)); }
void Start() { Coin = GameObject.Find("score").GetComponent <coin>(); Score = GameObject.Find("score").GetComponent <score>(); Highscore = GameObject.Find("score").GetComponent <highscore>(); rigidBody = GetComponent <Rigidbody>(); coroutine = WaitAndPrint(0.05f); StartCoroutine(coroutine); }
public ActionResult Create([Bind(Include = "id,coinname")] coin coin) { if (ModelState.IsValid) { db.coins.Add(coin); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(coin)); }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "coin") { coin asCoin = col.gameObject.GetComponent <coin>(); if (asCoin) { myBank.Deposit(asCoin.Value); } asCoin.DisposeFromCollection(); Debug.Log(myBank.Cash); } }
// GET: coins/Delete/5 public ActionResult Delete(byte?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } coin coin = db.coins.Find(id); if (coin == null) { return(HttpNotFound()); } return(View(coin)); }
IEnumerator GoalReached() { yield return(new WaitForSeconds(.8f)); if (CoinInGoal) { Debug.Log("Goal reached!!!" + Time.time); congratulations.SetActive(true); nexttut.SetActive(true); GameManager gameManager = FindObjectOfType <GameManager>(); gameManager.bGamePaused = true; player.transform.position = teleportLocation.position; coin playerCoin = player.GetComponent <coin>(); playerCoin.RespawnLocation = player.transform.position; } }
void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Coin")) { coin myCoin = collision.gameObject.GetComponent <coin>(); if (null != myCoin) { collision.gameObject.SetActive(false); score += myCoin.point; print("get Coin!"); print("my score is " + score + "!"); } } // }
public void SpawnCoins(int cherryPosition) { for (int x = 0; x < Constant.FieldWidth; x++) { for (int y = 0; y < Constant.FieldHeight; y++) { if (((x * Constant.FieldHeight) + y) != cherryPosition) { Vector2 position = PositionManager.GetPosition(x, y); GameObject c = Instantiate(_coinPrefab) as GameObject; coin bitcoin = c.GetComponent <coin>(); bitcoin._coinEvent = _coinEvent; bitcoin.X = x; bitcoin.Y = y; c.transform.localPosition = position; } } } }
public static coin drop(int coin_num, Vector3 position) { GameObject to_ins = sml_staff; if (coin_num > 10) { to_ins = mid_staff; } if (coin_num > 100) { to_ins = big_staff; } GameObject c = (GameObject)Instantiate(to_ins, position, Quaternion.Euler(Vector3.zero)); c.tag = "coin"; coin c_s = c.AddComponent <coin> (); c_s.coin_num = coin_num; return(c_s); }
public void AddCoin() { CoinsCollected++; CoinDisplay.RefreshImages(); if (bInTutorial) { CurrentObjectiveDisplay.text = "Collect three coins (" + CoinsCollected + "/3)"; if (CoinsCollected >= 3) { congratulations.SetActive(true); nextTut.SetActive(true); bGamePaused = true; player.position = teleportLocation.position; coin playerCoin = player.GetComponent <coin>(); playerCoin.RespawnLocation = player.transform.position; flicksLeft = 3; flickDisplay.text = "SHOTS " + flicksLeft.ToString(); CoinDisplay.gameObject.SetActive(true); shotCount.SetActive(true); shotsPanel.SetActive(true); } } }
void Start() { asd = this; }
void Start() { coin = GameObject.Find("score").GetComponent <coin>(); }