コード例 #1
0
        public void Randomize()
        {
            int       tabIndex     = tabs.IndexOf(currentTab);
            int       featureIndex = currentTab.features.IndexOf(currentTab.currentFeature);
            Character c            = FindObjectOfType <Character>();

            cs   = new CharacterSetting(c.transform);
            c.cs = cs;
            tabs = BuildTabs();
            TabClick(tabIndex);
            FeatureClick(featureIndex);
        }
コード例 #2
0
        void Start()
        {
            cs   = FindObjectOfType <Character>().cs;
            tabs = BuildTabs();
            TabClick(0);

            GameObject p      = GameObject.Find("Player");
            GameObject center = GameObject.Find("CharacterBackground/Center");

            p.transform.position = center.transform.position;

            transform.Find("NameInputField").GetComponent <InputField>().text = cs.name;

            FindObjectOfType <Animator>().SetFloat("Speed", 1);
        }
コード例 #3
0
        void InitializeCharacter()
        {
            SaveData sd         = SaveData.ReadGameSave();
            bool     saveExists = sd != null && sd.character != null;

            if (isPlayer && !saveExists)
            {
                cs = null;
            }

            if (isPlayer && saveExists)
            {
                cs = sd.character;
            }
            else if (cs == null || cs.locations.Length == 0)
            {
                cs = new CharacterSetting(transform);
            }
            cs.host = transform;
            cs.Init();
            cs.SetIdle();
        }