private void Awake()
 {
     Net_Script  = Network_Battle_Script.Getsingleton;
     Game_Script = GamePlay_Script.Getsingleton;
     Tr          = GetComponent <Transform>();
     hasMoved    = false;
 }
Beispiel #2
0
    void Awake()
    {
        Vector2 Size_Delta = transform.GetComponent <RectTransform>().sizeDelta;

        transform.SetParent(GameObject.Find("Canvas").transform);
        transform.localPosition = new Vector3(0, 0, 0);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.GetComponent <RectTransform>().sizeDelta = Size_Delta;
        transform.SetAsLastSibling();//가장 나중에 그려진 레이어로 맞추기

        Play_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();
    }
Beispiel #3
0
    //============================================================================================================================================================================

    void Awake()
    {
        Vector2 Size_Delta = transform.GetComponent <RectTransform>().sizeDelta;

        transform.SetParent(GameObject.Find("Canvas").transform);
        transform.localPosition = new Vector3(0, 0, 0);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.GetComponent <RectTransform>().sizeDelta = Size_Delta;

        Play_Script         = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();
        CameraControlScript = GameObject.Find("Camera_Set_Object").GetComponent <CameraControl_Script>();
        Net_Script          = GameObject.Find("Network_Script").GetComponent <Network_Battle_Script>();
    }
Beispiel #4
0
    //==========================================================================================================================================

    void Awake()
    {
        Net_Script = GameObject.Find("Network_Script").GetComponent <Network_Battle_Script>();

        Game_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();

        //this.transform.GetComponent<Rigidbody>().isKinematic = true;

        Explosion_State = EXPLOSION_STATE.IDEL;

        Move_Check = false;
        Move_Time  = 0.0f;

        Launchar_Physics_Check = false;
    }
    void Awake()
    {
        Vector2 Size_Delta = transform.GetComponent <RectTransform>().sizeDelta;

        transform.SetParent(GameObject.Find("Canvas").transform);
        transform.localPosition = new Vector3(0, 10000, 0);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.GetComponent <RectTransform>().sizeDelta = Size_Delta;

        Play_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();
        Net_Script  = GameObject.Find("Network_Script").GetComponent <Network_Battle_Script>();

        //------------------------------------------------------------------------------------------------------------------------------------------------

        Time_Sound_OJ.SetActive(false);
    }
