This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: socketweaverSA | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: socketweaverSA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipelines: | |
branches: | |
master: | |
- step: | |
name: Build for staging | |
script: | |
- docker login -u $DOCKER_ID -p $DOCKER_PW | |
- docker build -t <your_dockerid>/<image_name>:latest -t <your_dockerid>/<image_name>:$BITBUCKET_COMMIT . | |
- docker push <your_dockerid>/<image_name>:latest | |
- docker push <your_dockerid>/<image_name>:$BITBUCKET_COMMIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tags: | |
release-*: | |
- step: | |
name: Test for production | |
script: | |
- echo "run test" | |
- step: | |
name: Build for production | |
script: | |
- docker login -u $DOCKER_ID -p $DOCKER_PW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using SWNetwork; | |
using UnityEngine.SceneManagement; | |
public class Lobby : MonoBehaviour | |
{ | |
void Start() | |
{ | |
NetworkClient.Lobby.OnRoomReadyEvent += Lobby_OnRoomReadyEvent; | |
NetworkClient.Lobby.OnFailedToStartRoomEvent += Lobby_OnFailedToStartRoomEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list all secrets | |
kubectl --kubeconfig="kubeconfig.yaml" -n kube-system get secret | |
# find the secret for the service account we created before and output its CA certificate | |
# In our case, its name should start with socketweaverSA-token-* | |
# Add the output of the follow command as the STAGING_LOBBY_CLUSTER_CA pipeline variable | |
kubectl -kubeconfig="kubeconfig.yaml" -n kube-system get secret socketweaverSA-token-xxxxx -o jsonpath="{['data']['ca\.crt']}" | |
# Add the output of the follow command as the STAGING_CLUSTER_SA_TOKEN pipeline variable | |
kubectl --kubeconfig="kubeconfig.yaml" -n kube-system get secret socketweaverSA-token-xxxxx -o jsonpath="{['data']['token']}" | base64 --decode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NetworkID networkId; | |
private void Start() | |
{ | |
Rigidbody rb = GetComponent<Rigidbody>(); | |
rb.centerOfMass = centerOfMass.localPosition; | |
gameSceneManager = FindObjectOfType<GameSceneManager>(); | |
// initialize networkId | |
networkId = GetComponent<NetworkID>(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// expose wheel rotate for the generic tracker | |
public Quaternion frontWheelRot; | |
public Quaternion rearWheelRot; | |
void UpdateWheelTransforms() | |
{ | |
if (networkId.IsMine) | |
{ | |
Quaternion rotation; | |
Vector3 position; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OnSpawnerReady(bool finishedSceneSetup) | |
{ | |
// scene has not been set up. spawn a car for the local player. | |
if (!finishedSceneSetup) | |
{ | |
// assign different spawn point for the host player and the other players in the room | |
// This is okay for this tutorial as we only have 2 players in a room and we are not handling host migration. | |
// To properly assign spawn points, you should use GameDataManger or custom room data. | |
if (NetworkClient.Instance.IsHost) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RemotePropertyAgent remotePropertyAgent; | |
const string PLAYER_PRESSED_ENTER = "PlayersPressedEnter"; | |
private void Start() | |
{ | |
guiManager.SetLapRecord(lap_, lapsToWin); | |
// get a reference of the gameDataManager component | |
remotePropertyAgent = GetComponent<RemotePropertyAgent>(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnTriggerEnter(Collider other) | |
{ | |
GameObject go = other.gameObject; | |
NetworkID networkID = go.GetComponent<NetworkID>(); | |
// check if the player is the local player | |
if (networkID.IsMine) | |
{ | |
lap_ = lap_ + 1; | |
guiManager.SetLapRecord(lap_, lapsToWin); |
OlderNewer