Example #1
0
        public static void ToNotParticle(UIData.AtomType previousType, UIData.BondType previousBondType)
        {
            if (previousType != UIData.AtomType.noatom && UIData.atomtype != previousType)
            {
                GameObject shObject = GameObject.FindGameObjectWithTag("ShurikenParticleManager");
                ShurikenParticleManager shManager = shObject.GetComponent <ShurikenParticleManager>();
                shManager.pSystem.GetComponent <Renderer>().enabled = false;
                shManager.enabled = false;

                UIData.atomtype         = previousType;
                UIData.bondtype         = previousBondType;
                UIData.resetBondDisplay = true;
                UIData.resetDisplay     = true;
                if (UIData.atomtype == UIData.AtomType.sphere)
                {
                    UIData.isCubeToSphere = true;
                    UIData.isSphereToCube = false;
                }
                else
                {
                    UIData.isCubeToSphere = false;
                    UIData.isSphereToCube = true;
                }

                if (UIData.atomtype == UIData.AtomType.hyperball)
                {
                    GameObject   hbmObject = GameObject.FindGameObjectWithTag("HBallManager");
                    HBallManager hbManager = hbmObject.GetComponent <HBallManager>();
                    BallUpdate.resetRadii = true;
                    hbManager.EnableRenderers();
                    hbManager.enabled = true;
                }

                Debug.Log("ToHyperBall()");
                Debug.Log(UIData.atomtype.ToString());
                Debug.Log(UIData.bondtype.ToString());
            }
        }
Example #2
0
        public static void SphereToCube()
        {
            UIData.resetDisplay = false;
//			DestroyObject();
            HideObject();
            if (UIData.atomtype == UIData.AtomType.cube)
            {
                GameObject  cbmObject = GameObject.FindGameObjectWithTag("CubeManager");
                CubeManager cbManager = cbmObject.GetComponent <CubeManager>();
                cbManager.EnableRenderers();

                if (!UIData.isCubeLoaded)
                {
                    IAtomStyle displayAtom;

                    Debug.Log("UIData.atomtype :: " + UIData.atomtype);
                    displayAtom = new AtomCubeStyle();
                    displayAtom.DisplayAtoms(UIData.atomtype);
                }
            }
            else if (UIData.atomtype == UIData.AtomType.hyperball)
            {
                GameObject   hbmObject = GameObject.FindGameObjectWithTag("HBallManager");
                HBallManager hbManager = hbmObject.GetComponent <HBallManager>();
                hbManager.EnableRenderers();

                if (!UIData.isHBallLoaded)
                {
                    IAtomStyle displayAtom;

                    Debug.Log("UIData.atomtype :: " + UIData.atomtype);
                    displayAtom = new AtomCubeStyle();
                    displayAtom.DisplayAtoms(UIData.atomtype);
                }
            }


            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
            CreatGameObjectArray();
            BallUpdate.resetRadii = true;
            //BallUpdate.resetColors = true;
            Debug.Log("Exiting :: SphereToCube");
        }