Beispiel #6
0
    //팀플 조인 답변
    void Recv_TeamPlay_Join(ByteData _Receive_data)
    {
        //플레이어 기본 정보 셋팅
        Link_Script.i.User_Data_Init();

        Game_Script = null;

        Recv_TimerOver_State = RECV_GAMEOVER_SATAE.IDLE;
        Recv_RewardEnd_State = RECV_GAMEOVER_SATAE.IDLE;
        Recv_TimerOver_Data  = null;

        Network_State = NETWORK_STATE.QUICKJOINING;

        //1인 퀵조인 답변
        Recv_Quick_Join(Receive_Buffer);
    }
    void Awake()
    {
        //------------------------------------------------------------------------------------------------------------------------------------------------

        Vector2 Size_Delta = transform.GetComponent <RectTransform>().sizeDelta;

        transform.SetParent(GameObject.Find("Canvas").transform);
        transform.localPosition = new Vector3(0, 0, 0);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.GetComponent <RectTransform>().sizeDelta = Size_Delta;

        Play_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();

        //------------------------------------------------------------------------------------------------------------------------------------------------

        GameOver_OJ.SetActive(false);
        Exit_Button.SetActive(false);

        //------------------------------------------------------------------------------------------------------------------------------------------------

        Transform[] GetTransforms = transform.GetComponentsInChildren <Transform>();

        foreach (Transform child in GetTransforms)
        {
            for (int i = 0; i < Red_Team_Info.Length; i++)
            {
                if (child.name.Equals("1_" + i))
                {
                    Transform[] Child_Transforms = child.transform.GetComponentsInChildren <Transform>();
                    foreach (Transform _Child_Transforms in Child_Transforms)
                    {
                        if (_Child_Transforms.name.Equals("back"))
                        {
                            Red_Team_Info[i].BG_Img = _Child_Transforms.GetComponent <Image>();
                        }
                        else if (_Child_Transforms.name.Equals("image_clanmark"))
                        {
                            Red_Team_Info[i].ClanMark_Img = _Child_Transforms.GetComponent <Image>();
                        }
                        else if (_Child_Transforms.name.Equals("image_flag"))
                        {
                            //Red_Team_Info[i].Country_Img = _Child_Transforms.GetComponent<Image>();
                        }
                        else if (_Child_Transforms.name.Equals("username"))
                        {
                            Red_Team_Info[i].User_Name = _Child_Transforms.GetComponent <Text>();
                        }
                        else if (_Child_Transforms.name.Equals("Text (7)"))
                        {
                            Red_Team_Info[i].User_Kill_Num = _Child_Transforms.GetComponent <Text>();
                        }
                        else if (_Child_Transforms.name.Equals("Text (8)"))
                        {
                            Red_Team_Info[i].User_Death_Num = _Child_Transforms.GetComponent <Text>();
                        }
                    }
                }
            }

            for (int i = 0; i < Blue_Team_Info.Length; i++)
            {
                if (child.name.Equals("2_" + i))
                {
                    Transform[] Child_Transforms = child.transform.GetComponentsInChildren <Transform>();
                    foreach (Transform _Child_Transforms in Child_Transforms)
                    {
                        if (_Child_Transforms.name.Equals("back"))
                        {
                            Blue_Team_Info[i].BG_Img = _Child_Transforms.GetComponent <Image>();
                        }
                        else if (_Child_Transforms.name.Equals("image_clanmark"))
                        {
                            Blue_Team_Info[i].ClanMark_Img = _Child_Transforms.GetComponent <Image>();
                        }
                        else if (_Child_Transforms.name.Equals("image_flag"))
                        {
                            //Blue_Team_Info[i].Country_Img = _Child_Transforms.GetComponent<Image>();
                        }
                        else if (_Child_Transforms.name.Equals("username"))
                        {
                            Blue_Team_Info[i].User_Name = _Child_Transforms.GetComponent <Text>();
                        }
                        else if (_Child_Transforms.name.Equals("Text (7)"))
                        {
                            Blue_Team_Info[i].User_Kill_Num = _Child_Transforms.GetComponent <Text>();
                        }
                        else if (_Child_Transforms.name.Equals("Text (8)"))
                        {
                            Blue_Team_Info[i].User_Death_Num = _Child_Transforms.GetComponent <Text>();
                        }
                    }
                }
            }
        }

        //------------------------------------------------------------------------------------------------------------------------------------------------
    }
Beispiel #8
0
 void Start()
 {
     Game_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();
 }
