Beispiel #1
0
    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;
                }
            }
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     test       = 10;
     hasOverlap = false;
     MM         = GameObject.Find("GameManager").GetComponent <MoleculeManager>();
     M          = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Manager>();
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
        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);
            }
        }
Beispiel #5
0
    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);
    }
Beispiel #6
0
    // 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);
        }
    }
Beispiel #8
0
 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);
     }
 }
Beispiel #9
0
 // 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>();
 }
Beispiel #10
0
 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;
 }
Beispiel #11
0
    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);
    }
Beispiel #13
0
 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>();
 }
Beispiel #14
0
 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";
 }
Beispiel #15
0
 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>();
    }
Beispiel #17
0
    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();
    }
Beispiel #18
0
    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);
        }
    }
Beispiel #19
0
 void Awake()
 {
     atomManager     = FindObjectOfType <AtomManager>();
     moleculeManager = FindObjectOfType <MoleculeManager>();
     materialManager = FindObjectOfType <MaterialManager>();
 }
Beispiel #20
0
 // 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>();
 }