Inheritance: UIKeyNavigation
Ejemplo n.º 1
0
 public void Upgrade()
 {
     if (this.onClick == null && this.selectOnClick != null)
     {
         this.onClick = this.selectOnClick.gameObject;
         this.selectOnClick = null;
         NGUITools.SetDirty(this);
     }
     if (this.onLeft == null && this.selectOnLeft != null)
     {
         this.onLeft = this.selectOnLeft.gameObject;
         this.selectOnLeft = null;
         NGUITools.SetDirty(this);
     }
     if (this.onRight == null && this.selectOnRight != null)
     {
         this.onRight = this.selectOnRight.gameObject;
         this.selectOnRight = null;
         NGUITools.SetDirty(this);
     }
     if (this.onUp == null && this.selectOnUp != null)
     {
         this.onUp = this.selectOnUp.gameObject;
         this.selectOnUp = null;
         NGUITools.SetDirty(this);
     }
     if (this.onDown == null && this.selectOnDown != null)
     {
         this.onDown = this.selectOnDown.gameObject;
         this.selectOnDown = null;
         NGUITools.SetDirty(this);
     }
 }
Ejemplo n.º 2
0
    protected override void OnActive(bool active)
    {
        if (active)
        {
            retry.onClick       = OnRetry;
            stageSelect.onClick = OnStageSelect;
            main.onClick        = OnMain;

            if (SlotInfo.gameMode == SlotInfo.GameMode.Hardcore)
            {
                retryWidget.color       = disableColor;
                stageSelectWidget.color = disableColor;

                UIButtonKeys mainBtns = main.GetComponent <UIButtonKeys>();
                mainBtns.selectOnUp     = null;
                mainBtns.selectOnDown   = null;
                UICamera.selectedObject = main.gameObject;
            }
            else
            {
                UICamera.selectedObject = retry.gameObject;
            }
        }
        else
        {
            retry.onClick       = null;
            stageSelect.onClick = null;
            main.onClick        = null;
        }
    }
Ejemplo n.º 3
0
 public void Upgrade()
 {
     if (this.onClick == null && this.selectOnClick != null)
     {
         this.onClick       = this.selectOnClick.gameObject;
         this.selectOnClick = null;
         NGUITools.SetDirty(this);
     }
     if (this.onLeft == null && this.selectOnLeft != null)
     {
         this.onLeft       = this.selectOnLeft.gameObject;
         this.selectOnLeft = null;
         NGUITools.SetDirty(this);
     }
     if (this.onRight == null && this.selectOnRight != null)
     {
         this.onRight       = this.selectOnRight.gameObject;
         this.selectOnRight = null;
         NGUITools.SetDirty(this);
     }
     if (this.onUp == null && this.selectOnUp != null)
     {
         this.onUp       = this.selectOnUp.gameObject;
         this.selectOnUp = null;
         NGUITools.SetDirty(this);
     }
     if (this.onDown == null && this.selectOnDown != null)
     {
         this.onDown       = this.selectOnDown.gameObject;
         this.selectOnDown = null;
         NGUITools.SetDirty(this);
     }
 }
Ejemplo n.º 4
0
        public void Awake()
        {
            mPrimaryBtnKeys  = primary.GetComponent <UIButtonKeys>();
            mPrimaryLabel    = primary.GetComponentInChildren <UILabel>();
            mPrimaryListener = primary.GetComponent <UIEventListener>();

            mSecondaryBtnKeys  = secondary.GetComponent <UIButtonKeys>();
            mSecondaryLabel    = secondary.GetComponentInChildren <UILabel>();
            mSecondaryListener = secondary.GetComponent <UIEventListener>();
        }
