private string sphereCode;    //state name in the current application

    void Awake()
    {
        sphereRenderer = GetComponent <Renderer>();
        if (sphereManager == null)
        {
            sphereManager = GameObject.FindObjectOfType <SphereManager>();
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        _scoreManager  = FindObjectOfType <ScoreManager>();
        _sphereManager = FindObjectOfType <SphereManager>();
        _cursor        = FindObjectOfType <OrbzCursor>();

        LevelTimer.TimeUp += GameOver;
    }
Ejemplo n.º 3
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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;
                //}
            }
        }
Ejemplo n.º 8
0
 public void Awake()
 {
     sm = GameObject.Find("SphereManager").GetComponent <SphereManager>();
 }
Ejemplo n.º 9
0
 // Use this for initialization
 void Awake()
 {
     t = this;
 }
Ejemplo n.º 10
0
 void Start()
 {
     SphereManager.RegisterSphere(this);
 }