示例#1
0
    public override void gaxb_unload()
    {
        base.gaxb_unload ();

        GameObject.Destroy(cameraObject);
        cameraObject = null;

        GameObject.Destroy(eventMonitor);
        eventMonitor = null;
    }
示例#2
0
    public override void gaxb_load(XmlReader reader, object _parent, Hashtable args)
    {
        base.gaxb_load(reader, _parent, args);

        if (adjustCamera) {
            CreateSceneCamera ();

            cameraObject = (PlanetUnityCameraObject)sceneCamera.gameObject.AddComponent (typeof(PlanetUnityCameraObject));
            cameraObject.scene = this;
            cameraObject.camera = sceneCamera;
            cameraObject.AdjustCamera ();
        }

        eventsObject = new GameObject ("PlanetUnityEvents");
        eventsObject.layer = PlanetUnityOverride.puEventLayer;
        eventsObject.transform.parent = gameObject.transform;

        eventMonitor = (PlanetUnityEventMonitor)eventsObject.AddComponent (typeof(PlanetUnityEventMonitor));
        eventMonitor.scene = this;

        if (sceneCamera != null) {
            eventMonitor.camera = sceneCamera;
        }

        // We use a collider to capture all of our own touches and manually handle touch events
        gameCollider = (BoxCollider) eventsObject.AddComponent(typeof(BoxCollider));
        UpdateCollider ();
    }