Ejemplo n.º 5
0
    public unsafe override void Unity_NamedDeserialize(int depth)
    {
        ISerializedNamedStateReader arg_1A_0 = SerializedNamedStateReader.Instance;

        byte[] var_0_cp_0 = $FieldNamesStorage.$RuntimeNames;
        int    var_0_cp_1 = 0;

        this.constraint = (UIKeyNavigation.Constraint)arg_1A_0.ReadInt32(&var_0_cp_0[var_0_cp_1] + 278);
        if (depth <= 7)
        {
            this.onUp = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 289) as GameObject);
        }
        if (depth <= 7)
        {
            this.onDown = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 294) as GameObject);
        }
        if (depth <= 7)
        {
            this.onLeft = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 301) as GameObject);
        }
        if (depth <= 7)
        {
            this.onRight = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 308) as GameObject);
        }
        if (depth <= 7)
        {
            this.onClick = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 257) as GameObject);
        }
        if (depth <= 7)
        {
            this.onTab = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 316) as GameObject);
        }
        this.startsSelected = SerializedNamedStateReader.Instance.ReadBoolean(&var_0_cp_0[var_0_cp_1] + 322);
        SerializedNamedStateReader.Instance.Align();
        if (depth <= 7)
        {
            this.selectOnClick = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 337) as UIButtonKeys);
        }
        if (depth <= 7)
        {
            this.selectOnUp = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 351) as UIButtonKeys);
        }
        if (depth <= 7)
        {
            this.selectOnDown = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 362) as UIButtonKeys);
        }
        if (depth <= 7)
        {
            this.selectOnLeft = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 375) as UIButtonKeys);
        }
        if (depth <= 7)
        {
            this.selectOnRight = (SerializedNamedStateReader.Instance.ReadUnityEngineObject(&var_0_cp_0[var_0_cp_1] + 388) as UIButtonKeys);
        }
    }
Ejemplo n.º 6
0
    void Awake()
    {
        mInfoEvent = infoGO.GetComponent <UIEventListener>();
        mInfoKeys  = infoGO.GetComponent <UIButtonKeys>();

        mDeleteEvent = deleteGO.GetComponent <UIEventListener>();
        mDeleteKeys  = deleteGO.GetComponent <UIButtonKeys>();

        mNewEvent = newGO.GetComponent <UIEventListener>();
        mNewKeys  = newGO.GetComponent <UIButtonKeys>();
    }
Ejemplo n.º 7
0
 static public int get_selectOnDown(IntPtr l)
 {
     try {
         UIButtonKeys self = (UIButtonKeys)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.selectOnDown);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 8
0
 static public int Upgrade(IntPtr l)
 {
     try {
         UIButtonKeys self = (UIButtonKeys)checkSelf(l);
         self.Upgrade();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 9
0
 static public int constructor(IntPtr l)
 {
     try {
         UIButtonKeys o;
         o = new UIButtonKeys();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 10
0
 public override void Unity_Deserialize(int depth)
 {
     this.constraint = (UIKeyNavigation.Constraint)SerializedStateReader.Instance.ReadInt32();
     if (depth <= 7)
     {
         this.onUp = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     if (depth <= 7)
     {
         this.onDown = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     if (depth <= 7)
     {
         this.onLeft = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     if (depth <= 7)
     {
         this.onRight = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     if (depth <= 7)
     {
         this.onClick = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     if (depth <= 7)
     {
         this.onTab = (SerializedStateReader.Instance.ReadUnityEngineObject() as GameObject);
     }
     this.startsSelected = SerializedStateReader.Instance.ReadBoolean();
     SerializedStateReader.Instance.Align();
     if (depth <= 7)
     {
         this.selectOnClick = (SerializedStateReader.Instance.ReadUnityEngineObject() as UIButtonKeys);
     }
     if (depth <= 7)
     {
         this.selectOnUp = (SerializedStateReader.Instance.ReadUnityEngineObject() as UIButtonKeys);
     }
     if (depth <= 7)
     {
         this.selectOnDown = (SerializedStateReader.Instance.ReadUnityEngineObject() as UIButtonKeys);
     }
     if (depth <= 7)
     {
         this.selectOnLeft = (SerializedStateReader.Instance.ReadUnityEngineObject() as UIButtonKeys);
     }
     if (depth <= 7)
     {
         this.selectOnRight = (SerializedStateReader.Instance.ReadUnityEngineObject() as UIButtonKeys);
     }
 }
Ejemplo n.º 11
0
 static public int set_selectOnUp(IntPtr l)
 {
     try {
         UIButtonKeys self = (UIButtonKeys)checkSelf(l);
         UIButtonKeys v;
         checkType(l, 2, out v);
         self.selectOnUp = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 12
0
 void OnKey(KeyCode key)
 {
     if (enabled && NGUITools.GetActive(gameObject) && !(StateManager.instance != null && StateManager.instance.current_states.Contains(StateManager.State.SCRIPTED_EVENT)))
     {
         UIButtonKeys ubk = GetNextGameObject(key);
         while (ubk != null && NGUITools.GetActive(ubk.gameObject) != true)
         {
             ubk = ubk.GetNextGameObject(key);
         }
         if (ubk != null)
         {
             UICamera.selectedObject = ubk.gameObject;
         }
     }
 }
Ejemplo n.º 13
0
 public override void Unity_RemapPPtrs(int depth)
 {
     if (this.onUp != null)
     {
         this.onUp = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onUp) as GameObject);
     }
     if (this.onDown != null)
     {
         this.onDown = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onDown) as GameObject);
     }
     if (this.onLeft != null)
     {
         this.onLeft = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onLeft) as GameObject);
     }
     if (this.onRight != null)
     {
         this.onRight = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onRight) as GameObject);
     }
     if (this.onClick != null)
     {
         this.onClick = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onClick) as GameObject);
     }
     if (this.onTab != null)
     {
         this.onTab = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.onTab) as GameObject);
     }
     if (this.selectOnClick != null)
     {
         this.selectOnClick = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.selectOnClick) as UIButtonKeys);
     }
     if (this.selectOnUp != null)
     {
         this.selectOnUp = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.selectOnUp) as UIButtonKeys);
     }
     if (this.selectOnDown != null)
     {
         this.selectOnDown = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.selectOnDown) as UIButtonKeys);
     }
     if (this.selectOnLeft != null)
     {
         this.selectOnLeft = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.selectOnLeft) as UIButtonKeys);
     }
     if (this.selectOnRight != null)
     {
         this.selectOnRight = (PPtrRemapper.Instance.GetNewInstanceToReplaceOldInstance(this.selectOnRight) as UIButtonKeys);
     }
 }
