Exemple #1
0
        public void RigisterButtonEvent(EventTriggerListener.EventDelegate delHandle, string btnName)
        {
            GameObject go = UnityHelper.DeepFind(gameObject.transform, btnName).gameObject;

            if (go != null)
            {
                EventTriggerListener.Get(go).onClick = delHandle;
            }
        }
    private void Start()
    {
        weaponHandleL = UnityHelper.DeepFind(transform, "weaponHandleL").gameObject;
        weaponHandleR = UnityHelper.DeepFind(transform, "weaponHandleR").gameObject;

        colL = weaponHandleL.GetComponentInChildren <Collider>();
        colR = weaponHandleR.GetComponentInChildren <Collider>();

        wcL = BindWeaponController(weaponHandleL);
        wcR = BindWeaponController(weaponHandleR);
    }
Exemple #3
0
        //--------------------------------------------------------------------------------------


        private void Awake()
        {
            _transRootCanvas = GameObject.FindGameObjectWithTag(UISysDefined.SyS_TAG_CANVAS).transform;
            _transScript     = UnityHelper.DeepFind(_transRootCanvas, UISysDefined.SYS_SCRIPTMANAGER_NODE);
            UnityHelper.SetParent(_transScript, this.gameObject.transform);
            _topPanel  = _transRootCanvas;
            _meskPanel = UnityHelper.DeepFind(_transRootCanvas.transform, "_UIMaskPanel").gameObject;
            _camera    = GameObject.FindGameObjectWithTag("_TagUICamera").gameObject.GetComponent <Camera>();

            if (_camera != null)
            {
                _originalCameraDepth = _camera.depth;
            }
            else
            {
                Debug.Log("无法找到相机");
            }
        }