KinPortal/Game/PortalManager.cs
2020-05-15 12:18:51 +02:00

40 lines
1.0 KiB
C#
Executable File

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace KinPortal {
public class PortalManager {
public enum PortalType {RED, BLUE};
public Scene Scene {get; private set;}
public Portal BluePortal {get; private set;}
public Portal RedPortal {get; private set;}
public PortalManager(Scene scene) {
BluePortal = null;
RedPortal = null;
Scene = scene;
}
public void CreatePortal(Vector3 pos, Quaternion rot, PortalType type) {
if(type == PortalType.RED) {
if(RedPortal == null) {
RedPortal = new Portal("models\\portal_red", Vector3.Zero, Quaternion.Identity, Scene);
Scene.AddComponent(RedPortal);
}
RedPortal.Pos = pos;
RedPortal.Rot = rot;
}
if(type == PortalType.BLUE) {
if(BluePortal == null) {
BluePortal = new Portal("models\\portal_blue", Vector3.Zero, Quaternion.Identity, Scene);
Scene.AddComponent(BluePortal);
}
BluePortal.Pos = pos;
BluePortal.Rot = rot;
}
}
}
}