コード例 #1
0
    // Use this for initialization
    void Awake()
    {
        Instance   = this;
        PhotonView = GetComponent <PhotonView>();

        PhotonNetwork.sendRate            = 60;
        PhotonNetwork.sendRateOnSerialize = 30;

        SceneManager.sceneLoaded += OnSceneFinishedLoading;
        //PhotonNetwork.automaticallySyncScene = true;
    }
コード例 #2
0
ファイル: Stage.cs プロジェクト: scythae/Shmup
    public static Stage Create()
    {
        GameObject go = new GameObject("Stage");

        StageInfo.instance.gameObject.transform.SetParent(go.transform);

        StageInfo.instance.Score     = 0;
        StageInfo.instance.HitPoints = 0;

        Utils.AssignTransformFromTo(Design.visibleArea.transform, go.transform);
        Utils.ProvideCanvas(go);

        Stage result = go.AddComponent <Stage>();

        EnemySpawning enemySpawning = go.AddComponent <EnemySpawning>();

        enemySpawning.onShipDeath = new UnityAction <Ship>(result.OnEnemyDeath);
        PlayerSpawning playerSpawning = go.AddComponent <PlayerSpawning>();

        playerSpawning.onShipDeath       = new UnityAction <Ship>(result.OnPlayerDeath);
        playerSpawning.onChangeHitPoints = new UnityAction <Ship>(result.OnPlayerChangeHitPoints);

        return(result);
    }