Beispiel #1
0
 void LayoutCoinsOnBoard()
 {
     //looping through the x and z of our board
     for (float x = 0; x < columns; x++)
     {
         for (float z = 0; z < rows; z++)
         {
             board.AddTopCoin(new Vector3(x, 0, z), coinManager.AddCoin(new Vector3(x, 0.2f, z), false));
         }
     }
 }
Beispiel #2
0
 void CoinPlaced(Vector3 dropPosition)
 {
     draggedCoin.transform.position = dropPosition; //the positioning of the dropped coin.
     board.AddTopCoin(dropPosition, draggedCoin);   //Updated the board topcoins, replaced the coin below with the one you place.
     draggedCoin.isDragable = false;                //After coin has been placed, it can no longer be moved.
     coinManager.AddCoin(startPosition, true);
 }
Beispiel #3
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.layer == 9)
     {
         speed = 2f;
         coinManager.AddCoin(coin);
     }
 }
Beispiel #4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         Instantiate(EffectOnDestroy, transform.position, transform.rotation);
         CoinManager.AddCoin(gameObject);
     }
 }
Beispiel #5
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         FindObjectOfType <AudioManager>().Play("CoinPickUp");
         CoinManager.AddCoin();
         DespawnCoin();
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Coin")
     {
         Destroy(other.gameObject);
         coinManager.SpawnCoin();
         coinManager.AddCoin();
     }
 }
Beispiel #7
0
    public Bridge addBridge(Vector3 position, bool isDragable, bool Vertical)
    {
        Bridge bridge = Instantiate(bridgePrefab, position + new Vector3(0, -0.1f, 0), Quaternion.identity) as Bridge;

        Coin coin1 = coinManager.AddCoin(position + new Vector3(0.5f, 0, 0), false);
        Coin coin2 = coinManager.AddCoin(position + new Vector3(-0.5f, 0, 0), false);

        coin1.transform.SetParent(bridge.transform);
        coin2.transform.SetParent(bridge.transform);
        bridge.addCoinTobridge(0, coin1);
        bridge.addCoinTobridge(1, coin2);
        bridge.isDragable = true;
        if (Vertical)
        {
            bridge.transform.Rotate(0, 90, 0);
            bridge.vertical = true;
        }
        return(bridge);
    }
    private IEnumerator OnReceiveCoinList(WWW req)
    {
        yield return(req);

        CoinListResponse resp = CoinListResponse.FromJson(req.text);

        foreach (Datum d in resp.Data.Values)
        {
            CoinManager.AddCoin(d);
        }
        FindObjectOfType <PortfolioScene>().Init();
    }
Beispiel #9
0
    public void DoFeed()
    {
        int feedTemp;
        int index = (int)(AffectionManager.affectionValue / 10);

        if (index == 10)
        {
            index = 9;
        }

        feedTemp = feedValue [index];

        if (!feedCooldown && feedable)
        {
            AffectionManager.affectionValue += feedTemp;
            pointAddition.addPoint(feedTemp);
            coinManager.AddCoin(5);
            feedCooldown = true;
            lastFeedTime = DateTime.Now;
            PlayerPrefs.SetString("LastFeedTime", DateTime.Now.ToBinary().ToString());
        }

        PlayerPrefs.SetFloat("AffectionValue", AffectionManager.affectionValue);
    }
Beispiel #10
0
 public void Collided(Vector3 v)
 {
     coinManager.AddCoin(coinColor);
     playerColl.GetComponent <SoundController>().PlayCoinSound();
     Destroy(gameObject);
 }