コード例 #1
0
 public void RecordAudio(PurchasedAudio pAudio)
 {
     if (mRecordingPlayer != null)
     {
         mRecordingPlayer.networkView.RPC("RecordAction", RPCMode.All, new object[] { "AudioChange", RPCEncoder.Encode(new string[] { mTime.ToString(), pAudio.uAudio.uID }) });
     }
 }
コード例 #2
0
 public void ActivateAudio(PurchasedAudio pAudio)
 {
     if (!mAudioSource.isPlaying)
     {
         mRecorder.RecordAudio(pAudio);
         mAudioSource.clip = pAudio.uAudio.uClip;
         mAudioSource.Play();
     }
     ;
 }
コード例 #3
0
    [RPC] public void PurchaseAudio(string pAudioID)
    {
        Audio prop = mGame.uAudio[pAudioID];
        // Check that there is a prop.uID available
        bool propAvailable = false;

        foreach (Prop p in uUnpurchasedAudio)
        {
            if (p.uID == prop.uID)
            {
                propAvailable = true;
                break;
            }
        }

        if (!propAvailable)
        {
            return;
        }

        // Check that we have enough money
        if (uBudget < prop.uPrice)
        {
            return;
        }

        // Add the prop to our props, and take away the money
        PurchasedAudio purchasedProp = new PurchasedAudio(prop);

        uPurchasedProps.Add(purchasedProp.uID, purchasedProp);
        uBudget -= prop.uPrice;

        mSceneManager.PropPurchased(this, purchasedProp);

        // I don't think we need to sync buying and selling
        //		if (networkView.isMine) {
        //			networkView.RPC ("PurchaseProp", RPCMode.Others, prop.uID);
        //		}
    }
コード例 #4
0
    public void AudioClicked(dfControl control, System.Int32 value)
    {
        PurchasedAudio p = uPurchasedAudio[value];

        ActivateAudio(p);
    }