コード例 #1
0
ファイル: Blob.cs プロジェクト: mtang8264/BadProj
 // Change blobs to shrinking state when clicked.
 void OnMouseDown()
 {
     // I added this if statement.
     // I'm not sure this is the best way to check this but it works.
     if (currentState.ToString() != "BlobStateShrinking")
     {
         ChangeState(new BlobStateShrinking(this));
     }
 }
コード例 #2
0
 // Change blobs to shrinking state when clicked.
 void OnMouseDown()
 {
     if (!currentState.ToString().Equals("BlobStateShrinking"))
     {
         controller.score += 10;//I make the score to increase when you clicked the blob instead of after the blob fades out
         ChangeState(new BlobStateShrinking(this));
     }
     else
     {
         Debug.Log("already clicked");
     }
 }