protected override void OnAwake()
    {
        base.OnAwake();
        this.m_tutorial = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial"));

        this.m_gameui = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXGameUI>(XSingleton <XCommon> .singleton.XHash("XGameUI"));

        this.m_colliderCached = base.collider;
        if (null == this.m_colliderCached)
        {
            Debug.Log("null == m_colliderCached");
        }
        this.m_uiToggle = base.GetComponent <UIToggle>();
        if (null == this.m_uiToggle)
        {
            Debug.Log("null == m_uiToggle");
        }
        this.m_uiSpriteBG = base.GetComponentInChildren <UISprite>();
        if (null == this.m_uiSpriteBG)
        {
            Debug.Log("null == m_uiSpriteBG");
        }
        this.CloneFromTpl();
        if (this.m_NeedAudio && (string.IsNullOrEmpty(this.audioClip) || !this.audioClip.StartsWith("Audio")))
        {
            this.SetAudioClip("Audio/UI/UI_Button_ok");
        }
    }
    protected override void OnAwake()
    {
        base.OnAwake();
        this.m_gameui = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXGameUI>(XSingleton <XCommon> .singleton.XHash("XGameUI"));

        this.m_tutorial = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial"));

        this.m_operation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXOperationRecord>(XSingleton <XCommon> .singleton.XHash("XOperationRecord"));

        this.m_uiButton       = base.GetComponent <UIButton>();
        this.m_uiButtonColor  = this.m_uiButton;
        this.m_uiButtonScale  = base.GetComponent <UIButtonScale>();
        this.m_uiButtonOffset = base.GetComponent <UIButtonOffset>();
        this.m_uiSpriteBG     = base.GetComponentInChildren <UISprite>();
        if (this.m_uiButton != null)
        {
            this.m_colliderCached = this.m_uiButton.cacheCol;
        }
        else
        {
            this.m_colliderCached = base.GetComponent <Collider>();
        }
        this.CloneFromTpl();
        if (this.m_NeedAudio && (string.IsNullOrEmpty(this.audioClip) || !this.audioClip.StartsWith("Audio")))
        {
            this.SetAudioClip("Audio/UI/UI_Button_ok");
        }
        this.m_CD.SetClickCD(this.CustomClickCDGroup, this.CustomClickCD);
        if (this.m_uiButton != null)
        {
            this.m_uiButton.changeStateSprite = this.ChangeStateSprite;
        }
    }
Exemple #3
0
    protected override void OnAwake()
    {
        base.OnAwake();
        this.m_uiTexture = base.GetComponent <UITexture>();
        this.m_tutorial  = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial"));

        this.m_operation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXOperationRecord>(XSingleton <XCommon> .singleton.XHash("XOperationRecord"));

        if (!string.IsNullOrEmpty(this.TexturePath))
        {
            IPlatform xPlatform = XSingleton <XUpdater> .singleton.XPlatform;
            Texture   sharedResource;
            if (!string.IsNullOrEmpty(this.HalfTexPath) && xPlatform.IsUIHalfResolution())
            {
                sharedResource = XSingleton <XResourceLoaderMgr> .singleton.GetSharedResource <Texture>("atlas/UI/" + this.HalfTexPath, ".png", true);
            }
            else
            {
                sharedResource = XSingleton <XResourceLoaderMgr> .singleton.GetSharedResource <Texture>("atlas/UI/" + this.TexturePath, ".png", true);
            }
            this.SetTexture(sharedResource);
        }
        if (null == this.m_uiTexture)
        {
            Debug.LogError("null == m_uiTexture");
        }
        this.m_CD.SetClickCD(this.CustomClickCDGroup, this.CustomClickCD);
    }
Exemple #4
0
    protected override void OnAwake()
    {
        base.OnAwake();
        this.m_tutorial = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial"));

        this.m_uiLabel = base.GetComponent <UILabel>();
        if (null == this.m_uiLabel)
        {
            Debug.LogError("null == m_uiLabel");
        }
        this.m_sourceColor  = this.m_uiLabel.color;
        this.m_sourceTop    = this.m_uiLabel.gradientTop;
        this.m_sourceBottom = this.m_uiLabel.gradientBottom;
        this.m_effectColor  = this.m_uiLabel.effectColor;
    }
    protected override void OnAwake()
    {
        base.OnAwake();
        this.m_gameui = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXGameUI>(XSingleton <XCommon> .singleton.XHash("XGameUI"));

        this.m_tutorial = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial"));

        this.m_operation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXOperationRecord>(XSingleton <XCommon> .singleton.XHash("XOperationRecord"));

        this.m_uiSprite = base.GetComponent <UISprite>();
        if (!string.IsNullOrEmpty(this.SpriteAtlasPath))
        {
            IPlatform xPlatform = XSingleton <XUpdater> .singleton.XPlatform;
            if (xPlatform.IsUIDelayLoad() && !string.IsNullOrEmpty(this.HalfPath))
            {
                XUITool.Instance.XGameUI.DelayLoadUISprite(this);
            }
            else if (!string.IsNullOrEmpty(this.HalfPath) && xPlatform.IsUIHalfResolution())
            {
                this.SetSprite(this.SPriteName, this.HalfPath);
            }
            else
            {
                this.SetSprite(this.SPriteName, this.SpriteAtlasPath);
            }
        }
        if (null == this.m_uiSprite)
        {
            Debug.Log("null == m_uiSprite," + base.gameObject.name);
        }
        this.m_sourceColor = this.m_uiSprite.color;
        this.CloneFromTpl();
        if (this.m_NeedAudio && (string.IsNullOrEmpty(this.audioClip) || !this.audioClip.StartsWith("Audio")))
        {
            this.SetAudioClip("Audio/UI/UI_Button_ok");
        }
        this.m_CD.SetClickCD(this.CustomClickCDGroup, this.CustomClickCD);
        this.ClickCanceled = false;
    }