Ejemplo n.º 1
0
    public void TriggerActorSpawn(
        ActorableSearchResult result,
        Vector3 position,
        Quaternion rotation,
        Vector3 scale,
        System.Action <VoosActor> onActorCallback,
        bool isOffstage,
        Color tint,
        Vector3 renderableOffset,
        Quaternion renderableRotation)
    {
        // Do it locally with the full setup.
        SpawnActor spawnActor = GameObject.Instantiate(actorSpawner, Vector3.zero, Quaternion.identity).GetComponent <SpawnActor>();

        spawnActor.onActorCreated = onActorCallback;
        spawnActor.isOffstage     = isOffstage;
        spawnActor.SetTint(tint);
        spawnActor.Setup(
            result, position, rotation, scale, true,
            renderableOffset, renderableRotation);

        // Kick off RPC for others.
        photonView.RPC("TriggerActorSpawnEffectRPC", PhotonTargets.Others, (byte)result.renderableReference.assetType, result.renderableReference.uri,
                       position + renderableOffset, renderableRotation * rotation, scale, tint);
    }
Ejemplo n.º 2
0
    void TriggerActorSpawnEffectRPC(byte assetType, string uri, Vector3 position, Quaternion rotation, Vector3 scale, Color tint)
    {
        SpawnActor            spawnActor  = GameObject.Instantiate(actorSpawner, position, rotation).GetComponent <SpawnActor>();
        ActorableSearchResult dummyResult = new ActorableSearchResult
        {
            renderableReference = new RenderableReference {
                assetType = (AssetType)assetType, uri = uri
            }
        };

        spawnActor.SetTint(tint);
        spawnActor.Setup(
            dummyResult, position, rotation, scale, false,
            // This is just the preview, assume these offset are baked in. To save banwidth
            Vector3.zero, Quaternion.identity
            );
    }