コード例 #1
0
    protected override void Awake()
    {
        base.Awake();
        HUDNewWheel.s_Instance = this;
        for (int i = 0; i < 6; i++)
        {
            int ii = i;
            NewWheelButton[] buttons = this.m_Buttons;
            int       num            = i;
            Transform transform      = base.transform;
            string    str            = "Icons/";
            HUDNewWheel.HUDWheelSlot hudwheelSlot = (HUDNewWheel.HUDWheelSlot)i;
            buttons[num] = transform.Find(str + hudwheelSlot.ToString()).GetComponent <NewWheelButton>();
            this.m_Buttons[i].onClick.AddListener(delegate
            {
                this.Execute((HUDNewWheel.HUDWheelSlot)ii);
            });
        }
        this.m_AudioSource                       = base.gameObject.AddComponent <AudioSource>();
        this.m_AudioSource.playOnAwake           = false;
        this.m_AudioSource.outputAudioMixerGroup = GreenHellGame.Instance.GetAudioMixerGroup(AudioMixerGroupGame.Player);
        AudioClip audioClip = Resources.Load <AudioClip>("Sounds/wheel_menu");

        if (!audioClip)
        {
            audioClip = Resources.Load <AudioClip>("Sounds/TempSounds/wheel_menu");
        }
        this.m_AudioSource.clip = audioClip;
    }
コード例 #2
0
    private void Execute(HUDNewWheel.HUDWheelSlot slot)
    {
        switch (slot)
        {
        case HUDNewWheel.HUDWheelSlot.None:
            break;

        case HUDNewWheel.HUDWheelSlot.Map:
            this.OnMap();
            return;

        case HUDNewWheel.HUDWheelSlot.Craft:
            this.OnCraft();
            return;

        case HUDNewWheel.HUDWheelSlot.Sleep:
            this.OnSleep();
            return;

        case HUDNewWheel.HUDWheelSlot.Notebook:
            this.OnNotebook();
            return;

        case HUDNewWheel.HUDWheelSlot.Backpack:
            this.OnBackpack();
            return;

        case HUDNewWheel.HUDWheelSlot.Inspect:
            this.OnInspect();
            break;

        default:
            return;
        }
    }
コード例 #3
0
ファイル: HUDNewWheel.cs プロジェクト: looki666/Green-Hell
    private void Execute(HUDNewWheel.HUDWheelSlot slot)
    {
        switch (slot + 1)
        {
        case HUDNewWheel.HUDWheelSlot.Craft:
            this.OnMap();
            break;

        case HUDNewWheel.HUDWheelSlot.Sleep:
            this.OnCraft();
            break;

        case HUDNewWheel.HUDWheelSlot.Notebook:
            this.OnSleep();
            break;

        case HUDNewWheel.HUDWheelSlot.Backpack:
            this.OnNotebook();
            break;

        case HUDNewWheel.HUDWheelSlot.Inspect:
            this.OnBackpack();
            break;

        case HUDNewWheel.HUDWheelSlot.Count:
            this.OnInspect();
            break;
        }
    }
コード例 #4
0
 private bool IsSlotActive(HUDNewWheel.HUDWheelSlot slot)
 {
     return((slot != HUDNewWheel.HUDWheelSlot.Craft || Player.Get().CanStartCrafting()) && (slot != HUDNewWheel.HUDWheelSlot.Notebook || NotepadController.Get().IsActive() || Player.Get().CanShowNotepad()) && (slot != HUDNewWheel.HUDWheelSlot.Map || MapController.Get().IsActive() || Player.Get().CanShowMap()) && (slot != HUDNewWheel.HUDWheelSlot.Sleep || Player.Get().CanSleep()) && (slot != HUDNewWheel.HUDWheelSlot.Inspect || BodyInspectionController.Get().IsActive() || Player.Get().CanStartBodyInspection()));
 }