public void OnDestroy()
 {
     if (BMC.getObserverBehaviour() != null)
     {
         BMC.getObserverBehaviour().cleanTargetSubscriberMsg(this);
     }
 }
        public void Start()
        {
            List <GameObject> goLst = new List <GameObject>();
            List <PlayerConstant.PlayerControlerType> pctLst = new List <PlayerConstant.PlayerControlerType>();


            //      ===================== test ===============================
            _unitsGameObjArr = GameObject.FindGameObjectsWithTag("tag_testPlayers");
            _mainPlayer      = GameObject.FindGameObjectWithTag("Player");

            foreach (GameObject item in _unitsGameObjArr)
            {
                goLst.Add(item);
                pctLst.Add(PlayerConstant.PlayerControlerType.FOLLOWER);
            }


            goLst.Add(_mainPlayer);
            pctLst.Add(PlayerConstant.PlayerControlerType.PROTAGONIST);



            BMC.registerInitCompleteBehaviourManager(BehaviourManagerType.PLAYER_MOVEMENT, this);


            BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.PLAYER_CONTROLER_CHANGED, new object[] { goLst, pctLst });
            BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.PLAYER_FOLLOW_TARGET_CHANGED, _mainPlayer);


            BMC.getObserverBehaviour().registerMsg(this);


            //      ===================== test ===============================
        }
Esempio n. 3
0
        //  ========================= AIMovement =========================
        //protected override PlayerMovementDescribeVo absCreatePlayerDescribeVo()
        //{
        //    PlayerMovementDescribeVo pmd = new PlayerMovementDescribeVo();
        //    pmd.isAddClickGroundMask = true;
        //    pmd.playerControlerType = PlayerConstant.PlayerControlerType.INCONTROLLABLE;
        //    return pmd;
        //}

        //protected override void absClickGroundMaskAddComplete( GameObject _maskGo )
        //{
        //    _maskGo.SetActive( false );
        //}

        protected override void absStart()
        {
            _gameConfigVo = BMC.getGameConfigBehaviour().gameConfigVo;

            _ani = GetComponent <Animator>();
            _ani.applyRootMotion = true;
            _ani.updateMode      = AnimatorUpdateMode.Normal;
            _ani.cullingMode     = AnimatorCullingMode.AlwaysAnimate;


            playerRigidbody.useGravity             = true;
            playerRigidbody.isKinematic            = false;
            playerRigidbody.detectCollisions       = !playerRigidbody.isKinematic;
            playerRigidbody.interpolation          = RigidbodyInterpolation.Interpolate;
            playerRigidbody.collisionDetectionMode = CollisionDetectionMode.Discrete;
            playerRigidbody.constraints            = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionY;



            //  构建一个lookAt朝向定位球 最后一个路径 朝向有点小偏差
            _lookAtPositionDeviceGo      = new GameObject();
            _lookAtPositionDeviceGo.name = "[朝向]定位球";


            BMC.getObserverBehaviour().registerMsg(this);
        }
Esempio n. 4
0
        public void Start()
        {
            _gameConfigVo = BMC.getGameConfigBehaviour().gameConfigVo;

            sendFsmEvent(FSMEventsBlackBoard.FSM_DEFAULT_SETTING);

            BMC.getObserverBehaviour().registerMsg(this);
        }
Esempio n. 5
0
        //  ========================= AIMovement =========================
        //protected override PlayerMovementDescribeVo absCreatePlayerDescribeVo()
        //{
        //    PlayerMovementDescribeVo pmd = new PlayerMovementDescribeVo();
        //    pmd.isAddClickGroundMask = true;
        //    pmd.playerControlerType = PlayerConstant.PlayerControlerType.INCONTROLLABLE;
        //    return pmd;

        //}

        //protected override void absClickGroundMaskAddComplete( GameObject _maskGo )
        //{
        //    _maskGo.SetActive( false );
        //}

        protected override void absStart()
        {
            _ani = GetComponent <Animator>();

            playerRigidbody.isKinematic      = true;
            playerRigidbody.detectCollisions = false;

            BMC.getObserverBehaviour().registerMsg(this);
        }
        public void Start()
        {
            if (_maskGo == null)
            {
                _maskGo = BMC.getPrefabsBehaviour().instantiatePrefab(PrefbasAssets.PrefabAssetsConstant.CLICKED_GROUND_MASK, false);
            }

            BMC.getObserverBehaviour().registerMsg(this);

            BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_GLOBALBLACKBOARD_FINISHED, this);
        }
        protected override void absStart()
        {
            _currCanMoveNavMeshPath = new NavMeshPath();

            _tpLookAt   = new TweenParams().SetEase(Ease.Linear);
            _tpMovement = new TweenParams().SetEase(Ease.Linear).OnUpdate(this.tweenOnMovementUpdate).OnComplete(this.tweenOnMovementComplete);

            _ani = GetComponent <Animator>();
            _ani.applyRootMotion = false;
            _ani.SetBool(aniKeyOnGround, true);

            BMC.getObserverBehaviour().registerMsg(this);
        }
