Exemplo n.º 1
0
        protected override void OnButtonClick(GameObject go)
        {
            base.OnButtonClick(go);
            switch (go.name)
            {
            case "InteractButton":
                Rebana.GetPlayer().OnConfirmButtonClick();
                break;

            case "VehicleOnOffButton":
                OnVehicleOnOffButtonClick();
                break;

            case "HumanEquipButton":
                GameEntry.Controller.CharacterInfo.OpenCharacterForm();
                break;

            case "KnapsackButton":
                GameEntry.Controller.Knapsack.OpenKnapsackForm();
                break;

            case "SystemButton":

                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 加载实体成功
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="gameEventArgs"></param>
        private void ShowEntitySuccess(object sender, GameEventArgs gameEventArgs)
        {
            var ne      = (ShowEntitySuccessEventArgs)gameEventArgs;
            var mapData = ne.UserData as MapData;

            if (mapData == null)
            {
                return;
            }

            CurrentMap = (Map)ne.Entity.Logic;
            CurrentMap.transform.position = m_MapPos;
            Log.Debug("加载地图成功 mapId" + mapData.Id);

            if (!GameEntry.Sound.CheckPlaying(m_BackgroundMusicId))
            {
                // 播放地图背景音乐
                GameEntry.Sound.PlayMusic(m_BackgroundMusicId);
            }

            // 设置地图事件 比如初始化角色位置 剧情等
            Rebana.GetPlayer().GetComponent <RebanaMovement>().Born(m_BornPos);
            Cliff.GetPlayer().GetComponent <CliffMovement>().Born(m_BornPos);
            Margaret.GetPlayer().GetComponent <MargaretMovement>().Born(m_BornPos);

            Cliff.GetPlayer().GetComponent <CliffMovement>().IsFollowing       = true;
            Margaret.GetPlayer().GetComponent <MargaretMovement>().IsFollowing = true;

            // 取消订阅事件
            GameEntry.Event.Unsubscribe(ShowEntitySuccessEventArgs.EventId, ShowEntitySuccess);
            GameEntry.Event.Unsubscribe(ShowEntityFailureEventArgs.EventId, ShowEntityFailure);

            // 派发事件
            GameEntry.Event.Fire(this, ReferencePool.Acquire <ChangeMapSuccessEventArgs>());
        }
Exemplo n.º 3
0
        private void BlockSignalsOnOnBlockStart(Block block)
        {
            switch (Rebana.GetPlayer().GetComponent <RebanaMovement>().Direction)
            {
            case DirectionType.Up:
                PlayIdle(DirectionType.Down);
                break;

            case DirectionType.Down:
                PlayIdle(DirectionType.Up);
                break;

            case DirectionType.Left:
                PlayIdle(DirectionType.Right);
                break;

            case DirectionType.Right:
                PlayIdle(DirectionType.Left);
                break;
            }
            Log.Debug("开始 " + block.BlockName);
        }
Exemplo n.º 4
0
 protected override void Start()
 {
     base.Start();
     FollowTarget = Rebana.GetPlayer().GetComponent <RebanaMovement>();
 }