示例#1
0
    /// <summary>
    /// Starts the spawn. Creates an object and container based on the enum for game shape and diff
    /// </summary>
    /// <param name='obj'>
    /// Only for debugging purposes, indicated which object threw the command to start the spawn
    /// </param>
    IEnumerator startSpawnHelper(Object obj)
    {
        yield return(new WaitForSeconds(0.5f));

        Debug.Log("Spawning polygon from " + obj.name + " at " + Time.realtimeSinceStartup);

        numOfPolygons = 1;

        GameObject polygonPrefab   = getPolygon(shape.ToString());
        GameObject containerPrefab = getContainer(shape.ToString(), diff.ToString());

        spawnStartTime = Time.realtimeSinceStartup;

        GameObject g = Instantiate(polygonPrefab, Vector3.zero, Quaternion.identity) as GameObject;

        g.name = shape.ToString();
        Instantiate(containerPrefab, Vector3.zero, Quaternion.identity).name = containerName;         //
    }
示例#2
0
 /// <summary>
 /// Sets the game shape.
 /// </summary>
 /// <param name='obj'>
 /// the UIButton with the name of a GameShape enum
 /// </param>
 void SetGameShape(GameObject obj)
 {
     shape = (GameShape)System.Enum.Parse(typeof(GameShape), obj.name);
     Debug.Log("Shape: " + shape.ToString() + " called by " + obj.name);
 }