コード例 #1
0
    public override void BindToParkitect(GameObject hider, AssetBundle bundle)
    {
        BaseDecorator        baseDecorator     = DecoratorByInstance <BaseDecorator>();
        SeatDecorator        seatDecorator     = DecoratorByInstance <SeatDecorator>();
        ColorDecorator       colorDecorator    = DecoratorByInstance <ColorDecorator>();
        BoundingBoxDecorator boxDecorator      = DecoratorByInstance <BoundingBoxDecorator>();
        CategoryDecorator    categoryDecorator = DecoratorByInstance <CategoryDecorator>();

        GameObject gameObject = Instantiate(bundle.LoadAsset <GameObject>(Key));;

        gameObject.transform.parent = hider.transform;

        _seat      = gameObject.AddComponent <Seating>();
        _seat.name = Key;

        RemapUtility.RemapMaterials(gameObject);

        baseDecorator.Decorate(gameObject, hider, this, bundle);
        colorDecorator.Decorate(gameObject, hider, this, bundle);
        categoryDecorator.Decorate(gameObject, hider, this, bundle);

        foreach (var box in boxDecorator.BoundingBoxes)
        {
            var b = Prefab.AddComponent <BoundingBox>();
            b.setBounds(box.Bounds);
        }

        AssetManager.Instance.registerObject(_seat);
    }
コード例 #2
0
    public override void BindToParkitect(GameObject hider, AssetBundle bundle)
    {
        BaseDecorator        baseDecorator        = DecoratorByInstance <BaseDecorator>();
        WaypointDecorator    waypointDecorator    = DecoratorByInstance <WaypointDecorator>();
        BoundingBoxDecorator boundingBoxDecorator = DecoratorByInstance <BoundingBoxDecorator>();
        ColorDecorator       colorDecorator       = DecoratorByInstance <ColorDecorator>();

        GameObject gameObject = Instantiate(bundle.LoadAsset <GameObject>(Key));

        RemapUtility.RemapMaterials(gameObject);

        waypointDecorator.Decorate(gameObject, hider, this, bundle);


        CustomFlatRide flatride = gameObject.AddComponent <CustomFlatRide>();

        baseDecorator.Decorate(gameObject, hider, this, bundle);
        colorDecorator.Decorate(gameObject, hider, this, bundle);


        _flatRide                 = flatride;
        _flatRide.name            = Key;
        flatride.xSize            = XSize;
        flatride.zSize            = ZSize;
        flatride.excitementRating = Excitement;
        flatride.intensityRating  = Intensity;
        flatride.nauseaRating     = Nausea;


        RestraintRotationController controller = gameObject.AddComponent <RestraintRotationController>();

        controller.closedAngles = ClosedAngleRetraints;


        //Basic FlatRide Settings
        flatride.fenceStyle            = AssetManager.Instance.rideFenceStyles.rideFenceStyles[0].identifier;
        flatride.entranceGO            = AssetManager.Instance.attractionEntranceGO;
        flatride.exitGO                = AssetManager.Instance.attractionExitGO;
        flatride.categoryTag           = FlatRideCategory;
        flatride.defaultEntranceFee    = 1f;
        flatride.entranceExitBuilderGO = AssetManager.Instance.flatRideEntranceExitBuilderGO;

        AssetManager.Instance.registerObject(_flatRide);
    }
コード例 #3
0
    public override void BindToParkitect(GameObject hider, AssetBundle bundle)
    {
        BaseDecorator        baseDecorator     = DecoratorByInstance <BaseDecorator>();
        GridDecorator        gridDecorator     = DecoratorByInstance <GridDecorator>();
        CategoryDecorator    categoryDecorator = DecoratorByInstance <CategoryDecorator>();
        ColorDecorator       colorDecorator    = DecoratorByInstance <ColorDecorator>();
        BoundingBoxDecorator boxDecorator      = DecoratorByInstance <BoundingBoxDecorator>();

        GameObject gameObject = Instantiate(bundle.LoadAsset <GameObject>(Key));

        gameObject.transform.parent = hider.transform;

        _deco      = gameObject.AddComponent <Deco>();
        _deco.name = Key;

        _deco.buildOnLayerMask        = 4096;
        _deco.heightChangeDelta       = gridDecorator.HeightDelta;
        _deco.defaultGridSubdivision  = gridDecorator.GridSubdivision;
        _deco.buildOnGrid             = gridDecorator.Grid;
        _deco.defaultSnapToGridCenter = gridDecorator.Snap;

        _deco.isPreview     = true;
        _deco.isStatic      = true;
        _deco.dontSerialize = true;

        RemapUtility.RemapMaterials(gameObject);

        baseDecorator.Decorate(gameObject, hider, this, bundle);
        colorDecorator.Decorate(gameObject, hider, this, bundle);
        categoryDecorator.Decorate(gameObject, hider, this, bundle);


        foreach (var box in boxDecorator.BoundingBoxes)
        {
            var b = gameObject.AddComponent <BoundingBox>();
            b.setBounds(box.Bounds);
        }

        AssetManager.Instance.registerObject(_deco);
    }