コード例 #1
0
ファイル: Player.cs プロジェクト: gremdon/Unity-Networking
 void RpcRemoveFromList(GameObject obj)
 {
     if (hasAuthority)
     {
         DiscardStack.Shuffle(obj);
     }
 }
コード例 #2
0
ファイル: ValueOutput.cs プロジェクト: isoundy000/rummy
 private void Start()
 {
     text = GetComponent <Text>();
     if (OutputValue == Value.PlayerLaidCardsSum || OutputValue == Value.PlayerHandCardCount)
     {
         Player = GetComponentInParent <Player>();
         if (Player == null)
         {
             throw new MissingReferenceException("ValueOutput is set to output PlayerLaidCardsSum or PlayerHandCardCount but is not child of a Player!");
         }
     }
     else if (OutputValue == Value.CardStackCardCount)
     {
         CardStack = GetComponentInParent <CardStack>();
         if (CardStack == null)
         {
             throw new MissingReferenceException("ValueOutput is set to output the CardStackCardCount but is not child of a CardStack!");
         }
     }
     else if (OutputValue == Value.DiscardStackCardCount)
     {
         DiscardStack = GetComponentInParent <DiscardStack>();
         if (DiscardStack == null)
         {
             throw new MissingReferenceException("ValueOutput is set to output the DiscardStackCardCount but is not child of a DiscardStack!");
         }
     }
 }
コード例 #3
0
 protected override void Awake()
 {
     base.Awake();
     if (singleton == null)
     {
         singleton = this;
     }
     NumCards = Cards.Count;
 }
コード例 #4
0
 public void Setup()
 {
     if (singleton == null)
     {
         singleton = this;
     }
     this.Cards     = new List <GameObject> ();
     this.StackName = "DiscardStack";
     SetReady();
 }