Add node interactions
This commit is contained in:
@@ -8,4 +8,11 @@ public class DirectionPaddle : MonoBehaviour
|
||||
{
|
||||
gameObject.SetActive(!gameObject.activeSelf);
|
||||
}
|
||||
|
||||
public void InteractNode()
|
||||
{
|
||||
this.GetComponent<Collider>().enabled = !this.GetComponent<Collider>().enabled;
|
||||
this.GetComponent<MeshRenderer>().enabled = !this.GetComponent<MeshRenderer>().enabled;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1057,6 +1057,10 @@ PrefabInstance:
|
||||
propertyPath: connections.Array.data[1]
|
||||
value:
|
||||
objectReference: {fileID: 1143571366}
|
||||
- target: {fileID: 6314262857863842719, guid: cd2709ce625391747b56d49b13717da0, type: 3}
|
||||
propertyPath: connections.Array.data[3]
|
||||
value:
|
||||
objectReference: {fileID: 1643453143}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: cd2709ce625391747b56d49b13717da0, type: 3}
|
||||
--- !u!4 &852901939 stripped
|
||||
@@ -1995,7 +1999,7 @@ GameObject:
|
||||
- component: {fileID: 1643453144}
|
||||
- component: {fileID: 1643453148}
|
||||
m_Layer: 0
|
||||
m_Name: Conveyer (6)
|
||||
m_Name: Conveyor Paddle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
||||
@@ -34,8 +34,17 @@ public class Node : MonoBehaviour
|
||||
|
||||
public void MoveToDirection(Direction dir)
|
||||
{
|
||||
connections[(int)dir].GetComponent<Node>().SetActiveNode();
|
||||
UI.SetActive(false);
|
||||
isActive = false;
|
||||
Node nodeComp = connections[(int)dir].GetComponent<Node>();
|
||||
if (nodeComp)
|
||||
{
|
||||
nodeComp.SetActiveNode();
|
||||
UI.SetActive(false);
|
||||
isActive = false;
|
||||
} else
|
||||
{
|
||||
connections[(int)dir].SendMessage("InteractNode");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Switch : MonoBehaviour
|
||||
if (Keyboard.current.eKey.wasPressedThisFrame)
|
||||
{
|
||||
gameManager.SetActiveCamera(1);
|
||||
debugNode.SetActiveNode();
|
||||
debugNode.SendMessage("SetActiveNode", debugNode.GetComponent<Node>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user