// 현재 상태값 전송 (애니메이션용)
 void StateSend()
 {
     if (m_prevState != m_roboState)
     {
         NetworkManager.Instance().SendOrderMessage(
             JSONMessageTool.ToJsonOrderStateValueChange(
                 m_movePlayerName + "_robot",
                 m_roboState));
     }
 }
Пример #2
0
 void StateSend()
 {
     if (m_prevState != m_curState)
     {
         // if (!BitControl.Get(m_curState , (int)HERO_STATE.IDLE))
         NetworkManager.Instance().SendOrderMessage(
             JSONMessageTool.ToJsonOrderStateValueChange(
                 m_userName, m_curState));
     }
 }
Пример #3
0
    bool NetworkObjectCheck()
    {
        if (m_isNetworkObject)
        {
            return(false);
        }

        if (m_networkObjectCheck)
        {
            return(true);
        }
        if (GameManager.Instance().m_curSceneState.Equals("play") &&
            NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            Vector3 pos = transform.position;
            m_name = "monster_" + GameManager.Instance().PLAYER.USER_NAME + "_" + this.GetHashCode();
            string dataName = m_skeletonAnimation.skeletonDataAsset.name;

            if (dataName.Equals("mon_planet2_SkeletonData"))
            {
                // 수정해라
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "PlanetMonster2", pos.x, pos.y, -1.0f));
            }


            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonOrderStateValueChange(m_name, m_hp));
            MoveSend();

            NetworkManager.Instance().AddNetworkOrderMessageEventListener(this);
            m_networkObjectCheck = true;

            // 초기 시작값
            this.m_skeletonAnimation.state.SetAnimation(0, ANI_IDLE, true);
            // m_heroTarget = GameManager.Instance().PLAYER.PLAYER_HERO;
            return(true);
        }
        else if (!string.IsNullOrEmpty(NetworkOrderController.ORDER_NAME) && !string.IsNullOrEmpty(GameManager.Instance().PLAYER.USER_NAME) &&
                 !NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            GameObject.Destroy(gameObject);
        }
        return(false);
    }
Пример #4
0
    bool NetworkObjectCheck()
    {
        if (m_isNetworkObject)
        {
            return(false);
        }

        if (m_networkObjectCheck)
        {
            return(true);
        }
        if (GameManager.Instance().m_curSceneState.Equals("play") &&
            NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            Vector3 pos = transform.position;
            m_name = "monster_" + GameManager.Instance().PLAYER.USER_NAME + "_" + this.GetHashCode();
            string dataName = m_skeletonAnimation.skeletonDataAsset.name;

            NetworkManager.Instance().SendOrderMessage(
                JSONMessageTool.ToJsonCreateOrder(m_name, "InsidePentrationMonster", pos.x, pos.y, -1.0f));


            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonOrderStateValueChange(m_name, m_hp));
            MoveSend();

            NetworkManager.Instance().AddNetworkOrderMessageEventListener(this);
            m_networkObjectCheck = true;
            m_skeletonAnimation.state.Complete += State_Complete;
            return(true);
        }
        else if (!string.IsNullOrEmpty(NetworkOrderController.ORDER_NAME) && !string.IsNullOrEmpty(GameManager.Instance().PLAYER.USER_NAME) &&
                 !NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            GameObject.Destroy(gameObject);
        }
        return(false);
    }
 void StateSend()
 {
     NetworkManager.Instance().SendOrderMessage(
         JSONMessageTool.ToJsonOrderStateValueChange(m_name, m_index));
 }
Пример #6
0
    bool NetworkObjectCheck()
    {
        if (m_tutorial)
        {
            if (m_pattern == null)
            {
                m_pattern = new MonsterPattern(m_skeletonAnimation, ANI_MOVE, ANI_ATTACK, null);
                m_skeletonAnimation.state.Complete += State_Complete;
            }
            return(true);
        }
        if (m_isNetworkObject)
        {
            return(false);
        }

        if (m_networkObjectCheck)
        {
            return(true);
        }
        if (GameManager.Instance().m_curSceneState.Equals("play") &&
            NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            Vector3 pos = transform.position;
            m_name = "monster_" + GameManager.Instance().PLAYER.USER_NAME + "_" + this.GetHashCode();
            string dataName = m_skeletonAnimation.skeletonDataAsset.name;

            if (dataName.Equals("mon2_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "monster1", pos.x, pos.y, -1.0f));
            }
            else if (dataName.Equals("mon3_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "monster2", pos.x, pos.y, -1.0f));
            }
            else if (dataName.Equals("mon_space1_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "SpaceMonster1", pos.x, pos.y, -1.0f));
            }
            else if (dataName.Equals("mon_space2_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "SpaceMonster2", pos.x, pos.y, -1.0f));
            }
            ///행성 몹
            else if (dataName.Equals("mon_planet1_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "PlanetMonster1", pos.x, pos.y, -1.0f));
                m_curAttackType = AttackType.MOVE_AND_ATTACK;
            }
            else if (dataName.Equals("mon_planet3_SkeletonData"))
            {
                NetworkManager.Instance().SendOrderMessage(
                    JSONMessageTool.ToJsonCreateOrder(m_name, "PlanetMonster3", pos.x, pos.y, -1.0f));
                m_curAttackType = AttackType.MOVE_AND_ATTACK;
            }

            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonOrderStateValueChange(m_name, m_hp));
            MoveSend();

            NetworkManager.Instance().AddNetworkOrderMessageEventListener(this);
            m_networkObjectCheck = true;
            m_pattern            = new MonsterPattern(m_skeletonAnimation, ANI_MOVE, ANI_ATTACK, m_name);
            m_skeletonAnimation.state.Complete += State_Complete;
            return(true);
        }
        else if (!string.IsNullOrEmpty(NetworkOrderController.ORDER_NAME) && !string.IsNullOrEmpty(GameManager.Instance().PLAYER.USER_NAME) &&
                 !NetworkOrderController.ORDER_NAME.Equals(GameManager.Instance().PLAYER.USER_NAME))
        {
            GameObject.Destroy(gameObject);
        }
        return(false);
    }