Esempio n. 8
0
 public void Update()
 {
     //  点击左键
     if (UnityEngine.Input.GetButtonDown("Fire1"))
     {
         if (_uiEventSystem.currentSelectedGameObject != null && _uiEventSystem.IsPointerOverGameObject())
         {
             string selectGoName = _uiEventSystem.currentSelectedGameObject.name;
             _uiEventSystem.SetSelectedGameObject(null);
             BMC.getObserverBehaviour().publisheMsgByCoroutine(ObserverMsgTypeEnum.INPUT_CLICKED_HIT_2D_GAME_OBJECT, null);
         }
         else
         {
             BMC.getObserverBehaviour().publisheMsgByCoroutine(ObserverMsgTypeEnum.INPUT_CLICKED_HIT_3D_GAME_OBJECT, null);
         }
     }
 }
Esempio n. 9
0
        public void Start()
        {
            _gameConfigTxtAssetsArr = Resources.LoadAll <TextAsset>("Configs");

            for (int i = 0; i < _gameConfigTxtAssetsArr.Length; i++)
            {
                TextAsset ta = _gameConfigTxtAssetsArr[i];

                string txtAssetsName = ta.name;

                if (txtAssetsName == "GameConfig")
                {
                    this.parseGameConfigXML(ta);
                }

                _gameConfigTxtAssetsArr[i] = null;
            }

            BMC.registerInitCompleteBehaviourManager(BehaviourManagerType.GAME_CONFIG, this);
            BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_GLOBALBLACKBOARD_FINISHED, this);
        }
Esempio n. 10
0
        public void Start()
        {
            BMC.getObserverBehaviour().registerMsg(this);

            RectTransform canvasRt = uiCanvas.GetComponent <RectTransform>();

            Array uiLayerEnumArr = Enum.GetValues(typeof(UIConstant.UILayerType));     // ? 这个类 需要自动生成

            PrefbasAssets.PrefabAssetsConstant uiEmptyContainer = PrefbasAssets.PrefabAssetsConstant.UI_EMPTY_CONTAINER;

            foreach (UIConstant.UILayerType item in uiLayerEnumArr)
            {
                GameObject windowContainer = BMC.getPrefabsBehaviour().instantiatePrefab(uiEmptyContainer, true);

                RectTransform windowRectTransfrom = windowContainer.GetComponent <RectTransform>();
                windowRectTransfrom.name = item.ToString();
                windowRectTransfrom.SetParent(canvasRt);

                string emptyContainerPrefabPath = BMC.getPrefabsBehaviour().getPrefabPath(uiEmptyContainer);
                windowContainer.AddComponent <RectTransfromResetComponent>().reSetRectTransformInfo(emptyContainerPrefabPath);

                _layerContainerMapping[item] = windowContainer;
            }
        }
Esempio n. 11
0
 public void Start()
 {
     BMC.getObserverBehaviour().registerMsg(this);
 }
 public void Start()
 {
     BMC.getObserverBehaviour().registerMsg(this);
     _sm = this.gameObject.GetComponent <StateMachine>();
     sendFinishedFsmEvent();
 }
Esempio n. 13
0
 public void Start()
 {
     BMC.registerInitCompleteBehaviourManager(BehaviourManagerType.INPUT_MOUSE, this);
     BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_GLOBALBLACKBOARD_FINISHED, this);
 }
Esempio n. 14
0
 /// <summary>
 /// ÊÇ·ñ¼ÓÔعýMainScene
 /// </summary>
 /// <returns>true Loaded !</returns>
 private bool isLoadMainScene()
 {
     return(BMC.getObserverBehaviour() != null);
 }
 protected void publisheMsgByCoroutine(ObserverMsgTypeEnum msg, object paramsObj)
 {
     BMC.getObserverBehaviour().publisheMsgByCoroutine(msg, paramsObj);
 }
Esempio n. 16
0
 private void connectionServer()
 {
     BMC.registerInitCompleteBehaviourManager(BehaviourManagerType.GAME_SERVER, this);
     BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_GLOBALBLACKBOARD_FINISHED, this);
 }
Esempio n. 17
0
 protected void sendFsmEvent(int id)
 {
     BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_FSM_EVENT, id);
 }
 public void Start()
 {
     BMC.getObserverBehaviour().publisheMsg(ObserverMsgTypeEnum.BEHAVIOUR_MACHINE_SET_AS_CONCURRENT, this);
 }
 protected override void absStart()
 {
     BMC.getObserverBehaviour().registerMsg(this);
 }