Exemplo n.º 1
0
    private int setBalance(string account, int value)
    {
        verifyAccount(account);
        accounts[account] = value;
        Transaction trans = new Transaction(TransactionType.Update, value, null, account);

        onTransaction.Invoke(trans);
        return(value);
    }
Exemplo n.º 2
0
    void SpawnObject()
    {
        if (!spawnerBlocked)
        {
            var coin = Instantiate(ObjectToSpawn, transform);
            coin.transform.position = SpawnLocation.position;
            coin.transform.rotation = SpawnLocation.rotation;

            var coinRigidbody = coin.GetComponent <Rigidbody>();

            coinRigidbody.angularVelocity =
                Random.Range(-angularVelocityJitter, angularVelocityJitter) * coin.transform.up;

            coinRigidbody.velocity =
                coin.transform.forward * Random.Range(-velocityJitter, velocityJitter)
                +
                coin.transform.right * Random.Range(-velocityJitter, velocityJitter)
            ;


            OnSpawnCoin.Invoke();
        }
    }
Exemplo n.º 3
0
    private void OnCollisionEnter(Collision other)
    {
        Destroy(other.gameObject);

        OnDestroyCoin.Invoke();
    }