void OnGUI()
        {
            if (Selection.activeObject == selectionProxy)
            {
                if (!WorldSelection?.GetExistingManager <EntityManager>()?.Exists(selectionProxy.Entity) ?? true)
                {
                    Selection.activeObject = null;
                    entityListView.SelectNothing();
                }
            }

            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical(GUILayout.Width(kSystemListWidth)); // begin System List
            SystemHeader();

            GUILayout.BeginVertical();
            SystemList();
            GUILayout.EndVertical();

            GUILayout.EndVertical();                                                     // end System List

            GUILayout.BeginVertical(GUILayout.Width(position.width - kSystemListWidth)); // begin Entity List

            EntityHeader();
            ComponentGroupList();
            EntityList();

            GUILayout.EndVertical(); // end Component List

            GUILayout.EndHorizontal();

            lastUpdate = Time.realtimeSinceStartup;
        }
Esempio n. 2
0
        void DumpToCSVButton()
        {
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            var visitor = new EntityCSVVisitor();

            visitor.m_stringBuilder = stringBuilder;

            var entityManager = WorldSelection.GetExistingManager <EntityManager>();
            var entityArray   = entityListView.SelectedComponentGroup.GetEntityArray();

            Debug.Log(SystemSelection.GetType().Name);
            var CSVPath = EditorUtility.SaveFilePanel("Save entities in selected component group to CSV file", "", "DumpedEntities" + ".csv", "csv");

            if (CSVPath.Length != 0)
            {
                for (int i = 0; i < entityArray.Length; i++)
                {
                    stringBuilder.Append("Entity " + entityArray[i].Index.ToString() + ",");
                    var container = new EntityContainer(entityManager, entityArray[i]);
                    container.PropertyBag.Visit(ref container, visitor);
                    stringBuilder.Remove(stringBuilder.Length - 1, 1);     // delete trailing comma on each line
                    stringBuilder.Append("\n");
                }
                System.IO.File.WriteAllText(CSVPath, stringBuilder.ToString());
            }
        }
    public GameObject GetHouse()
    {
        WorldSelection ws = null;
        GameObject     go = GameObject.FindGameObjectWithTag("WorldSelection");

        if (go != null)
        {
            ws = go.GetComponent <WorldSelection>();
        }
        WorldSelection.Country country = WorldSelection.Country.USA;
        if (ws != null)
        {
            country = ws.country;
        }
        if (country == WorldSelection.Country.France)
        {
            return(frenchHouses[Random.Range(0, frenchHouses.Length)]);
        }
        else if (country == WorldSelection.Country.Japan)
        {
            return(null);
        }
        else
        {
            return(usaHouses[Random.Range(0, usaHouses.Length)]);
        }
    }
Esempio n. 4
0
    public static FullName GetFullName()
    {
        WorldSelection ws = null;
        GameObject     go = GameObject.FindGameObjectWithTag("WorldSelection");

        if (go != null)
        {
            ws = go.GetComponent <WorldSelection>();
        }
        WorldSelection.Country country = WorldSelection.Country.USA;
        if (ws != null)
        {
            country = ws.country;
        }
        if (country == WorldSelection.Country.France)
        {
            return(new FullName(frenchNames[Random.Range(0, frenchNames.Length - 1)], GenerateEuropeanLastName()));
        }
        else if (country == WorldSelection.Country.Japan)
        {
            return(new FullName(japaneseName[Random.Range(0, japaneseName.Length - 1)], GenerateJapaneseLastName()));
        }
        else
        {
            return(new FullName(englishNames[Random.Range(0, englishNames.Length - 1)], GenerateEuropeanLastName()));
        }
    }
Esempio n. 5
0
    public void ResetContent()
    {
        FullName full;

        if (Random.Range(0, 6) == 0)
        {
            NaughtyList list = GameObject.FindGameObjectWithTag("NaughtyList").GetComponent <NaughtyList>();
            GameObject.FindGameObjectWithTag("GameManager").GetComponent <SpawnGift>().IncreaseScore(-999);
            full = list.GetNaugthyKid();
        }
        else
        {
            full = GetFullName();
        }
        Name           name     = full.FirstName;
        string         lastName = full.LastName;
        WorldSelection ws       = null;
        GameObject     go       = GameObject.FindGameObjectWithTag("WorldSelection");

        if (go != null)
        {
            ws = go.GetComponent <WorldSelection>();
        }
        WorldSelection.Country country = WorldSelection.Country.USA;
        if (ws != null)
        {
            country = ws.country;
        }
        string movie;

        if (country == WorldSelection.Country.France)
        {
            movie = frenchFilms[Random.Range(0, frenchFilms.Length)];
        }
        else if (country == WorldSelection.Country.Japan)
        {
            movie = japaneseAnimes[Random.Range(0, japaneseAnimes.Length)];
        }
        else
        {
            movie = englishFilms[Random.Range(0, englishFilms.Length)];
        }
        string like = likes[Random.Range(0, likes.Length)];
        string dislike;

        do
        {
            dislike = likes[Random.Range(0, likes.Length)];
        } while (like == dislike);
        idText.text = "<b>First Name:</b> " + name.FirstName + System.Environment.NewLine
                      + "<b>Last Name:</b> " + lastName + System.Environment.NewLine
                      + "<b>Gender:</b> " + ((name.IsBoy) ? ("Boy") : ("Girl")) + System.Environment.NewLine
                      + "<b>Age:</b> " + Random.Range(8, 16) + System.Environment.NewLine
                      + "<b>Like:</b> " + like + System.Environment.NewLine
                      + "<b>Dislike:</b> " + dislike + System.Environment.NewLine
                      + "<b>Favorite Movie:</b> " + movie;
    }
Esempio n. 6
0
    private void Start()
    {
        WorldSelection ws = null;
        GameObject     go = GameObject.FindGameObjectWithTag("WorldSelection");

        if (go != null)
        {
            ws = go.GetComponent <WorldSelection>();
        }
        WorldSelection.Country country = WorldSelection.Country.USA;
        if (ws != null)
        {
            country = ws.country;
        }
        GameObject[] houses;
        if (country == WorldSelection.Country.France)
        {
            houses = frenchHouses;
        }
        else if (country == WorldSelection.Country.Japan)
        {
            houses = japaneseHouses;
        }
        else
        {
            houses = usaHouses;
        }

        for (float y = 800f; y > 100f; y -= 250f)
        {
            for (float i = -900f; i < 800f; i += 200f)
            {
                GameObject newGo = Instantiate(houses[Random.Range(0, houses.Length)], new Vector3(i, -100f, y), Quaternion.identity);
                newGo.transform.rotation   = Quaternion.Euler(new Vector3(-90f, 0f, 0f));
                newGo.transform.localScale = new Vector3(1000f, 1000f, 1000f);
                allHouses.Add(newGo);
            }
        }
    }