Beispiel #1
0
    public override void OnJoinedRoom()
    {
        Body = Network.Instantiate("GamePlayer", Vector3.zero, Quaternion.identity);
        SetClientTransform(IsHost ? masterTransform : subTransform);

        StartCoroutine(GyroRotate());
    }
Beispiel #2
0
 GameObject CreateNPC()
 {
     if (Net.IsMasterClient)
     {
         print("We're master client so let's wait for another client\n"
               + "to instantiate the test NPC");
         return(null);
     }
     print("Not master client so let's create a NPC");
     return(Net.Instantiate(avatar, @fixed, Quaternion.identity, 0));
 }
Beispiel #3
0
    void Generate()
    {
        string  suffix = null;
        Vector3 P      = transform.position + Random.insideUnitSphere * radius;

        P.y = transform.position.y;
        var x = Net.Instantiate(prefab, P,
                                Quaternion.AngleAxis(Random.Range(0, 360), Vector3.up), 0);

        x.name = prefab + (suffix != null ? suffix : "");
        PhotonView.Get(x).OwnershipTransfer = OwnershipOption.Takeover;
    }
Beispiel #4
0
 GameObject CreatePlayer()
 {
     print("Create a player object");
     return(Net.Instantiate(
                avatar, random ? spawn : @fixed, Quaternion.identity, 0));
 }