Example #1
0
        protected override void OnCharactorEnter(Charactor other)
        {
            base.OnCharactorEnter(other);


            // 踩中玩家移动速度减慢50%
            // 维持3秒
            // 如已在减速状态下无效
        }
        void OnTriggerExit(Collider other)
        {
            Charactor charactor = other.GetComponent <Charactor>();

            if (charactor != null)
            {
                OnCharactorExit(charactor);
            }
        }
Example #3
0
        protected override void OnCharactorStay(Charactor charactor)
        {
            base.OnCharactorStay(charactor);

            // TODO.

            // 队伍1  补充油漆及复活地点
            // 单机状态默认为玩家自己
        }
        protected override void OnCharactorEnter(Charactor other)
        {
            base.OnCharactorEnter(other);


            // TODO.

            // 踩中玩家传送到场景内除本方块外的随机另一传送方块
            // 如果没有其他传送方块则本方块无效

            GameEntry.Event.Fire(this, new TeleportCharactorEventArgs().Fill(other.Id, Id));
        }
        protected override void OnCharactorEnter(Charactor other)
        {
            base.OnCharactorEnter(other);

            // 踩中玩家上下左右方向颠倒
            // 维持3秒
            // 如已在方向颠倒状态下无效

            if (other.CanReverseMoveDirection())
            {
                other.StartReverseMoveDirection(m_ReverseMoveDirectionDuraction);
            }
        }
        public void Unload(Charactor charactor)
        {
            if (charactor == null)
            {
                return;
            }

            if (charactor.Weapon != null)
            {
                GameEntry.Entity.HideEntity(charactor.Weapon);
            }

            GameEntry.Entity.HideEntity(charactor);
        }
Example #7
0
        protected override void OnAttachTo(EntityLogic parentEntity, Transform parentTransform, object userData)
        {
            base.OnAttachTo(parentEntity, parentTransform, userData);

            CachedTransform.localPosition = Vector3.zero;

            m_Owner = parentEntity as Charactor;

            if (m_Owner == null)
            {
                throw new GameFrameworkException("Not found weapon owner[" + m_Charactor_WeaponData.OwnerId + "].");
            }

            m_Owner.SetupWeapon(this);
        }
Example #8
0
        protected override void OnCharactorEnter(Charactor other)
        {
            base.OnCharactorEnter(other);

            // TODO.

            // 起始值透明
            // 被踩后颜色变为该队颜色
            // 音符方块周边除外
            // 占有颜色数最多的队伍胜出

            if (OwnerType == other.OwnerType)
            {
                return;
            }

            CampType from = OwnerType;

            OwnerType = other.OwnerType;

            CampType to = OwnerType;

            Color toColor = Color.white;

            switch (OwnerType)
            {
            case CampType.Player:
                ColorUtility.TryParseHtmlString(COLOR1, out toColor);
                break;

            case CampType.Player2:
                ColorUtility.TryParseHtmlString(COLOR2, out toColor);
                break;

            case CampType.Enemy:
                ColorUtility.TryParseHtmlString(COLOR3, out toColor);
                break;

            case CampType.Enemy2:
                ColorUtility.TryParseHtmlString(COLOR4, out toColor);
                break;
            }

            m_Renderer.material.SetColor("_Color", toColor);
            m_Renderer.enabled = true;

            GameEntry.Event.Fire(this, new OccupyTerrainEventArgs().Fill(from, to));
        }
        public override void Shutdown()
        {
            m_IsGameStarted = false;

            GameEntry.Event.Unsubscribe(OccupyTerrainEventArgs.EventId, OccupyTerrainEventHandler);
            GameEntry.Event.Unsubscribe(TeleportCharactorEventArgs.EventId, TeleportCharactorEventHandler);

            m_CameraController.Release();

            if (m_Charactor != null)
            {
                m_CharactorManager.Unload(m_Charactor);
                m_Charactor = null;
            }

            m_TerrainManager.Unload();

            base.Shutdown();
        }
        void ShowCharactorSuccessCallback(object sender, GameEventArgs e)
        {
            ShowEntitySuccessEventArgs args = e as ShowEntitySuccessEventArgs;

            if (args == null)
            {
                return;
            }

            m_Charactor = args.Entity.Logic as Charactor;

            if (m_Charactor == null)
            {
                throw new GameFrameworkException("Show charactor entity failed.");
            }

            GameEntry.Event.Unsubscribe(ShowEntitySuccessEventArgs.EventId, ShowCharactorSuccessCallback);
            GameEntry.Event.Subscribe(ShowEntitySuccessEventArgs.EventId, ShowWeaponSuccessCallback);
            GameEntry.Entity.ShowWeapon(m_Charactor.WeaponType, m_Charactor.Id);
        }
Example #11
0
        void LoadCharactorSuccessCallback(Charactor charactor)
        {
            m_Charactor = charactor;

            m_Charactor.StartBorn(m_TerrainManager.GetBornPointA0());
            m_CameraController.Init(m_Charactor.CachedTransform);

            GameEntry.Event.Subscribe(TeleportCharactorEventArgs.EventId, TeleportCharactorEventHandler);
            GameEntry.Event.Subscribe(OccupyTerrainEventArgs.EventId, OccupyTerrainEventHandler);

            /// TODO.
            ///
            /// 游戏开始
            ///

            m_IsGameStarted = true;


            Log.Warning("游戏开始");
        }
Example #12
0
 protected virtual void OnCharactorExit(Charactor charactor)
 {
 }
Example #13
0
 protected virtual void OnCharactorStay(Charactor charactor)
 {
 }
Example #14
0
 protected virtual void OnCharactorEnter(Charactor charactor)
 {
 }