Beispiel #1
0
 void ChooseColor(float angle)
 {
     // check the selected color
     if (angle > optionHalfAngle && angle < 360f - optionHalfAngle)
     {
         // Villain choose to use skill
         state = 1;
         if (stateStartAction != null)
         {
             stateStartAction();
         }
         Debug.Log("Skill selection");
     }
     else
     {
         for (int i = 0; i < numColor; i++)
         {
             if ((angle > colorAngle[i] && angle < colorAngle[i] + colorSegAngle) ||
                 (i == numColor / 2 && angle < colorSegAngle * 0.5f))
             {
                 // Add a marble of certain color
                 if (i < numColor - 1)
                 {
                     Debug.Log("Add Marble with Color " + colorTags[i]);
                     spawn.ChangeNextColor(colorTags[i]);
                 }
                 switch (i)
                 {
                 }
                 if (i == numColor - 1)
                 {
                     state = 1;
                     if (stateStartAction != null)
                     {
                         stateStartAction();
                     }
                     Debug.Log("Skill selection");
                 }
                 break;
             }
         }
     }
 }