Exemple #1
0
    public void IControlUpdate()
    {
        manager.modeStringEnum = GameManager.ModeString.View_Mode;

        if (control.LB() && softSelected)
        {
            ignore.Add(softSelected);
        }

        if (control.RB())
        {
            if (softSelected)
            {
                PickupSelected();
                WorldBuilderMain.ChoosePlaceMode();
            }
            return;
        }

        if (control.RHY() != 0)
        {
            Vector3 pos = manager.pointerGroup.localPosition;
            pos.y -= control.RHY() * Time.deltaTime / 4f;
            pos.z += control.RHY() * Time.deltaTime / 4f;
            manager.pointerGroup.localPosition = pos;
        }


        if (control.RB2())
        {
            if (softSelected)
            {
                if (TODV2.GetItemByID(softSelected.GetComponent <DioramaObject>().todID).hasAnimation)
                {
                    PickupSelected();
                    PoserMode.Instance().SetupMode();
                    return;
                }

                IWorldEvent iwe = softSelected.GetComponent <IWorldEvent>();
                if (iwe != null)
                {
                    iwe.StartEvent(WorldBuilderMain.Instance());
                    return;
                }
            }
        }
    }
Exemple #2
0
    private void LoadWorld()
    {
        bool fileExists = File.Exists(Globals.WORLDPATH + allWorlds[fileId] + ".mrw");

        manager.loadedWorld = allWorlds[fileId];
        PlayerPrefs.SetString("LastWorld", allWorlds[fileId]);
        PlayerPrefs.Save();

        WorldBuilderMain.Instance().SetupWorldMode(allWorlds[fileId], !fileExists);
        SelectObjectMode.Instance().SetupMode();
        manager.titleActive = false;
        if (z != null)
        {
            z.Clear();
        }
        allWorlds.Clear();
        dioArtist.Clear();
    }
Exemple #3
0
 public void ButtonActivate(Node n, bool shift = false)
 {
     WorldBuilderMain.Instance().ButtonActivate(n, shift);
 }
Exemple #4
0
    void Start()
    {
        KeyboardMode.Hook();

        int i = Application.dataPath.LastIndexOf("/");

        Globals.WORLDPATH = Application.dataPath.Substring(0, i) + "/Worlds/";
        Directory.CreateDirectory(Globals.WORLDPATH);

        Globals.BACKUPS = Application.dataPath.Substring(0, i) + "/BackupFiles/";
        Directory.CreateDirectory(Globals.BACKUPS);

        Globals.BUNDLEPATH = Application.dataPath.Substring(0, i) + "/ArtPacks/";
        Directory.CreateDirectory(Globals.BUNDLEPATH);

        Globals.TEMPFOLDER = Application.dataPath.Substring(0, i) + "/DWTemp/";
        Directory.CreateDirectory(Globals.TEMPFOLDER);

        Globals.TODPATH = Application.dataPath.Substring(0, i) + "/tod2.tbl";

        Globals.LEGACYPATH = Application.dataPath.Substring(0, i) + "/all.tbl";

        Globals.FAVPATH = Application.dataPath.Substring(0, i) + "/dw.fav";
        favorites       = TODV2.LoadGeneric <List <int> >(Globals.FAVPATH);
        if (favorites == default(List <int>))
        {
            favorites = new List <int>();
        }

        if (Application.isEditor)
        {
            AssetBundleCreateRequest a = AssetBundleManager.Polygon_Adventure;
        }
        else
        {
            AssetBundleManager.Prewarm();
        }

        SL.Add <GameManager>(this);
        SL.Add <Keyboard>(keyboard);

        hmd = rig.GetComponent <IVRHmd>();
        hmd.Init();
        SL.Add <IVRHmd>(hmd);

        control = rig.GetComponent <IVRControl>();
        control.Init(this);
        SL.Add <IVRControl>(control);

        poserWidget.SetActive(false);

        if (control.GetControlStyle() == ControlerStyle.ViveWand)
        {
            lb1 = "Down";
            lb2 = "Up";
            rb1 = "Down";
            rb2 = "Up";
        }
        else if (control.GetControlStyle() == ControlerStyle.RiftTouch)
        {
            lb1 = "X";
            lb2 = "Y";
            rb1 = "A";
            rb2 = "B";
        }

        activeFM.Init(this);
        SL.Add <FileManagerV2>(activeFM);

        SetPrefs();
        DeactivateStarter();

        mode = WorldBuilderMain.Instance();

        if (startPoint.position == Vector3.zero)
        {
            CalibrationMode.Instance().SetupMode();
        }
        else
        {
            TitleScreenMode.Instance().SetupMode();
        }
    }