// Use this for initialization void Start() { mng_pause = -1; general_interface.SetActive(true); //Room.SetActive (true); pnl_exit.SetActive(false); camera_script = orbit_camera.GetComponent <Mouse_Orbit>(); transformgizmo = orbit_camera.GetComponent <RuntimeGizmos.TransformGizmo> (); Button btnpause = btn_gear.GetComponent <Button>(); btnpause.onClick.AddListener(pause); Button btnexit = btn_exit.GetComponent <Button> (); btnexit.onClick.AddListener(exit); Button btnvolver = btn_volver.GetComponent <Button> (); btnvolver.onClick.AddListener(pause); }
// Initialize class variables private void Awake() { // create list of OutlinerItems OutlinerItems = new List <GameObject>(); gizmo = mainCamera.GetComponent <RuntimeGizmos.TransformGizmo>(); objManger = GameObject.FindGameObjectWithTag("ObjManager"); }
public override void UnExecute() { for (int i = 0; i < _targetRoots.Count; i++) { TransformGizmo.AddTarget(_targetRoots[i], false); } }
public TransformCommand(TransformGizmo transformGizmo, Transform transform) { this.mTransformGizmo = transformGizmo; this.mTransform = transform; mOldValues = new TransformValues() { position = transform.position, rotation = transform.rotation, scale = transform.localScale }; }
public TransformCommand(TransformGizmo transformGizmo, Transform transform) { this._transformGizmo = transformGizmo; this._transform = transform; _oldValues = new TransformValues() { Position = transform.position, Rotation = transform.rotation, Scale = transform.localScale }; }
void Awake() { #if UNITY_EDITOR #else modelRootDirectories.Clear(); worldRootDirectories.Clear(); fileRootDirectories.Clear(); var separator = new char[] { ':' }; var filePathEnv = Environment.GetEnvironmentVariable("CLOISIM_FILES_PATH"); var filePaths = filePathEnv.Split(separator, StringSplitOptions.RemoveEmptyEntries); fileRootDirectories.AddRange(filePaths); var modelPathEnv = Environment.GetEnvironmentVariable("CLOISIM_MODEL_PATH"); var modelPaths = modelPathEnv.Split(separator, StringSplitOptions.RemoveEmptyEntries); modelRootDirectories.AddRange(modelPaths); var worldPathEnv = Environment.GetEnvironmentVariable("CLOISIM_WORLD_PATH"); var worldPaths = worldPathEnv.Split(separator, StringSplitOptions.RemoveEmptyEntries); worldRootDirectories.AddRange(worldPaths); #endif // Load Library for Assimp #if UNITY_EDITOR var assimpLibraryPath = "./Assets/Plugins/AssimpNet.4.1.0/runtimes/linux-x64/native"; #else var assimpLibraryPath = "./CLOiSim_Data/Plugins"; #endif Assimp.Unmanaged.AssimpLibrary.Instance.LoadLibrary(assimpLibraryPath + "/libassimp"); Application.targetFrameRate = 61; mainCamera = Camera.main; mainCamera.depthTextureMode = DepthTextureMode.None; mainCamera.allowHDR = true; mainCamera.allowMSAA = true; modelsRoot = GameObject.Find("Models"); var UIRoot = GameObject.Find("UI"); followingList = UIRoot.GetComponentInChildren <FollowingTargetList>(); simulationDisplay = UIRoot.GetComponentInChildren <SimulationDisplay>(); transformGizmo = UIRoot.GetComponentInChildren <RuntimeGizmos.TransformGizmo>(); clock = DeviceHelper.GetGlobalClock(); ResetRootModelsTransform(); }
// Use this for initialization void Start() { tg = GameObject.Find("Orbital_Camera").GetComponent <RuntimeGizmos.TransformGizmo> (); intfPilar = GameObject.Find("Pilar_Intf"); intfRoom = GameObject.Find("Size_Room_Sliders"); intfObject = GameObject.Find("Mueble_Intf"); //INICIALIZAMOS EL ESTADO DE LOS ELEMENTOS intfPilar.SetActive(true); intfPilar.transform.localScale = new Vector3(0, 0, 0); intfRoom.SetActive(true); intfObject.SetActive(false); }
public void selectTool(int selected) { RuntimeGizmos.TransformGizmo transformGizmo = mainCamera.GetComponent <RuntimeGizmos.TransformGizmo>(); for (int i = 0; i < toolButtons.Length; i++) { toggleButton toggle = toolButtons[i].GetComponent <toggleButton>(); // If we've reached the index of the tool the user wants to use, activate it if it is not already active. if (i == selected && toggle != null && !toggle.IsPressed) { toggle.changeState(); transformGizmo.transformType = getTransformType(i, transformGizmo.transformType); } // Otherwise, deactivate the tool at this index. else if (toggle != null & toggle.IsPressed) { toggle.changeState(); } } }
void Awake() { if (transformGizmo == null && autoFindTransformGizmo) { transformGizmo = GameObject.FindObjectOfType <TransformGizmo>(); } transformGizmo.manuallyHandleGizmo = true; //Since we are using a mesh, rotating can get weird due to how the rotation method works, //so we use a different rotation method that will let us rotate by acting like our custom rotation gizmo is a wheel. //Can still give weird results depending on camera angle, but I think its more understanding for the user as to why its messing up. transformGizmo.circularRotationMethod = true; mask = LayerMask.GetMask(LayerMask.LayerToName(gizmoLayer)); customTranslationGizmos.Init(gizmoLayer); customRotationGizmos.Init(gizmoLayer); }
// Use this for initialization void Start() { //SCRIPTS tg = GameObject.Find("Orbital_Camera").GetComponent <RuntimeGizmos.TransformGizmo> (); og = GameObject.Find("Master_Controller").GetComponent <Object_Generator> (); //TEXTO Grad = GameObject.Find("txt_numGrados_M").GetComponent <Text> (); //ROTACION EJE Y SldRotateMueble = GameObject.Find("Sld_Rotation_M").GetComponent <Slider>(); SldRotateMueble.value = 0f; //BORRAR MUEBLE dlt_Mueble = GameObject.Find("btn_delete_M").GetComponent <Button>(); dlt_Mueble.onClick.AddListener(deleteMueble); astrg = 0; }
void Awake() { GetResourcesPaths(); // Load Library for Assimp #if UNITY_EDITOR var assimpLibraryPath = "./Assets/Plugins/AssimpNet.4.1.0/runtimes/linux-x64/native"; #else var assimpLibraryPath = "./CLOiSim_Data/Plugins"; #endif Assimp.Unmanaged.AssimpLibrary.Instance.LoadLibrary(assimpLibraryPath + "/libassimp"); Application.targetFrameRate = 61; var mainCamera = Camera.main; mainCamera.depthTextureMode = DepthTextureMode.None; mainCamera.allowHDR = true; mainCamera.allowMSAA = true; modelsRoot = GameObject.Find("Models"); lightsRoot = GameObject.Find("Lights"); var UIRoot = GameObject.Find("UI"); followingList = UIRoot.GetComponentInChildren <FollowingTargetList>(); simulationDisplay = UIRoot.GetComponentInChildren <SimulationDisplay>(); transformGizmo = UIRoot.GetComponentInChildren <RuntimeGizmos.TransformGizmo>(); clock = GetComponent <Clock>(); DeviceHelper.SetGlobalClock(clock); var sphericalCoordinates = GetComponent <SphericalCoordinates>(); DeviceHelper.SetGlobalSphericalCoordinates(sphericalCoordinates); ResetRootModelsTransform(); }
// Use this for initialization void Start() { //HABITACION Room = GameObject.Find("GO_Room"); AltP = Room.transform.localScale.y; tg = GameObject.Find("Orbital_Camera").GetComponent <RuntimeGizmos.TransformGizmo> (); og = GameObject.Find("Master_Controller").GetComponent <Object_Generator> (); //EJE Z SldZPilarm = GameObject.Find("Sld_Long_m_P").GetComponent <Slider> (); SldZPilarcm = GameObject.Find("Sld_Long_cm_P").GetComponent <Slider> (); SldZPilarmm = GameObject.Find("Sld_Long_mm_P").GetComponent <Slider> (); //EJE X SldXPilarm = GameObject.Find("Sld_Anc_m_P").GetComponent <Slider> (); SldXPilarcm = GameObject.Find("Sld_Anc_cm_P").GetComponent <Slider> (); SldXPilarmm = GameObject.Find("Sld_Anc_mm_P").GetComponent <Slider> (); //ROTACION EJE Y SldRotatePilar = GameObject.Find("Sld_Rotation_P").GetComponent <Slider>(); SldRotatePilar.value = 0f; //BOTON DE BORRADO dlt_Pilar = GameObject.Find("btn_delete_P").GetComponent <Button>(); dlt_Pilar.onClick.AddListener(deletePilar); //TEXTOS Long = GameObject.Find("txt_longitud_P").GetComponent <Text> (); Anc = GameObject.Find("txt_anchura_P").GetComponent <Text> (); Grad = GameObject.Find("txt_numGrados_P").GetComponent <Text> (); astrg = 0; }
// Use this for initialization void Start() { tg = GameObject.Find("Orbital_Camera").GetComponent <RuntimeGizmos.TransformGizmo> (); cont = 0; Button silla = CreaSilla.GetComponent <Button>(); silla.onClick.AddListener(IniatiateSilla); Button mesa = CreaMesa.GetComponent <Button>(); mesa.onClick.AddListener(IniatiateMesa); Button cama = CreaCama.GetComponent <Button>(); cama.onClick.AddListener(IniatiateCama); Button pilar = CreaPilar.GetComponent <Button>(); pilar.onClick.AddListener(IniatiatePilar); }
public override void OnInspectorGUI() { TransformGizmo tfGizmo = target as TransformGizmo; GUI.enabled = false; EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour((TransformGizmo)target), typeof(TransformGizmo), false); GUI.enabled = true; tfGizmo.space = (TransformSpace)EditorGUILayout.EnumPopup("Space", tfGizmo.space); if (tfGizmo.space == TransformSpace.ObjectRelative) { tfGizmo.objectRelativeTransform = (Transform)EditorGUILayout.ObjectField("Object Relative Transform", tfGizmo.objectRelativeTransform, typeof(Transform), true); } if (GUI.changed) { EditorUtility.SetDirty(tfGizmo); } serializedObject.Update(); DrawPropertiesExcluding(serializedObject, new string[] { "m_Script" }); serializedObject.ApplyModifiedProperties(); }
public RemoveTargetCommand(TransformGizmo transformGizmo, Transform target) : base(transformGizmo, target) { }
public ClearTargetsCommand(TransformGizmo transformGizmo, List <Transform> targetRoots) : base(transformGizmo, null) { this.targetRoots.AddRange(targetRoots); }
public SelectCommand(TransformGizmo transformGizmo, Transform target) { this.transformGizmo = transformGizmo; this.target = target; }
public AddTargetCommand(TransformGizmo transformGizmo, Transform target, List <Transform> targetRoots) : base(transformGizmo, target) { //Since we might have had a child selected and then selected the parent, the child would have been removed from the selected, //so we store all the targetRoots before we add so that if we undo we can properly have the children selected again. this.mTargetRoots.AddRange(targetRoots); }
public override void Execute() { TransformGizmo.RemoveTarget(Target, false); }
public override void UnExecute() { TransformGizmo.AddTarget(Target, false); }
// When the app is launched the translate tool should be active. private void Awake() { // call select tool with a selected parameter of 0 selectTool(0); transformGizmo = mainCamera.GetComponent <RuntimeGizmos.TransformGizmo>(); }
public ClearAndAddTargetCommand(TransformGizmo transformGizmo, Transform target, List <Transform> targetRoots) : base(transformGizmo, target) { this.targetRoots.AddRange(targetRoots); }
private void Start() { runtimeGizmo = GetComponent <RuntimeGizmos.TransformGizmo>(); }
public DeleteCommand(TransformGizmo transformGizmo, GameObject[] targets) { this.transformGizmo = transformGizmo; this.targets = targets; }
public override void Execute() { TransformGizmo.ClearTargets(false); TransformGizmo.AddTarget(Target, false); }