Ejemplo n.º 14
0
        protected override void Awake()
        {
            base.Awake();

            mItems = new ModalInputBindItem[actions.Length];

            UIButtonKeys defaultBtnKeys = defaultItem.GetComponent <UIButtonKeys>();
            UIButtonKeys cancelBtnKeys  = cancelItem.GetComponent <UIButtonKeys>();

            for (int i = 0; i < mItems.Length; i++)
            {
                GameObject go = (GameObject)GameObject.Instantiate(template);
                go.name                    = i.ToString("D2");
                go.transform.parent        = itemHolder;
                go.transform.localPosition = Vector3.zero;
                go.transform.localScale    = Vector3.one;
                go.transform.localRotation = Quaternion.identity;

                mItems[i] = go.GetComponent <ModalInputBindItem>();

                if (i == 0)
                {
                    mItems[i].primaryBtnKeys.selectOnUp   = cancelBtnKeys;
                    mItems[i].secondaryBtnKeys.selectOnUp = cancelBtnKeys;
                }
                else
                {
                    mItems[i].primaryBtnKeys.selectOnUp   = mItems[i - 1].primaryBtnKeys;
                    mItems[i].secondaryBtnKeys.selectOnUp = mItems[i - 1].secondaryBtnKeys;

                    mItems[i - 1].primaryBtnKeys.selectOnDown   = mItems[i].primaryBtnKeys;
                    mItems[i - 1].secondaryBtnKeys.selectOnDown = mItems[i].secondaryBtnKeys;
                }

                mItems[i].nameLabel.text = actions[i].localized ? Localize.instance.GetText(actions[i].name) : actions[i].name;
            }

            mItems[mItems.Length - 1].primaryBtnKeys.selectOnDown   = defaultBtnKeys;
            mItems[mItems.Length - 1].secondaryBtnKeys.selectOnDown = defaultBtnKeys;

            defaultBtnKeys.selectOnUp  = mItems[mItems.Length - 1].primaryBtnKeys;
            cancelBtnKeys.selectOnDown = mItems[0].primaryBtnKeys;

            template.SetActive(false);

            keyPressGO.SetActive(false);
        }
