예제 #1
0
    public static void EnableNextIconButton()
    {
        if (GameManager.Mode != GameMode.Rehearsal)
        {
            return;
        }

        int[] siteIDs = InteractablePathManager.GetPathSiteIDs();

        // Disable last scene button
        if (activeIndex >= 0)
        {
            int lastSiteID = siteIDs[activeIndex];
            allIconButtons[lastSiteID].GetComponent <Button>().interactable = false;
            allIconButtons[lastSiteID].enableCover.gameObject.SetActive(true);

            Animator prevAnimator = allIconButtons[lastSiteID].GetComponent <Animator>();
            prevAnimator.Play("UIButtonIdle");
        }

        // Enable next scene button
        if (activeIndex + 1 < siteIDs.Length)
        {
            int nextSiteID = siteIDs[activeIndex + 1];
            allIconButtons[nextSiteID].GetComponent <Button>().interactable = true;
            allIconButtons[nextSiteID].enableCover.gameObject.SetActive(false);
            LevelIconButton.ActivateIconForRehersal(nextSiteID, activeIndex + 1);

            Animator nextAnimator = allIconButtons[nextSiteID].GetComponent <Animator>();
            nextAnimator.Play("UIButtonHighlight");
        }
    }
예제 #2
0
    public void SetupEncodeSeedBip()
    {
        SetLevelPanelDefault();

        if (GameManager.Mode == GameMode.Rehearsal)
        {
            TMP_InputField seedInputField = GetComponentInChildren <TMP_InputField>(true);

            string seedFromInput = seedInputField.text;
            string hexSeed       = "";

            if (!detectHex(seedFromInput) && validBip(seedFromInput))
            {
                BIP39Converter bpc = new BIP39Converter();
                hexSeed = bpc.getHexFromSentence(seedFromInput);
            }
            else
            {
                hexSeed = seedFromInput;
                if (InteractableConfig.SeedHexLength % 2 == 1)
                {
                    if (seedFromInput.Length == InteractableConfig.SeedHexLength)
                    {
                        string seedText = seedFromInput + "0";
                        char[] array    = seedText.ToCharArray();
                        array[array.Length - 1] = array[array.Length - 2];
                        array[array.Length - 2] = '0';
                        hexSeed = new string(array);
                    }
                    else if (seedFromInput.Length == InteractableConfig.SeedHexLength + 1)
                    {
                        char[] array = seedFromInput.ToCharArray();
                        array[array.Length - 2] = '0';
                        hexSeed = new string(array);
                    }
                    else
                    {
                        Debug.Log("Seed: " + hexSeed);
                    }
                }
            }

            //Debug.Log("Sentence: " + seedFromInput);
            Debug.Log("Seed: " + hexSeed);

            InteractablePathManager.SeedString = hexSeed;

            int[] siteIDs = InteractablePathManager.GetPathSiteIDs();

            SetIconAndPanelForRehearsal(siteIDs);
        }
    }
예제 #3
0
    public void SetupEncodeSeed()
    {
        SetLevelPanelDefault();

        if (GameManager.Mode == GameMode.Rehearsal)
        {
            TMP_InputField seedInputField = GetComponentInChildren <TMP_InputField>(true);
            InteractablePathManager.SeedString = seedInputField.text;

            int[] siteIDs = InteractablePathManager.GetPathSiteIDs();
            SetIconAndPanelForRehearsal(siteIDs);
        }
    }
예제 #4
0
    public void EnableNext()
    {
        if (GameManager.Mode != GameMode.Rehearsal)
        {
            return;
        }

        int[] siteIDs = InteractablePathManager.GetPathSiteIDs();
        if (sceneCount < siteIDs.Length)
        {
            int nextID = siteIDs[sceneCount];
            buttons[nextID].interactable = true;
            indicators[nextID].Activate(sceneCount);
        }
    }
예제 #5
0
    public void EncodeSeed()
    {
        if (GameManager.Mode == GameMode.Rehearsal)
        {
            string seedFromInput = seedInputField.text;
            string hexSeed       = "";

            if (!SeedUtility.detectHex(seedFromInput) && SeedUtility.validBip(seedFromInput))
            {
                hexSeed = bpc.getHexFromSentence(seedFromInput);
            }
            else
            {
                hexSeed = seedFromInput;
                if (InteractableConfig.SeedHexLength % 2 == 1)
                {
                    if (seedFromInput.Length == InteractableConfig.SeedHexLength)
                    {
                        string seedText = seedFromInput + "0";
                        char[] array    = seedText.ToCharArray();
                        array[array.Length - 1] = array[array.Length - 2];
                        array[array.Length - 2] = '0';
                        hexSeed = new string(array);
                    }
                    else if (seedFromInput.Length == InteractableConfig.SeedHexLength + 1)
                    {
                        char[] array = seedFromInput.ToCharArray();
                        array[array.Length - 2] = '0';
                        hexSeed = new string(array);
                    }
                    else
                    {
                        Debug.Log("Seed: " + hexSeed);
                    }
                }
            }
            Debug.Log("Seed: " + hexSeed);

            InteractablePathManager.SeedString = hexSeed;
            int[] siteIDs = InteractablePathManager.GetPathSiteIDs();
        }
    }
예제 #6
0
    public void SetupEncodeSeed()
    {
        SetLevelPanelDefault();

        if (GameManager.Mode == GameMode.Rehearsal)
        {
            TMP_InputField seedInputField = GetComponentInChildren <TMP_InputField>(true);

            string seedFromInput = removeHexPrefix(seedInputField.text);

            if (InteractableConfig.SeedHexLength % 2 == 1)
            {
                if (seedFromInput.Length == InteractableConfig.SeedHexLength)
                {
                    string seedText = seedFromInput + "0";
                    char[] array    = seedText.ToCharArray();
                    array[array.Length - 1] = array[array.Length - 2];
                    array[array.Length - 2] = '0';
                    seedFromInput           = new string(array);
                }
                else if (seedFromInput.Length == InteractableConfig.SeedHexLength + 1)
                {
                    char[] array = seedFromInput.ToCharArray();
                    array[array.Length - 2] = '0';
                    seedFromInput           = new string(array);
                }
                else
                {
                    Debug.Log("Seed: " + seedFromInput);
                }
            }

            InteractablePathManager.SeedString = seedFromInput;

            int[] siteIDs = InteractablePathManager.GetPathSiteIDs();
            SetIconAndPanelForRehearsal(siteIDs);
        }
    }