// Use this for initialization void Start() { anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); _spriteRenderer = GetComponent <SpriteRenderer>(); facingRight = true; cs = GetComponent <coins>(); }
// Start is called before the first frame update void Start() { coin = gameObject.AddComponent <coins>(); //coin.changeCoins(9999); //PlayerPrefs.SetString("unlocked_planets",""); coin_value.text = "" + coin.getCoins(); showUnlockedSkins(); notifySelect(PlayerPrefs.GetString("planet_texture")); }
internal decimal GetCoinMCap(coins coinToAdd) { decimal decReturn = 0; if (coinToAdd.circulating > 0 && coinToAdd.Price > 0) { decReturn = coinToAdd.circulating * coinToAdd.Price; } return(decReturn); }
// Start is called before the first frame update protected virtual void Start() { coin = gameObject.AddComponent <coins>(); collider = gameObject.GetComponent <CircleCollider2D>(); anim = gameObject.GetComponent <Animator>(); centre = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height / 2, Camera.main.transform.position.z)); if (wavy) { Vector2 earthPos = GameObject.Find("3D Earth").transform.position - transform.position; float angle = Mathf.Atan2(earthPos.y, earthPos.x) * Mathf.Rad2Deg; Quaternion rotation = Quaternion.AngleAxis(angle, Vector3.forward); //(float)Math.Sin(transform.position.x) * Time.deltaTime transform.rotation = rotation; absPosX = 0f; } ; }
internal async Task <List <coins> > getPricesAsync() // string manipulation way of getting coin prices { string strcoin = ""; char c; int count = -1; try { indexOfCoinPrice = StringManipulation.AllIndexesOf(strCoinMcap, @"/#markets"" class=""price"" data-usd="); indexOfCirculatingSup = StringManipulation.AllIndexesOf(strCoinMcap, @"circulating-supply"); foreach (var item in indexOfCoinPrice) { coins coinToAdd = new coins("", 0); c = strCoinMcap[item + count]; while (c != '/') { strcoin += c; count--; c = strCoinMcap[item + count]; } strcoin = StringManipulation.Reverse(strcoin); coinToAdd.Name = strcoin; await Task.Run(() => coinToAdd.Volume = getVolume(strcoin)); coinToAdd.Price = GetPrice(strcoin); coinToAdd.circulating = getCirculatingSuply(strcoin); //coinToAdd.Marketcap = GetCoinMCap(coinToAdd); strcoin = ""; count = -1; coins.Add(coinToAdd); } return(coins); } catch (Exception) { return(null); } }
var(coins, change) = coinsWithChange;