Ejemplo n.º 15
0
 public void Upgrade()
 {
     //IL_0029: Unknown result type (might be due to invalid IL or missing references)
     //IL_002e: Expected O, but got Unknown
     //IL_0069: Unknown result type (might be due to invalid IL or missing references)
     //IL_006e: Expected O, but got Unknown
     //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ae: Expected O, but got Unknown
     //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ee: Expected O, but got Unknown
     //IL_0129: Unknown result type (might be due to invalid IL or missing references)
     //IL_012e: Expected O, but got Unknown
     if (onClick == null && selectOnClick != null)
     {
         onClick       = selectOnClick.get_gameObject();
         selectOnClick = null;
         NGUITools.SetDirty(this);
     }
     if (onLeft == null && selectOnLeft != null)
     {
         onLeft       = selectOnLeft.get_gameObject();
         selectOnLeft = null;
         NGUITools.SetDirty(this);
     }
     if (onRight == null && selectOnRight != null)
     {
         onRight       = selectOnRight.get_gameObject();
         selectOnRight = null;
         NGUITools.SetDirty(this);
     }
     if (onUp == null && selectOnUp != null)
     {
         onUp       = selectOnUp.get_gameObject();
         selectOnUp = null;
         NGUITools.SetDirty(this);
     }
     if (onDown == null && selectOnDown != null)
     {
         onDown       = selectOnDown.get_gameObject();
         selectOnDown = null;
         NGUITools.SetDirty(this);
     }
 }
Ejemplo n.º 16
0
    void Awake()
    {
#if OUYA
        input.gameObject.SetActive(false);
        input = null;

        graphics.gameObject.SetActive(false);
        graphics = null;

        UIButtonKeys musicBtnKeys = music.GetComponent <UIButtonKeys>();
        UIButtonKeys backBtnKeys  = back.GetComponent <UIButtonKeys>();

        musicBtnKeys.selectOnUp  = backBtnKeys;
        backBtnKeys.selectOnDown = musicBtnKeys;

        NGUILayoutBase.RefreshNow(transform);
#endif

        mMusicSlider = music.GetComponent <UISlider>();
        mSoundSlider = sound.GetComponent <UISlider>();
    }
Ejemplo n.º 17
0
    void InitWeapons()
    {
        Player player = Player.instance;

        UIButtonKeys firstWeaponButtonKeys = null;
        UIButtonKeys lastWeaponButtonKeys  = null;
        UIButtonKeys rightButtonKeys       = null;

        if (PlayerStats.isSubTankEnergy1Acquired || PlayerStats.isSubTankEnergy2Acquired)
        {
            rightButtonKeys = energySubTank.GetComponent <UIButtonKeys>();
        }
        else if (PlayerStats.isSubTankWeapon1Acquired || PlayerStats.isSubTankWeapon2Acquired)
        {
            rightButtonKeys = weaponSubTank.GetComponent <UIButtonKeys>();
        }
        else
        {
            rightButtonKeys = exit.GetComponent <UIButtonKeys>();
        }

        for (int i = 0, max = mWeapons.Length; i < max; i++)
        {
            UIEnergyBar wpnUI = mWeapons[i];
            Weapon      wpn   = i < player.weapons.Length ? player.weapons[i] : null;

            UIEventListener eventListener = wpnUI.GetComponent <UIEventListener>();

            if (Weapon.IsAvailable(i) && wpn)
            {
                wpnUI.gameObject.SetActive(true);
                wpnUI.label.text = wpn.labelText;
                wpnUI.SetIconSprite(wpn.iconSpriteRef);

                wpnUI.max     = Mathf.CeilToInt(Weapon.weaponEnergyDefaultMax);
                wpnUI.current = wpn.energyType == Weapon.EnergyType.Unlimited ? wpnUI.max : Mathf.CeilToInt(wpn.currentEnergy);

                eventListener.onClick  = OnWeaponClick;
                eventListener.onSelect = OnWeaponSelect;

                UIButtonKeys buttonKeys = wpnUI.GetComponent <UIButtonKeys>();

                buttonKeys.selectOnUp    = lastWeaponButtonKeys;
                buttonKeys.selectOnRight = rightButtonKeys;

                if (firstWeaponButtonKeys == null)
                {
                    firstWeaponButtonKeys = buttonKeys;
                }

                if (lastWeaponButtonKeys)
                {
                    lastWeaponButtonKeys.selectOnDown = buttonKeys;
                }

                lastWeaponButtonKeys = buttonKeys;
            }
            else
            {
                wpnUI.gameObject.SetActive(false);

                eventListener.onClick = null;

                UIButtonKeys buttonKeys = wpnUI.GetComponent <UIButtonKeys>();
                buttonKeys.selectOnUp   = null;
                buttonKeys.selectOnDown = null;
            }
        }

        if (firstWeaponButtonKeys)
        {
            firstWeaponButtonKeys.selectOnUp = lastWeaponButtonKeys;
        }

        if (lastWeaponButtonKeys)
        {
            lastWeaponButtonKeys.selectOnDown = firstWeaponButtonKeys;
        }
    }
