示例#1
0
    private void DropObject()
    {
        UnlockY();
        DestroyAnimator();

        WorldBuilderMain.ChooseSelectionModeType();
    }
示例#2
0
    private void DestroySelectedObject()
    {
        DioramaObject d = WorldBuilderMain.selectedObject.GetComponent <DioramaObject>();

        manager.DestoryObject(WorldBuilderMain.selectedObject);
        WorldBuilderMain.ChooseSelectionModeType();
    }
示例#3
0
 public static TitleScreenMode Instance()
 {
     if (instance == null)
     {
         instance = new TitleScreenMode();
         manager  = SL.Get <GameManager>();
         control  = SL.Get <IVRControl>();
         shared   = SL.Get <WorldBuilderMain>();
     }
     return(instance);
 }
示例#4
0
 public static ModeExample Instance()
 {
     if (instance == null)
     {
         instance = new ModeExample();
         manager  = SL.Get <GameManager>();
         control  = SL.Get <IVRControl>();
         shared   = SL.Get <WorldBuilderMain>();
     }
     return(instance);
 }
示例#5
0
 public static AdventureTester Instance()
 {
     if (instance == null)
     {
         instance = new AdventureTester();
         manager  = SL.Get <GameManager>();
         control  = SL.Get <IVRControl>();
         shared   = SL.Get <WorldBuilderMain>();
     }
     return(instance);
 }
示例#6
0
 public static WorldBuilderMain Instance()
 {
     if (instance == null)
     {
         instance = new WorldBuilderMain();
         manager  = SL.Get <GameManager>();
         control  = SL.Get <IVRControl>();
         SL.Add <WorldBuilderMain>(instance);
     }
     return(instance);
 }
示例#7
0
 public static KeyboardMode Instance()
 {
     if (instance == null)
     {
         instance = new KeyboardMode();
         manager  = SL.Get <GameManager>();
         control  = SL.Get <IVRControl>();
         shared   = SL.Get <WorldBuilderMain>();
         keyboard = SL.Get <Keyboard>();
     }
     return(instance);
 }
示例#8
0
    public void PlayerZoneChangeEvent(int i)
    {
        Vector3    pos = manager.testChar.transform.position;
        Quaternion rot = manager.testChar.transform.rotation;

        DestroyPlayers();
        int lastZone = WorldBuilderMain.currentZoneId;

        WorldBuilderMain.currentZoneId = i;
        manager.ClearZone();
        WorldBuilderMain.LoadZone(false);


        manager.StartCoroutine(ReSpawnPlayer(lastZone, pos, rot));
    }
示例#9
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;
                }
            }
        }
    }
示例#10
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();
    }
示例#11
0
 public void ButtonActivate(Node n, bool shift = false)
 {
     WorldBuilderMain.Instance().ButtonActivate(n, shift);
 }
示例#12
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();
        }
    }