Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        var audioListener = GetComponent <AudioListener>();
        var x             = SettingsPersistence.GetValueBySetting(Assets.Code.Utilities.Enumerations.Setting.Audio);

        audioListener.enabled = x != 0;
    }
Ejemplo n.º 2
0
 void Start()
 {
     OctagonRotateSpeed.value = SettingsPersistence.GetValueBySetting(Utilities.Enumerations.Setting.OctagonTurnSpeed);
     OctagonSwapSpeed.value   = SettingsPersistence.GetValueBySetting(Utilities.Enumerations.Setting.OctagonSwapSpeed);
     OctagonShowIcons.isOn    = SettingsPersistence.GetValueBySetting(Utilities.Enumerations.Setting.OctagonShowIcons) != 0;
     Audio.isOn = SettingsPersistence.GetValueBySetting(Utilities.Enumerations.Setting.Audio) != 0;
     SetAudioListeners(Audio.isOn);
 }
Ejemplo n.º 3
0
    private void ShowAppropriateIcon(GameObject gameObjectRef)
    {
        var octControllerScript = gameObjectRef.GetComponent <OctagonControllerScript>();

        switch (octControllerScript.octagonType)
        {
        case Enumerations.OctagonType.Normal:
        case Enumerations.OctagonType.CorrectPath:

            ChangeAlpha(gameObjectRef, false);

            if (octControllerScript.octagonColor == Enumerations.OctagonColor.Locked)
            {
                gameObjectRef.transform.Find("Image").GetComponent <Image>().sprite  = lockedSprite;
                gameObjectRef.transform.Find("Image").GetComponent <Image>().enabled = true;
                break;
            }

            switch (octControllerScript.octagonAction)
            {
            case Enumerations.OctagonAction.Turn:
                // If they have icons turned on, show the icons. If not, don't.
                if (SettingsPersistence.GetValueBySetting(Enumerations.Setting.OctagonShowIcons) == 1)
                {
                    gameObjectRef.transform.Find("Image").GetComponent <Image>().sprite = rotateSprite;
                    ChangeAlpha(gameObjectRef, true);
                }
                break;

            case Enumerations.OctagonAction.Swap:
                ChangeAlpha(gameObjectRef, true);
                gameObjectRef.transform.Find("Image").GetComponent <Image>().sprite = swapSprite;
                break;
            }
            break;
        }
    }