Esempio n. 1
0
    //LocalPlayerのチャット再生
    public void Play()
    {
        GameObject localPlayer = netConnector.GetLocalPlayer();

        if (null != localPlayer)
        {
            //チャット再生フラグの切り替え
            localPlayer.GetComponent <PlayerSyncChat>().SendChatFlg(true);
        }
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        if (targetObject_Green == null)
        {
            Debug.Log("タヌキのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Sand == null)
        {
            Debug.Log("キツネのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Ice == null)
        {
            Debug.Log("イヌのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Town == null)
        {
            Debug.Log("ネコのリザルトオブジェクトの設定してー");
        }

        charInfo    = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();
        player      = netConnector.GetLocalPlayer();
        scoreObject = GameObject.Find("ResultManager/ResultObjectScore/Canvas/Score000");

        GameObject manager = GameObject.Find("LoadSceneManager");

        if (null != manager)
        {
            loadSceneManager = manager.GetComponent <LoadSceneManager> ();
        }

        GameObject audio = GameObject.Find("AudioManager");

        if (null != audio)
        {
            audioManager = audio.GetComponent <AudioManager> ();
        }
    }
Esempio n. 3
0
    void Update()
    {
        //アトリビュート[Server]はクライアント側でも呼び出されるため。アトリビュートを付ける意味はクライアントで呼び出された時にWarningを吐きだす
        if (isServer)
        {
            ServerUpdate();
        }
        else
        {
            //吹き出しフラグ有効時
            if (fukidashiFlg)
            {
                //紐づいている人数を算出
                int num = 0;
                num          = transportNum - syncSetPlayerNum;
                numText.text = num.ToString();

                if (num == 1)
                {
                    numText.color = new Color(1f, 0.2f, 0.2f);
                }
                else
                {
                    numText.color = new Color(0f, 0f, 0f);
                }

                //ローカルプレイヤーとの距離を出す
                if (null != netConnector.GetLocalPlayer())
                {
                    Vector3 playerPos = netConnector.GetLocalPlayer().gameObject.transform.localPosition;
                    length = Vector3.Distance(playerPos, gameObject.transform.localPosition);

                    //距離に応じて吹き出しを描画する
                    if (length < fDistance * 3)
                    {
                        if (!fukidashi.gameObject.activeSelf)
                        {
                            fukidashi.gameObject.SetActive(true);
                        }
                    }

                    //規定人数もしくは距離が離れていたら消す
                    if (length >= fDistance || num <= 0)
                    {
                        if (fukidashi.gameObject.activeSelf)
                        {
                            fukidashi.gameObject.SetActive(false);
                        }
                    }
                }
            }
            else
            {
                //ミッションフラグ有効時に表示させる
                if (missionManager.GetMissionFlg())
                {
                    fukidashiFlg = true;
                }
            }
        }
    }