Beispiel #9
0
    void Awake()
    {
        Game_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();

        CameraControlScript = GameObject.Find("Camera_Set_Object").GetComponent <CameraControl_Script>();

        Net_Script = GameObject.Find("Network_Script").GetComponent <Network_Battle_Script>();

        Char_Controller = GetComponent <CharacterController>();

        Char_Animator = transform.GetComponent <Animator>();

        Audio_Source = transform.GetComponent <AudioSource>();

        //----------------------------------------------------------------------------------------------------------------------------------

        Transform[] GetTransforms = transform.GetComponentsInChildren <Transform>();

        //랙돌 셋팅
        Ragdoll_Layer     = LayerMask.NameToLayer("Ragdoll");
        Ragdoll_Die_Layer = LayerMask.NameToLayer("Ragdoll_Die");

        Bot_Ragdoll_Rigidbody.Clear();

        foreach (Transform child in GetTransforms)
        {
            for (int i = 0; i < Ragdoll_Collider_Name.Length; i++)
            {
                if (child.name.Equals(Ragdoll_Collider_Name[i]))
                {
                    if (Bot_Ragdoll_Rigidbody.ContainsKey(Ragdoll_Collider_Name[i]) == false)
                    {
                        Bot_Ragdoll_Rigidbody.Add(Ragdoll_Collider_Name[i], new Bot_Ragdoll_Rigidbody_class());

                        Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].GameObject_OJ = child.gameObject;
                        Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].Transform_OJ  = child;
                        Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].Rigid_Body    = child.GetComponent <Rigidbody>();
                        //Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].Rigid_Body.collisionDetectionMode = CollisionDetectionMode.Continuous;
                        Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].Rigid_Body.isKinematic = true;
                        Bot_Ragdoll_Rigidbody[Ragdoll_Collider_Name[i]].GameObject_OJ.layer    = Ragdoll_Layer;
                    }
                    break;
                }
            }
        }

        //----------------------------------------------------------------------------------------------------------------------------------

        //아웃라인 효과 오브젝트 가져오기
        foreach (Transform child in GetTransforms)
        {
            if (child.GetComponent <Outline>() != null)
            {
                if (Bot_Out_Line_OJ.ContainsKey(child.name) == false)
                {
                    Bot_Out_Line_OJ.Add(child.name, new Bot_Out_Line_class());
                    Bot_Out_Line_OJ[child.name].OJ         = child.GetComponent <Outline>();
                    Bot_Out_Line_OJ[child.name].OJ.enabled = false;
                }
            }
        }

        //----------------------------------------------------------------------------------------------------------------------------------

        Char_Controller_Layer = LayerMask.NameToLayer("Char_Controller");
    }
Beispiel #10
0
    void Network_Operation()
    {
        if (!Link_Script.i.IsConnected())
        {
            return;
        }

        switch (Network_State)
        {
        case NETWORK_STATE.IDEL:

            break;

        //case NETWORK_STATE.CONNECT_INIT:
        //    break;
        //case NETWORK_STATE.CONNECT_START:
        //    break;
        //case NETWORK_STATE.CONNECTING:
        //    break;
        //case NETWORK_STATE.CONNECTING_OK:
        //    break;
        //case NETWORK_STATE.LOGIN_START:
        //    break;
        //case NETWORK_STATE.LOGGING:
        //    break;
        //case NETWORK_STATE.LOGIN_OK:
        //    break;
        case NETWORK_STATE.QUICKJOIN_START:

            //플레이어 기본 정보 셋팅
            Link_Script.i.User_Data_Init();

            Game_Script = null;

            Recv_TimerOver_State = RECV_GAMEOVER_SATAE.IDLE;
            Recv_RewardEnd_State = RECV_GAMEOVER_SATAE.IDLE;
            Recv_TimerOver_Data  = null;

            Network_State = NETWORK_STATE.QUICKJOINING;

            Send_Quick_Join();

            //Debug.Log("퀵조인 시도");

            break;

        case NETWORK_STATE.QUICKJOINING:
            break;

        case NETWORK_STATE.QUICKJOIN_OK:

            if (!SendManager.Instance.Get_currentScene().Equals("Main"))
            {
                //Debug.Log("씬전환 완료!!!!!!!!!!!!!!!!!");

                Game_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();

                Network_State = NETWORK_STATE.GAMEPLAY_START;
            }

            break;

        case NETWORK_STATE.GAMEPLAY_START:

            Send_GamePlay_Start();

            Send_HeartBeat_Time = 0.0f;
            Recv_HeartBeat_Time = 0.0f;

            Network_Delay_Check = false;

            Network_State = NETWORK_STATE.GAMEPLAYING;

            //Debug.Log("게임 시작 들어간다");

            break;

        case NETWORK_STATE.GAMEPLAYING:

            //하트비트 체크하기
            HeartBeat_Oeration();

            //게임오버 프로토콜 체크 연산
            Recv_GameOver_Operation();

            break;

        case NETWORK_STATE.GAMEPLAY_END:
            break;

        case NETWORK_STATE.ERROR:
            break;

        case NETWORK_STATE.ERROR_WAIT:
            break;
        }
    }
    void Awake()
    {
        Game_Script = GameObject.Find("Script_Object").GetComponent <GamePlay_Script>();

        CameraControlScript = GameObject.Find("Camera_Set_Object").GetComponent <CameraControl_Script>();
    }