예제 #1
0
 // Use this for initialization
 void Start()
 {
     Trait.Load();
     ButtonPrefab = Resources.Load <GameObject>("Button") as GameObject;
     UpdateTraits();
     for (int i = 0; i < Aspects.Count; i++)
     {
         AspectStrings [i].text = Character.PersonalityAspectsStrings [i];
     }
 }
예제 #2
0
    void Awake()
    {
        Species s = new Species("Poof");

        StreamingPath = Application.streamingAssetsPath;
        Debug.LogError("Streaming path loaded into string. Proceed.");
        if (Manager != null)
        {
            Debug.Log("Error, multiple ThemeManagers present");
        }
        Trait.Load();
        Manager = this;
        GenerateThemes();
        if (!DebugSuppressPortraitLoading)
        {
            ThreadNinjaMonoBehaviourExtensions.StartCoroutineAsync(this, ImportPortraits());
        }
    }
예제 #3
0
    void UpdateTraits()
    {
        int yOff     = -45;
        int interval = 1;

        Trait.Load();
        foreach (GameObject g in Buttons)
        {
            Destroy(g);
        }

        Buttons.Clear();
        foreach (Trait d in Trait.Traits)
        {
            GameObject g = Instantiate <GameObject> (ButtonPrefab) as GameObject;
            Buttons.Add(g);
            RectTransform      h       = g.GetComponent <RectTransform> ();
            TraitButtonManager manager = g.AddComponent <TraitButtonManager> ();
            manager.Manager = this;
            manager.Assign(this, d);
            h.SetParent(ButtonsParent.transform);
            h.rotation           = Camera.main.transform.rotation;
            h.anchoredPosition3D = new Vector3(0f, yOff * interval, 0f);
            h.sizeDelta          = new Vector2(200f, 35f);
            h.localScale         = new Vector3(1f, 1f, 1f);
            interval++;
        }
        if (!string.IsNullOrEmpty(SelectedTrait.Name))
        {
            Name.text        = SelectedTrait.Name;
            Description.text = SelectedTrait.Description;
            for (int i = 0; i < Aspects.Count; i++)
            {
                AspectStrings [i].text = Character.PersonalityAspectsStrings [i];
                Aspects [i].text       = SelectedTrait.PersonalityModifiers [i].ToString();
            }
        }
        UpdateSelectedTraitSampleSummary(" ");
    }
예제 #4
0
 void Start()
 {
     Human             = this;
     empire            = gameObject.AddComponent <Empire> ();
     empire.EmpireName = "Federal Star Republic";
     empire.Faction    = FAC.PLAYER;
     //empire.GenerateStartingOfficerCorps ();
     Trait.Load();
     Debug.Log(Trait.Traits.Count);
     SetMousePositioner();
     if (!ConstructionManager.ConstructablePrefab)
     {
         ConstructionManager.ConstructablePrefab = Resources.Load <GameObject> ("Constructable") as GameObject;
     }
     Debug.Log(NameManager.names.Count + " ship names have been loaded");
     SpaceYard.player     = this;
     Screens.ShieldPrefab = Resources.Load <GameObject>("ScreenPrefab") as GameObject;
     SelectionUI          = GameObject.FindGameObjectWithTag("SelectionUI");
     selectText           = SelectionUI.GetComponentInChildren <Text> ();
     //ShipAbstract.OnDeath.AddListener (RemoveShip);
     HullDes Default = new HullDes("", "");
 }