コード例 #1
0
    public void OnSubmitChecking()
    {
        if (true)
        {
            string input  = Submitter.text;
            bool   failed = false;
            //Check WhiteSpace
            int  answer;
            bool ifSuccess = System.Int32.TryParse(input, out answer);
            if (ifSuccess == false)
            {
                if (input == "" || input == " ")

                {
                    Debug.Log("1>");
                    return;
                }

                ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                failed = true;
                PC.Damage();
                HideCG("Puzzle_Stacks_1");
                Submitter.text = "";
                Debug.Log("9>");
            }
            else if (!failed)
            {
                Debug.Log("2>");
                if (answer == 9)
                {
                    Debug.Log("3>");
                    PC.Stacks_Progress++;
                    ac.OnSuccess(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, success);
                    CreateCoin(Player.transform);
                    CreateCoin(Player.transform);
                    HideCG("Puzzle_Stacks_1");
                    Submitter.text = "";
                }
                else
                {
                    Debug.Log("4>");
                    ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                    PC.Damage();
                    HideCG("Puzzle_Stacks_1");
                    Submitter.text = "";
                }
            }
        }
    }
コード例 #2
0
    public void OnSubmitChecko()
    {
        if (PC.Store_Progress < 1)
        {
            bool failed = false;
            foreach (InputField var in IF)
            {
                if (var.text == "" || var.text == " ")
                {
                    ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                    failed = true;
                    PC.Damage();
                    HideCG();

                    return;
                }
            }
            if (!failed)
            {
                int counter = 0;
                for (int i = 0; i < 6; i++)
                {
                    if (Convert.ToInt32(IF[i].text) == i + 1)
                    {
                        counter++;
                    }
                }
                if (counter == 6)
                {
                    PC.Store_Progress++;
                    ac.OnSuccess(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, success);
                    Invoke("_HideAlert", 5);
                    CreateCoin(Player.transform);
                    HideCG();
                }
                else
                {
                    ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                    failed = true;
                    HideCG();
                    PC.Damage();
                    return;
                }
            }
        }
    }
コード例 #3
0
 public void OnSubmitChecks()
 {
     if (PC.Logs_Progress == 1)
     {
         string input  = Submit.text;
         bool   failed = false;
         //Check WhiteSpace
         int  answer;
         bool ifSuccess = System.Int32.TryParse(input, out answer);
         if (ifSuccess == false)
         {
             if (input == "" || input == " ")
             {
                 return;
             }
             ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
             failed = true;
             PC.Damage();
             HideCG("Puzzle_Logs_2");
             Submit.text = "";
         }
         else if (!failed)
         {
             if (answer == 0)
             {
                 PC.Logs_Progress++;
                 PC.GotLogs++;
                 PC.CanGetLogs = false;
                 ac.OnSuccess(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, success);
                 CreateCoin(Player.transform);
                 CreateCoin(Player.transform);
                 HideCG("Puzzle_Logs_2");
                 Submit.text = "";
             }
             else
             {
                 ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                 PC.Damage();
                 HideCG("Puzzle_Logs_2");
                 Submit.text = "";
             }
         }
     }
 }
コード例 #4
0
 public void OnSubmitChecker()
 {
     if (PC.Store_Progress == 1)
     {
         bool failed = false;
         //Check WhiteSpace
         foreach (InputField var in IF)
         {
             if (var.text == "" || var.text == " ")
             {
                 ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                 failed = true;
                 PC.Damage();
                 HideCG();
                 return;
             }
         }
         if (!failed)
         {
             if (SumTotal() == true)
             {
                 PC.Store_Progress++;
                 ac.OnSuccess(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, success);
                 Invoke("_HideAlert", 5);
                 CreateCoin(Player.transform);
                 HideCG();
             }
             else
             {
                 ac.OnFailure(Alert.GetComponent <CanvasGroup>(), Alert.GetComponent <Text>(), audi_source, fail);
                 failed = true;
                 HideCG();
                 PC.Damage();
                 return;
             }
         }
     }
 }