コード例 #1
0
    // Use this for initialization
    public void Start()
    {
        try {
            statusBG        = this.gameObject.FindChildByName("InfoBG", true);
            layerText       = UnityUIUtil.FindText(statusBG, "LayerText");
            layerUpButton   = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "LayerUpButton", on_up_button);
            layerDownButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "LayerDownButton", on_down_button);

            ButtonLongPress layerUpHold = layerUpButton.gameObject.AddComponent <ButtonLongPress>();
            layerUpHold.HoldTime = 0.5f; layerUpHold.RepeatTime = 0.1f;
            layerUpHold.onLongPress.AddListener(on_up_button_longpress);

            ButtonLongPress layerDownHold = layerDownButton.gameObject.AddComponent <ButtonLongPress>();
            layerDownHold.HoldTime = 0.5f; layerDownHold.RepeatTime = 0.1f;
            layerDownHold.onLongPress.AddListener(on_down_button_longpress);

            statusBG.SetVisible(false);
            visible   = false;
            cur_layer = -1;
        } catch (Exception e) {
            DebugUtil.Log("StatusPanelSetup Start(): " + e.Message);
        }
    }
コード例 #2
0
        public void Init(Transform transRoot, UIMatchSelfSkillLogic uiParent, UIBattleMainData data)
        {
            battleModule          = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            myRunData             = battleModule.myRunData;
            endPos                = battleModule.matchInit.funcs.GetEnd();
            uIMatchSelfSkillLogic = uiParent;
            uiData                = data;

            isInited       = false;
            transform      = transRoot;
            image_SkillBtn = transform.GetComponent <ButtonLongPress>();
            if (image_SkillBtn == null)
            {
                image_SkillBtn = transform.gameObject.AddComponent <ButtonLongPress>();
            }
            image_Background  = transform.Find("Background").GetComponent <Image>();
            image_Fill        = transform.Find("Fill").GetComponent <Image>();
            image_SkillIcon   = transform.Find("SkillIcon").GetComponent <Image>();
            image_SkillIconZZ = transform.Find("SkillIconZZ").GetComponent <Image>();
            text_SkillCD      = transform.Find("SkillCD").GetComponent <Text>();
            currTime          = 0f;

            AddEvent();
        }
コード例 #3
0
ファイル: Birb.cs プロジェクト: pichoup/Birbs
 private void Awake()
 {
     blp       = GetComponent <ButtonLongPress>();
     eggSprite = Resources.Load <Sprite>("eggSprite");
 }