Beispiel #1
0
 public void ExpandActions()
 {
     PlayerPrefsHelper.SaveBool("/AP/" + CurrentActionPoint.Data.Id + "/actionsCollapsed", false);
     CurrentActionPoint.ActionsCollapsed = false;
     CurrentActionPoint.UpdatePositionsOfPucks();
     CollapseBtn.gameObject.SetActive(true);
     ExpandBtn.gameObject.SetActive(false);
 }
Beispiel #2
0
 /// <summary>
 /// Hides action objects models
 /// </summary>
 public void HideActionObjects()
 {
     foreach (ActionObject actionObject in ActionObjects.Values)
     {
         actionObject.Hide();
     }
     PlayerPrefsHelper.SaveBool("scene/" + Data.Id + "/AOVisibility", false);
 }
Beispiel #3
0
 /// <summary>
 /// Shows action objects models
 /// </summary>
 public void ShowActionObjects()
 {
     foreach (ActionObject actionObject in ActionObjects.Values)
     {
         actionObject.Show();
     }
     PlayerPrefsHelper.SaveBool("scene/" + Data.Id + "/AOVisibility", true);
 }
Beispiel #4
0
    private void OnDestroy()
    {
#if UNITY_ANDROID && AR_ON
        PlayerPrefsHelper.SaveBool("control_box_display_trackables", (bool)Trackables.GetValue());
        PlayerPrefsHelper.SaveBool("control_box_autoCalib", (bool)AutoCalibration.GetValue());
#endif
        PlayerPrefsHelper.SaveBool("control_box_display_connections", (bool)ConnectionsSwitch.GetValue());
    }
 internal void ShowAPOrientations()
 {
     APOrientationsVisible = true;
     foreach (ActionPoint actionPoint in GetAllActionPoints())
     {
         actionPoint.UpdateOrientationsVisuals();
     }
     PlayerPrefsHelper.SaveBool("scene/" + Project.Id + "/APOrientationsVisibility", true);
 }
Beispiel #6
0
 /// <summary>
 /// Sets whether action objects should react to user inputs (i.e. enables/disables colliders)
 /// </summary>
 public void SetActionObjectsInteractivity(bool interactivity)
 {
     foreach (ActionObject actionObject in ActionObjects.Values)
     {
         actionObject.SetInteractivity(interactivity);
     }
     PlayerPrefsHelper.SaveBool("scene/" + Data.Id + "/AOInteractivity", interactivity);
     Debug.LogError("Save to: " + "scene/" + Data.Id + "/AOInteractivity: " + interactivity.ToString());
 }
Beispiel #7
0
    /// <summary>
    /// Sets wheter or not the object is enabled for interaction in the scene
    /// Note: putOnBlocklist and removeFromBlocklist could not be both true!
    /// Note2: Could not set enable to true and putOnBlocklist at the same time!
    /// </summary>
    /// <param name="enable">Enable flag</param>
    /// <param name="putOnBlocklist">Object should be blocklisted (if it is not already)</param>
    /// <param name="removeFromBlocklist">Object should be removed from blacklist</param>
    public virtual void Enable(bool enable, bool putOnBlocklist = false, bool removeFromBlocklist = false)
    {
        Debug.Assert(!(putOnBlocklist && removeFromBlocklist));
        Debug.Assert(!(putOnBlocklist && enable));

        if (blocklisted && !removeFromBlocklist)
        {
            return;
        }
        if (putOnBlocklist)
        {
            blocklisted = true;
            SelectorMenu.Instance.PutOnBlocklist(SelectorItem);
            PlayerPrefsHelper.SaveBool($"ActionObject/{GetId()}/blocklisted", true);
        }
        if (removeFromBlocklist)
        {
            blocklisted = false;
            SelectorMenu.Instance.RemoveFromBlacklist(SelectorItem);

            PlayerPrefsHelper.SaveBool($"ActionObject/{GetId()}/blocklisted", false);
        }
        Enabled = enable;
        UpdateColor();

        foreach (Collider collider in Colliders)
        {
            collider.enabled = enable;
        }
        if (SelectorItem != null)
        {
            SelectorItem.gameObject.SetActive(enable || blocklisted);
        }
        if (!enable && SelectorMenu.Instance.GetSelectedObject() == this)
        {
            SelectorMenu.Instance.DeselectObject(true);
        }
    }
Beispiel #8
0
 public void Toggle(bool toggle, bool invoke = true)
 {
     PlayerPrefsHelper.SaveBool("buttons/" + PersistentTag, toggle);
     this.toggled = toggle;
     if (Toggled)
     {
         Icon.color = Color.white;
         SetDescription(ToggledDescription);
         if (invoke)
         {
             OnToggledOn.Invoke();
         }
     }
     else
     {
         Icon.color = Color.grey;
         SetDescription(UntoggledDescription);
         if (invoke)
         {
             OnToggledOff.Invoke();
         }
     }
 }
 public override void SetStar(bool starred)
 {
     PlayerPrefsHelper.SaveBool("project/" + projectTile.ProjectId + "/starred", starred);
     projectTile.SetStar(starred);
     Close();
 }
Beispiel #10
0
 public override void SetStar(bool starred)
 {
     PlayerPrefsHelper.SaveBool("scene/" + sceneTile.SceneId + "/starred", starred);
     SetStar(sceneTile, starred);
     Close();
 }
 public void SetKeepMeConnected(bool value)
 {
     PlayerPrefsHelper.SaveBool("arserver_keep_connected", value);
 }
 public override void SetStar(bool starred)
 {
     PlayerPrefsHelper.SaveBool("package/" + packageTile.PackageId + "/starred", starred);
     SetStar(packageTile, starred);
     Close();
 }
 private void OnDestroy()
 {
     PlayerPrefsHelper.SaveBool("UseServerCalibration", ServerCalibrationToggle.isOn);
 }