// Use this for initialization public void StartTurnManager(GamePlay gp) { gPlay = gp; this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = (float)gPlay.TurnDuration; }
// Start is called before the first frame update public void InitializeTurnManager() { gameManager = FindObjectOfType <OnlineGameManager>(); this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; turnManager.TurnDuration = 60f; }
private void Start() { t = gameObject.AddComponent <PunTurnManager>(); t.TurnDuration = 30; t.TurnManagerListener = this; InitTurn(); }
private void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = TurnDuration; PlayerText.text = PhotonNetwork.player.NickName; Debug.Log("ID" + PhotonNetwork.player.ID); if (playerPrefab == null) { Debug.LogError("<Color=Red><a>Missing</a></Color> playerPrefab Reference. Please set it up in GameObject 'Game Manager'", this); } else { if (PlayerManager.LocalPlayerInstance == null) { Debug.Log("We are Instantiating LocalPlayer from " + Application.loadedLevelName); // we're in a room. spawn a character for the local player. it gets synced by using PhotonNetwork.Instantiate if (PhotonNetwork.playerList.Length == 1) { PhotonNetwork.Instantiate(this.playerPrefab.name, new Vector3(-4f, -5f, 0f), Quaternion.identity, 0); } else { PhotonNetwork.Instantiate(this.playerPrefab.name, new Vector3(-4f, 5f, 0f), Quaternion.identity, 0); } } else { Debug.Log("Ignoring scene load for " + Application.loadedLevelName); } } }
private void Start() { print("Start"); gameOverText.text = ""; instance = this; array = new char[size][]; for (int i = 0; i < size; ++i) { array[i] = new char[size]; } offset = new Vector3Int(-size / 2, -size / 2, 0); var cell = new Vector3Int(); int max = size / 2; for (cell.x = offset.x; cell.x <= max; ++cell.x) { for (cell.y = offset.y; cell.y <= max; ++cell.y) { background.SetTile(cell, tileGround); } } var col = background.GetComponent <BoxCollider2D>(); col.size = new Vector2(size, size); R.t = turnManager = gameObject.AddComponent <PunTurnManager>(); turnManager.TurnManagerListener = this; turnManager.TurnDuration = duration; OnPhotonPlayerConnected(null); print("Over: " + turnManager.IsOver); print("Init Turn: " + turnManager.Turn); }
// Use this for initialization void OnEnable() { init_grid(); init_color(); isBlasting = false; totalPlayers = PhotonNetwork.room.PlayerCount; isGameOver = new bool[totalPlayers]; isTurnCame = new bool[totalPlayers]; for (int i = 0; i < totalPlayers; i++) { isGameOver [i] = false; isTurnCame [i] = false; } turnManager = this.gameObject.AddComponent <PunTurnManager>(); turnManager.TurnManagerListener = this; if (!PhotonNetwork.isMasterClient) { PhotonView photonView = PhotonView.Get(this); if (photonView != null) { photonView.RPC("updateOnMainScreen", PhotonTargets.MasterClient); } } }
public void Initialize(PunTurnManager turnManager) { this.pPunTurnManager = turnManager; Debug.Assert(pPunTurnManager != null); ResetInput(); }
/// <summary> /// Debug du lieu Turn Manager /// </summary> /// <param name="t"></param> /// <returns></returns> public static void Info(this PunTurnManager t) { Debug.Log($"IsOver: {t.IsOver} ,IsFinishedByMe: {t.IsFinishedByMe} " + $",IsCompletedByAll: {t.IsCompletedByAll} \n" + $"Turn: {t.Turn} ,TurnDuration: {t.TurnDuration}" + $" ,RemainingTime: {t.RemainingSecondsInTurn} \n" + $"ElapseTime: {t.ElapsedTimeInTurn}"); }
/// <summary> /// ターンが時間切れになった時に呼び出される /// </summary> /// <param name="turn"></param> void IPunTurnManagerCallbacks.OnTurnTimeEnds(int turn) { Debug.LogFormat("OnTurnTimeEnds {0}", turn); // 新たなターンを開始する PunTurnManager turnManager = GameObject.FindObjectOfType <PunTurnManager>(); turnManager.BeginTurn(); }
void Start() { m_rb = GetComponent <Rigidbody2D>(); m_view = GetComponent <PhotonView>(); // 落ちないようにする m_rb.constraints = RigidbodyConstraints2D.FreezePositionY | RigidbodyConstraints2D.FreezeRotation; m_turnManager = GameObject.FindObjectOfType <PunTurnManager>(); // PunTurnManager がシーン内に一つしかないことを前提とする }
void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); // добавили компанент this.turnManager.TurnManagerListener = this; // добавили слушетеля this.turnManager.TurnDuration = 5f; // время ожидания между очередями PhotonNetwork.ConnectUsingSettings(null); //подключаемся PhotonHandler.StopFallbackSendAckThread(); // заморозил соединение }
void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 10f; RefreshUIViews(); }
// Use this for initialization void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 10f; listAnswer = new List <GameObject>(); boxSpawnArea = spawnArea.GetComponent <BoxCollider>(); }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5f; ButtonCanvasGroup.interactable = false; RefreshUIViews(); }
private void Awake() { PhotonNetwork.autoJoinLobby = false; PhotonNetwork.logLevel = Loglevel; Instance = this; this.TurnManager = this.gameObject.AddComponent <PunTurnManager>(); this.TurnManager.TurnManagerListener = this; this.TurnManager.TurnDuration = 500f; }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); //添加组件并赋值 this.turnManager.TurnManagerListener = this; //为监听器赋值,从而触发下面的回调函数来完成游戏逻辑 this.turnManager.TurnDuration = 120f; //初始化回合持续时间 Instance = this; RefreshUIViews(); //刷新UI视图 }
public void Start() { this.turnManager = base.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5f; this.localSelectionImage.gameObject.SetActive(false); this.remoteSelectionImage.gameObject.SetActive(false); base.StartCoroutine("CycleRemoteHandCoroutine"); this.RefreshUIViews(); }
public void Start() { initialiserPersonnages = false; initialiserPartie = false; this.TurnManager = this.gameObject.AddComponent <PunTurnManager>(); this.TurnManager.TurnManagerListener = this; this.TurnManager.TurnDuration = 30f; view = gameObject.GetComponent <PhotonView>(); RefreshUIViews(); }
private void Start() { #if UNITY_EDITOR Connect(); #endif this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 60f; GameManager.Inst.UISetup(); }
// Use this for initialization void Start() { // Start scene for selecting Champ/Deck and retrieve that information // Pass Info from GUI selection to connect - later these selections will be passed to SpawnPlayer so that they have dekc /hand dealing info TurnManager = this.GetComponent <PunTurnManager>(); oppHandContainer = GameObject.FindWithTag("OppHand"); oppLeftContainer = GameObject.Find("OppLeft"); oppRightContainer = GameObject.Find("OppRight"); Connect(); }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); //添加组件并赋值 this.turnManager.TurnManagerListener = this; //为监听器赋值,从而触发下面的回调函数来完成游戏逻辑 this.turnManager.TurnDuration = 5f; //初始化回合持续时间 this.localSelectionImage.gameObject.SetActive(false); //激活本地选择图片 this.remoteSelectionImage.gameObject.SetActive(false); //激活远程选择图片 this.StartCoroutine("CycleRemoteHandCoroutine"); //启动协程,间隔0.5秒随机一个手势 RefreshUIViews(); //刷新UI视图 }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); // добавили компанент this.turnManager.TurnManagerListener = this; // добавили слушетеля this.turnManager.TurnDuration = 5f; //аремя поворота? this.localSelectionImage.gameObject.SetActive(false); //картинка this.remoteSelectionImage.gameObject.SetActive(false); //картинка this.StartCoroutine("CycleRemoteHandCoroutine"); // пошла коратина, возращает от 1 до 4 RefreshUIViews(); }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); //添加组件并赋值 this.turnManager.TurnManagerListener = this; //为监听器赋值,从而触发下面的回调函数来完成游戏逻辑 this.turnManager.TurnDuration = TurnTime; //初始化回合持续时间 if (this.source == null) { this.source = FindObjectOfType <AudioSource>(); } Instance = this; RefreshUIViews(); //刷新UI视图 }
void Start() { // Demo code, will be removed after test //* //DemoStart(); //*/ // Add and initialize PunTurnManager poTurnManager = this.gameObject.AddComponent <PunTurnManager>(); poTurnManager.TurnManagerListener = this; poTurnManager.TurnDuration = this.turnDuration; // Create avatars for local and remote players poMyAvatar = new Avatar(); poOtherAvatar = new Avatar(); poMyAvatar.Initialize(PhotonNetwork.LocalPlayer, this.initialHP); // TODO: replace null with an actual player if (PhotonNetwork.PlayerList[0] == PhotonNetwork.LocalPlayer) { poOtherAvatar.Initialize(PhotonNetwork.PlayerList[1], this.initialHP); } else { poOtherAvatar.Initialize(PhotonNetwork.PlayerList[0], this.initialHP); } // Initialize ActionManager, it's a singleton ActionManager.Initialize(poMyAvatar, poOtherAvatar); // Initialize UIManager this.pUIManager = this.gameObject.GetComponentInChildren <UIManager>(); Debug.Assert(pUIManager != null); pUIManager.OnInitialize(poMyAvatar, poOtherAvatar); // Initialize InputManager this.pInputManager = this.gameObject.GetComponentInChildren <InputManager>(); Debug.Assert(pInputManager != null); pInputManager.Initialize(this.poTurnManager); // StartCoroutine("StartBattle"); }
public void Start() { spawn = GameObject.Find("GameManager").GetComponent <Spawn> (); sparr = new List <GameObject>(); this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5f; this.localSelectionImage.gameObject.SetActive(false); this.remoteSelectionImage.gameObject.SetActive(false); this.StartCoroutine("CycleRemoteHandCoroutine"); RefreshUIViews(); }
void Start() { ClickBtn = GetComponentsInChildren <AudioSource>()[0]; ChooseCard = GetComponentsInChildren <AudioSource>()[1]; xmlprocess = new Xmlprocess(); this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 15f; cardCount = 12; C_correctNum = -1; //當前連續答對題數 max_correctNum = -1; //最大連續答對數 correctNum = 0; //累計正確題數 hintLA_count = 10000; hintST_count = 10000; c_hintLA_count = 0; c_hintST_count = 0; wrongNum = 0; IsShowingResults = false; RefreshConnectUI(); }
public void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5; this.localSelectionImage.gameObject.SetActive(false); this.remoteSelectionImage.gameObject.SetActive(false); this.StartCoroutine("CycleRemoteHandCoroutine"); // when we play this scene in the editor (without the other scene), make sure we connect, too if (!PhotonNetwork.connected && !PhotonNetwork.connecting) { RpsDemoConnect dc = gameObject.AddComponent <RpsDemoConnect>(); dc.ApplyUserIdAndConnect(); } }
void Update() { // 自分の番ではない時は何もしない if (!m_isMyTurn) { return; } // カメラの位置 → マウスでクリックした場所に Ray を飛ばすように設定する Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; // out パラメータで Ray の衝突情報を受け取るための変数 // Ray を飛ばして、コライダーに当たったかどうかを戻り値で受け取る bool isHit = Physics.Raycast(ray, out hit); // Ray が当たったかどうかで異なる処理をする if (isHit) { // Ray が当たっている時は線を引くために hitpoint にアンカーを移動する Vector3 lookAtPosition = hit.point; lookAtPosition.y = this.transform.position.y; this.transform.LookAt(lookAtPosition); m_hitPoint.position = hit.point; // Ray が当たっている状態で Fire したら if (Input.GetButtonUp("Fire1")) { // 自分のターンが終わったことを通知する PunTurnManager turnManager = GameObject.FindObjectOfType <PunTurnManager>(); turnManager.SendMove(null, true); // 第一引数でメッセージを送れるが、今回は何もしない / 第二引数に true を渡すことで「自分のターンを終了する」ことを通知する FinishMyTurn(); // ローカルでの自ターン管理をする PhotonNetwork.Instantiate(m_explosionPrefabName, hit.point, Quaternion.identity); // 爆発エフェクトを生成する } } else { // Ray が当たっていない時は、レーザーを消すために銃口とレーザーの終点を同じ位置にする m_hitPoint.position = m_muzzle.position; } }
public void Construct(float turnDuration) { _turnManager = gameObject.AddComponent <PunTurnManager>(); _turnManager.TurnManagerListener = this; _turnManager.TurnDuration = turnDuration; }
void Start() { this.turnManager = this.gameObject.AddComponent <PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5f; }
public void Start() { this.turnManager = this.gameObject.AddComponent<PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5; this.localSelectionImage.gameObject.SetActive(false); this.remoteSelectionImage.gameObject.SetActive(false); this.StartCoroutine("CycleRemoteHandCoroutine"); // when we play this scene in the editor (without the other scene), make sure we connect, too if (!PhotonNetwork.connected && !PhotonNetwork.connecting) { RpsDemoConnect dc = gameObject.AddComponent<RpsDemoConnect>(); dc.ApplyUserIdAndConnect(); } }
public void Start() { this.turnManager = this.gameObject.AddComponent<PunTurnManager>(); this.turnManager.TurnManagerListener = this; this.turnManager.TurnDuration = 5f; this.localSelectionImage.gameObject.SetActive(false); this.remoteSelectionImage.gameObject.SetActive(false); this.StartCoroutine("CycleRemoteHandCoroutine"); RefreshUIViews(); }