|
Post by maltakreuz on Apr 2, 2018 20:03:10 GMT
I have a pretty hard time to make camera work for (influence) triggers, that are located in another scenes. Is there any info about this thema. My (pretty ugly) workaround is like that:
public static void LateBindCamaraReferenceToTriggers() { var triggers = FindObjectsOfType<ProCamera2DTriggerInfluence>(); foreach (var t in triggers) { t.ProCamera2D = ReferenceLvichka.proCamera2D; } }
public static string TriggerName = "Influence Trigger";
protected override void Awake() { //base.Awake(); }
void Start() { base.Awake(); // Late binding
if (FocusPoint == null) FocusPoint = transform.Find("FocusPoint"); if (FocusPoint == null) FocusPoint = transform; }
But i am feeling unhappy to modify core pro camera 2d code, that will be overwritten after next update. Is any better posibility to use one camera for multiple scenes?
Background: It's pretty conviniet for me, to define player and all player related stuff like camera etc. in one scene. And keep levels in separate scenes. Then "player-scene" will be loaded (additive) to "level-scene". So i do not need define separate camera for each level. (in this case prefab could work, but making everything prefab is a lot of work and testing).
|
|
|
Post by Luís Pedro Fonseca on Apr 2, 2018 21:34:49 GMT
Hi maltakreuz, A multi-scene setup is not something that I've tested extensively, but I'll take a look at this and try to find a solution. Any how, your workaround doesn't seem very bad. If you want to avoid your code being overwritten, you can simply create a custom trigger instead of changing the original one. Cheers,
|
|
ab
New Member
Posts: 1
|
Post by ab on May 25, 2022 13:03:53 GMT
Hey @luís Pedro Fonseca, Any update regarding using PC2D and multiple scenes ? (where the camera+ PC2D component is placed in another scene as other components, like triggers) In my context : When using the ProCamera2D component "+" button to generate triggers, the newly created trigger (placed in another scene) won't make the camera rig react. It works if the trigger is in the same scene but not when it's placed in another scene. Any ideas ? Thanks for the help
EDIT :
It seems that removing the ProCamera2D == null check in the Awake() of BaseTrigger.cs kinda fix my problem
|
|
|
Post by Luís Pedro Fonseca on May 25, 2022 21:13:59 GMT
ab That shouldn't be an issue. Do you mind sending me (through PM) a sample project that replicates the issue?
|
|