public void OnFrame() { MoleculeManager molecule = MoleculeManager.instance; outlineThickness = 0.5f; invalid = true; if (molecule.atoms.Count == 0) { invalid = false; outlineColor = Color.green; } else { outlineColor = Color.red; if (!Physics.CheckSphere(transform.position, hull.bounds.extents.x, -1, QueryTriggerInteraction.Ignore)) { foreach (Atom atom in potentialBonds) { atom.outlineThickness = 0.1f; atom.outlineColor = Color.blue; invalid = false; outlineColor = Color.green; } } } }
// Use this for initialization void Start() { test = 10; hasOverlap = false; MM = GameObject.Find("GameManager").GetComponent <MoleculeManager>(); M = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Manager>(); }
public Bond CreateNew(Atom a, Atom b) { if (CanBond(a, b)) { Bond bond = Instantiate(this); MoleculeManager molecule = MoleculeManager.instance; molecule.bonds.Add(bond); bond.transform.parent = molecule.transform; bond.a = a; bond.b = b; a.bonds[bond] = b; b.bonds[bond] = a; bond.name = name; Vector3 aPos = a.transform.position; Vector3 bPos = b.transform.position; bond.transform.position = (aPos + bPos) / 2; Vector3 scale = bond.transform.localScale; scale.y = (aPos - bPos).magnitude * lengthScale; bond.transform.localScale = scale; bond.transform.up = aPos - bPos; return(bond); } else { return(null); } }
public MoleculeSet(GameObject _moleculeString) { moleculeString = _moleculeString; parts = ListChildrenWithMeshRenderer(_moleculeString.transform, new List <Transform>()); manager = _moleculeString.GetComponentInChildren <MoleculeManager>(); List <Transform> ListChildrenWithMeshRenderer(Transform t, List <Transform> tList) { foreach (Transform _t in t) { if (_t.GetComponent <MeshRenderer>() != null) { tList.Add(_t); } if (_t.childCount > 0) { tList = ListChildrenWithMeshRenderer(_t, tList); } } return(tList); } }
private void Start() { detector = FindObjectOfType <Detector>(); renderer = GetComponent <Renderer>(); renderer.enabled = true; ChangeMaterial(0); _collider = GetComponent <Collider>(); _collider.enabled = false; atomsManager = FindObjectOfType <AtomsManager>(); solutionManager = FindObjectOfType <SolutionManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); controlGizmo = FindObjectOfType <ControlGizmo>(); controlGizmo.DisableElements(); dottedLineHoriz = GameObject.Find("DottedLineHoriz").GetComponent <DottedLine>(); dottedLineHorizRenderer = dottedLineHoriz.GetComponent <Renderer>(); dottedLineHorizRenderer.enabled = false; dottedLineVert = GameObject.Find("DottedLineVert").GetComponent <DottedLine>(); dottedLineVertRenderer = dottedLineVert.GetComponent <Renderer>(); dottedLineVertMaterial = dottedLineVertRenderer.material; dottedLineVertMaterial.SetColor(_EmissionColor, Color.red); dottedLineVertRenderer.enabled = false; atomsManager.AddAtom(this); }
// Use this for initialization void Start() { MM = GetComponent <MoleculeManager>(); LM = GetComponent <LevelManager>(); manager = GetComponent <Manager>(); BBManager = GameObject.FindGameObjectWithTag("Board").GetComponent <BlackBoardManager>(); IM = GameObject.Find("Info").GetComponent <InformationManager>(); PS = GetComponent <PointSystem>(); if (levelsFile != "") { levels = HandleTextFile.ReadLevels(levelsFile); } //APMultiple = GameObject.Find("ControlPanelAnswers").GetComponent<AnswerPanel>(); //APSingle = GameObject.Find("ControlPanelAnswer").GetComponent<AnswerPanel>(); levelComplete = false; newLevel = true; getAnswer = false; correctMolLoaded = false; partialCreated = false; canCreateNew = true; restore = false; level = 1; string[] info = new string[2] { "1", "multiple choice" }; Logs.BeginFile(fileName, info); SoundEffectsManager.SetUp(); }
void Start() { popup = FindObjectOfType <UIPopup>(); inputFilter = gameObject.GetComponentInChildren <InputField>(); GameObject go = new GameObject(); go.AddComponent <QryMoleculas>(); qryMolecule = go.GetComponent <QryMoleculas>(); moleculeManager = FindObjectOfType <MoleculeManager>(); try { moleculeList = qryMolecule.GetAllMolecules(); } catch (Exception e) { Debug.LogError("PopulateMoleculeList :: Ocurrio un error al buscar Todas las Moleculas de la Base: " + e.Message); popup.MostrarPopUp("Elementos Qry DB", "Error Obteniendo Todas las Moleculas de la Base"); return; } // cargo todas las moleculas a la lista foreach (MoleculeData molecule in moleculeList) { LoadMoleculeToList(molecule); } }
public void OnRelease(HandCursor cursor) { grabbingCursor = null; hull.isTrigger = false; if (invalid) { Destroy(gameObject); return; } else { MoleculeManager molecule = MoleculeManager.instance; HashSet <Atom> atoms = molecule.atoms; Vector3 pos = transform.position; pos = molecule.transform.InverseTransformPoint(pos); int newBonds = 0; foreach (Atom atom in potentialBonds) { molecule.bondPrefab.CreateNew(this, atom); newBonds++; } outlineThickness = 0; molecule.AddAtom(this); } }
// Use this for initialization void Start() { canPress = true; canUpdate = true; animator = GetComponent <Animator>(); MM = GameObject.Find("GameManager").GetComponent <MoleculeManager>(); GM = GameObject.Find("GameManager").GetComponent <GameManager>(); }
void Awake() { camera = GameObject.FindGameObjectWithTag("GameManager"); shelves = GameObject.Find("shelves"); MM = GameObject.Find("GameManager").GetComponent <MoleculeManager>(); GM = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); rotationType = camera.GetComponent <Manager>().rotationType; }
public void Refocus() { MoleculeManager molecule = MoleculeManager.instance; float focusRadius = Mathf.Max(molecule.boundingRadius + focusMargin, minFocusRadius); distanceTarget = -(focusRadius / Mathf.Sin(Mathf.Deg2Rad * cam.fieldOfView / 2)); focusTarget = molecule.center; }
public void OnMoleculeChange() { MoleculeManager molecule = MoleculeManager.instance; transform.position = molecule.center - Vector3.forward * (molecule.boundingRadius + 50); cam.orthographicSize = Mathf.Max(molecule.boundingRadius + padding, minRadius); SessionManager session = SessionManager.instance; PostScreenshot(session.username, session.userid); }
private void Awake() { atomManager = FindObjectOfType <AtomManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); materialManager = FindObjectOfType <MaterialManager>(); infoPanelElements = transform.Find("InfoContainerElementos").GetComponent <CanvasGroup>(); infoPanelMolecule = transform.Find("InfoContainerMoleculas").GetComponent <CanvasGroup>(); infoPanelMaterial = transform.Find("InfoContainerMateriales").GetComponent <CanvasGroup>(); infoPanelIsotopos = transform.Find("InfoContainerIsotopos").GetComponent <CanvasGroup>(); }
private void Awake() { atomManager = FindObjectOfType <AtomManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); materialManager = FindObjectOfType <MaterialManager>(); populateMoleculeList = FindObjectOfType <PopulateMoleculeList>(); positionManager = PositionManager.Instance; savePath = Application.dataPath + "/save.json"; tempPath = Application.dataPath + "/tmp.json"; }
void Awake() { atomManager = FindObjectOfType <AtomManager>(); DBManager = FindObjectOfType <DBManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); //encuentro y asigno a mi lista los botones a apagar GameObject[] btns = GameObject.FindGameObjectsWithTag("toToggle"); foreach (GameObject btn in btns) { buttonsToToggle.Add(btn.GetComponent <Button>()); } combineButton.interactable = false; }
private void Awake() { hint = GameObject.Find("HintButton").GetComponent<Button>(); canvas = GameObject.Find("Canvas"); detector = FindObjectOfType<Detector>(); solutionDetector = FindObjectOfType<SolutionDetector>(); emitterCone = FindObjectOfType<EmitterCone>(); emitterConeSol = FindObjectOfType<EmitterConeSol>(); atomsManager = FindObjectOfType<AtomsManager>(); solutionManager = FindObjectOfType<SolutionManager>(); moleculeManager = FindObjectOfType<MoleculeManager>(); wave = FindObjectOfType<Wave>(); hintArrow = FindObjectOfType<HintArrow>(); }
public void Initialize() { sessionIsActive = false; MotionManager motion = MotionManager.instance; MoleculeManager molecule = MoleculeManager.instance; CameraRig rig = CameraRig.instance; motion.Initialize(); molecule.Initialize(); rig.Initialize(); molecule.editorUI.gameObject.SetActive(false); loginScreen.gameObject.SetActive(true); CaptureCamera capture = CaptureCamera.instance; capture.Initialize(); }
void Start() { // arranca oculto y desactivado gameObject.GetComponent <CanvasGroup>().alpha = 0; gameObject.SetActive(false); inputFilter = gameObject.GetComponentInChildren <InputField>(); DBManager = FindObjectOfType <DBManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); moleculeList = DBManager.GetAllMolecules(); // cargo todas las moleculas a la lista foreach (MoleculeData molecule in moleculeList) { LoadMoleculeToList(molecule); } }
void Awake() { atomManager = FindObjectOfType <AtomManager>(); moleculeManager = FindObjectOfType <MoleculeManager>(); materialManager = FindObjectOfType <MaterialManager>(); }
// Use this for initialization void Start() { MM = GameObject.Find("GameManager").GetComponent <MoleculeManager>(); }
// Start is called before the first frame update void Start() { moleculeManager = this.GetComponent <MoleculeManager>(); }