コード例 #1
0
        public static void AddCombineMesh()
        {
            UIData.resetMeshcombine = false;
            GameObject MeshCombineManager;

            if (!GameObject.Find("MeshCombineManager"))
            {
                MeshCombineManager      = GameObject.CreatePrimitive(PrimitiveType.Cube);
                MeshCombineManager.name = "MeshCombineManager";
            }
            else
            {
                MeshCombineManager = GameObject.Find("MeshCombineManager");
            }

            //Will be displayed before the atoms are removed
            if (MoleculeModel.atomsByChar["C"] != null)
            {
                foreach (GameObject Atom in MoleculeModel.atomsByChar["O"])
                {
                    Atom.transform.parent = MeshCombineManager.transform;
                }

/*
 *                      //Will be displayed before the atoms are removed
 *                      if(MoleculeModel.Ces!=null) {
 *                              foreach(GameObject Atom in MoleculeModel.Oes)
 *                                      Atom.transform.parent=MeshCombineManager.transform;
 */
                Meshcombine combineComp = MeshCombineManager.GetComponent <Meshcombine>();
                combineComp.GoOn();
            }
        }
コード例 #2
0
        private void DisplayAtomMethodByCube()
        {
//			ArrayList atomListByType;
            if (atomtype == UIData.AtomType.particleball)
            {
                ArrayList atomListByAxisOrder;
                ArrayList atomListByType;

                if (UIData.secondarystruct)
                {
                    atomListByType = AtomListByType(MoleculeModel.CaSplineList, MoleculeModel.CaSplineTypeList);
                }
                else
                {
                    atomListByType = AtomListByType(MoleculeModel.atomsLocationlist, MoleculeModel.atomsTypelist);
                }

                for (int iType = 0; iType < atomListByType.Count; iType++)
                {
                    DisplayAtomCube(atomListByType[iType] as ArrayList, iType);
                }

                if (UIData.secondarystruct)
                {
                    atomListByAxisOrder = AtomListByAxisOrder(MoleculeModel.CaSplineList);
                }
                else
                {
                    atomListByAxisOrder = AtomListByAxisOrder(MoleculeModel.atomsLocationlist);
                }

                DisplayAtomParticle(atomListByAxisOrder);
            }
            else if (atomtype == UIData.AtomType.particleballalphablend)
            {
                ArrayList atomListByAxisOrder;
                if (UIData.secondarystruct)
                {
                    AtomListByType(MoleculeModel.CaSplineList, MoleculeModel.CaSplineTypeList);
                    atomListByAxisOrder = AtomListByAxisOrder(MoleculeModel.CaSplineList);
                }
                else
                {
                    AtomListByType(MoleculeModel.atomsLocationlist, MoleculeModel.atomsTypelist);
                    atomListByAxisOrder = AtomListByAxisOrder(MoleculeModel.atomsLocationlist);
                }
                DisplayAtomParticle(atomListByAxisOrder);
            }
            else
            {
                if (UIData.secondarystruct)
                {
                    DisplayAtomCube(MoleculeModel.CaSplineList, MoleculeModel.CaSplineTypeList);
                }
                else
                {
                    DisplayAtomCube(MoleculeModel.atomsLocationlist, MoleculeModel.atomsTypelist);
                }
            }

            if (UIData.secondarystruct)
            {
                MoleculeModel.atomsnumber = MoleculeModel.CaSplineList.Count;
            }
            else
            {
                MoleculeModel.atomsnumber = MoleculeModel.atomsLocationlist.Count;
            }

            if (atomtype == UIData.AtomType.combinemeshball)
            {
                GameObject  SpriteManager = GameObject.Find("SpriteManager");
                Meshcombine combineComp   = SpriteManager.GetComponent <Meshcombine>();
                combineComp.GoOn();
            }
            else if (atomtype == UIData.AtomType.particleball || atomtype == UIData.AtomType.particleballalphablend)
            {
                Debug.Log("This is the particle system we actually use.");
                GameObject shurikenParticleManagerObj = GameObject.FindGameObjectWithTag("ShurikenParticleManager");
                ShurikenParticleManager shManager     = shurikenParticleManagerObj.GetComponent <ShurikenParticleManager>();
                shManager.Init();
            }
        }