Ejemplo n.º 18
0
    void InitSubTanks()
    {
        UIButtonKeys energyBtnKeys  = energySubTank.GetComponent <UIButtonKeys>();
        UIButtonKeys weaponBtnKeys  = weaponSubTank.GetComponent <UIButtonKeys>();
        UIButtonKeys exitBtnKeys    = exit.GetComponent <UIButtonKeys>();
        UIButtonKeys optionsBtnKeys = options.GetComponent <UIButtonKeys>();

        mNumEnergyTank = 0;
        if (PlayerStats.isSubTankEnergy1Acquired)
        {
            mNumEnergyTank++;
        }
        if (PlayerStats.isSubTankEnergy2Acquired)
        {
            mNumEnergyTank++;
        }

        if (mNumEnergyTank > 0)
        {
            energySubTank.onClick = OnEnergySubTankClick;
            energySubTankBar1.SetActive(mNumEnergyTank >= 1);
            energySubTankBar2.SetActive(mNumEnergyTank > 1);

            RefreshEnergyTank();
        }
        else
        {
            energySubTankBar1.SetActive(false);
            energySubTankBar2.SetActive(false);
        }

        mNumWeaponTank = 0;
        if (PlayerStats.isSubTankWeapon1Acquired)
        {
            mNumWeaponTank++;
        }
        if (PlayerStats.isSubTankWeapon2Acquired)
        {
            mNumWeaponTank++;
        }

        if (mNumWeaponTank > 0)
        {
            weaponSubTank.onClick = OnWeaponSubTankClick;
            weaponSubTankBar1.SetActive(mNumWeaponTank >= 1);
            weaponSubTankBar2.SetActive(mNumWeaponTank > 1);

            RefreshWeaponTank();
        }
        else
        {
            weaponSubTankBar1.SetActive(false);
            weaponSubTankBar2.SetActive(false);
        }

        energyBtnKeys.selectOnDown = mNumWeaponTank > 0 ? weaponBtnKeys : exitBtnKeys;

        weaponBtnKeys.selectOnUp = mNumEnergyTank > 0 ? energyBtnKeys : optionsBtnKeys;

        exitBtnKeys.selectOnUp =
            mNumWeaponTank > 0 ? weaponBtnKeys :
            mNumEnergyTank > 0 ? energyBtnKeys :
            optionsBtnKeys;

        optionsBtnKeys.selectOnDown =
            mNumEnergyTank > 0 ? energyBtnKeys :
            mNumWeaponTank > 0 ? weaponBtnKeys :
            exitBtnKeys;
    }
Ejemplo n.º 19
0
 void Awake()
 {
     mBackKeys = back.GetComponent <UIButtonKeys>();
 }
Ejemplo n.º 20
0
 void Awake()
 {
     mCancelKeys      = cancel.GetComponent <UIButtonKeys>();
     mLevelSelectKeys = toLevelSelect.GetComponent <UIButtonKeys>();
     mMainKeys        = toMain.GetComponent <UIButtonKeys>();
 }
Ejemplo n.º 21
0
 // Use this for initialization
 void Start()
 {
     thisButton = (UIButtonKeys)GetComponent(typeof(UIButtonKeys));
 }