private string sphereCode; //state name in the current application void Awake() { sphereRenderer = GetComponent <Renderer>(); if (sphereManager == null) { sphereManager = GameObject.FindObjectOfType <SphereManager>(); } }
void Start() { _scoreManager = FindObjectOfType <ScoreManager>(); _sphereManager = FindObjectOfType <SphereManager>(); _cursor = FindObjectOfType <OrbzCursor>(); LevelTimer.TimeUp += GameOver; }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
/// <summary> /// Gets the list of active managers based on the atom type provided and based on the bond type in UIData. /// </summary> /// <returns> /// The list of managers. A List<GenericManager> object that should contains the "atom" manager in position 0 and the "bond" manager in position 1 (if there is one). /// </returns> public static List <GenericManager> GetManagers() { UIData.AtomType aType = UIData.atomtype; List <GenericManager> managerList = new List <GenericManager>(); if (aType == UIData.AtomType.hyperball) //|| UIData.bondtype == UIData.BondType.hyperstick) { { GameObject hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager"); HBallManager hbManager = hbManagerObj.GetComponent <HBallManager>(); managerList.Add(hbManager); } else if (aType == UIData.AtomType.sphere) { GameObject spManagerObj = GameObject.FindGameObjectWithTag("SphereManager"); SphereManager spManager = spManagerObj.GetComponent <SphereManager>(); managerList.Add(spManager); } else if (aType == UIData.AtomType.cube) { GameObject cubeManagerObj = GameObject.FindGameObjectWithTag("CubeManager"); CubeManager cubeManager = cubeManagerObj.GetComponent <CubeManager>(); managerList.Add(cubeManager); } else if (aType == UIData.AtomType.particleball) { GameObject psObj = GameObject.FindGameObjectWithTag("ShurikenParticleManager"); ShurikenParticleManager shManager = psObj.GetComponent <ShurikenParticleManager>(); managerList.Add(shManager); } if (UIData.bondtype == UIData.BondType.line) { GameObject lineManagerObj = GameObject.FindGameObjectWithTag("LineManager"); LineManager lineManager = lineManagerObj.GetComponent <LineManager>(); managerList.Add(lineManager); } else if (UIData.bondtype == UIData.BondType.cube) { GameObject cubeBondManagerObj = GameObject.FindGameObjectWithTag("CubeBondManager"); CubeBondManager cubeBondManager = cubeBondManagerObj.GetComponent <CubeBondManager>(); managerList.Add(cubeBondManager); } else if (UIData.bondtype == UIData.BondType.hyperstick) { GameObject hStickManagerObj = GameObject.FindGameObjectWithTag("HStickManager"); HStickManager hStickManager = hStickManagerObj.GetComponent <HStickManager>(); managerList.Add(hStickManager); } return(managerList); }
public static void CubeToSphere() { UIData.resetDisplay = false; // DestroyObject(); HideObject(); if (UIData.atomtype == UIData.AtomType.sphere) { GameObject spmObject = GameObject.FindGameObjectWithTag("SphereManager"); SphereManager spManager = spmObject.GetComponent <SphereManager>(); spManager.EnableRenderers(); } if (!UIData.isSphereLoaded) { IAtomStyle displayAtom; Debug.Log("UIData.atomtype :: " + UIData.atomtype); displayAtom = new AtomSphereStyle(); 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 :: CubeToSphere"); }
public static void HideObject() { if (UIData.atomtype != UIData.AtomType.hyperball) { GameObject hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager"); HBallManager hbManager = hbManagerObj.GetComponent <HBallManager>(); hbManager.DisableRenderers(); } if (UIData.atomtype != UIData.AtomType.sphere) { GameObject spManagerObj = GameObject.FindGameObjectWithTag("SphereManager"); SphereManager spManager = spManagerObj.GetComponent <SphereManager>(); spManager.DisableRenderers(); } if (UIData.atomtype != UIData.AtomType.cube) { GameObject cbManagerObj = GameObject.FindGameObjectWithTag("CubeManager"); CubeManager cbManager = cbManagerObj.GetComponent <CubeManager>(); cbManager.DisableRenderers(); } DestroyBondObject(); }
public void DisplayAtoms(UIData.AtomType type_atom, bool force_display = false) { if (type_atom != UIData.AtomType.particleball || !UIData.isParticlesInitialized || force_display) { //if(!UIData.isSphereLoaded){ if (AtomCubeParent == null) { AtomCubeParent = new GameObject("AtomCubeParent"); } if (MoleculeModel.atoms != null) { MoleculeModel.atoms.Clear(); MoleculeModel.atoms = null; } MoleculeModel.atoms = new ArrayList(); atomtype = type_atom; if (atomtype == UIData.AtomType.sphere) { if (UIData.secondarystruct) { DisplayAtomMethodBySphere(MoleculeModel.CaSplineList, MoleculeModel.CaSplineTypeList); } else { DisplayAtomMethodBySphere(MoleculeModel.atomsLocationlist, MoleculeModel.atomsTypelist); } } GameObject sphereManagerObj = GameObject.FindGameObjectWithTag("SphereManager"); SphereManager sphereManager = sphereManagerObj.GetComponent <SphereManager>(); sphereManager.Init(); UIData.isSphereLoaded = true; //} } }
public void Awake() { sm = GameObject.Find("SphereManager").GetComponent <SphereManager>(); }
// Use this for initialization void Awake() { t = this; }
void Start() { SphereManager.RegisterSphere(this); }