Comments (2)
Well you could go in and specify portal channels by making a portal Array[2] dictionary PortDict
. Also if you want to use 2 cameras then you need to specify the exact active camera for checking. Anyways you check for any portal in view(This is in the code) and then get one of the item's channel ID and then find the partner by getting saving our target like this private Portal target = <the checked portal>;
and prep the partner like this private Portal partner;
and then check and validate that the channel has a length of 2 in its array by running 'if ((PortDict.item(target.channel).length())!=2){return 1;}' if we are still running we can check each item like this if (!(target.equals(PortDict.item(target.channel).item(i)))){partner = PortDict.item(target.channel).item(i);}
then we can tell the partner to initialize a camera as its child and move it to the relative position. Deinitalize any cameras of portals where the partner has not been on screen in 40 draws for efficiency
from portals.
This method also allows you to change the portals in real time. However you need to add to portal.cs
the function
`public int ChangeChannel(int channel){
if (channel == this.channel){
return 2;/No need to change here, Exiting/
}
bool valid = false
bool fixInvalid = true
foreach (var i in PortalDict.item(this.channel))
{
if (target.equals(PortDict.item(target.channel).item(i))){
PortDict[i] = nulll;
valid = true
}
index++;
}
if valid == false{
if (fixInvaild){
foreach(var di in PortalDict.items)
foreach(var ii in PortalDict.item(di))
{
if (target.equals(PortDict.item(di).item(ii))){
PortDict[ii] = nulll;
channel = di
valid = true
}
ii++;
}
}else{
return 3; /Invalid data, incorrect channel/
}
}
/to add more/
return 0;
}`
from portals.
Related Issues (20)
- Top down Camera View
- Having issues with even opening it in Unity HOT 1
- high velocities sometimes arent registered, fly right through HOT 4
- Tips on WebGL support?
- Portals don't render fog correctly
- Question about portal camera movement through scene additive
- Slice shader upgrade to URP? HOT 1
- If i look to the portal it lag so much, even without postprocessing HOT 1
- what version of unity should i use HOT 2
- How could I implement a flashlight that works with the portals? HOT 4
- No prefabs / missing
- Portals show blank texture when used in Additive Loading
- Projection Visualization Shader
- License of the project HOT 1
- Android not working - fix candidate HOT 1
- Render different portal through portal HOT 7
- Player rotation very snappy
- Converting the shaders from BRP to URP? HOT 15
- Portals Not Working In VR HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portals.