public CharacterCustomizationController(
            CharacterCreationManager manager,
            Sheet character,
            List <CharacterCustomizationStep> staticSteps = null
            ) : base()
        {
            if (staticSteps == null)
            {
                this.staticSteps = new List <CharacterCustomizationStep> ();
            }
            else
            {
                this.staticSteps = staticSteps;
            }

            this.head             = new CharacterCustomizationStep(this);
            this.head.OnDidEnter += HeadStateEntered;

            this.tail             = new ConfirmCustomization(this);
            this.tail.OnDidEnter += TailStateEntered;

            this.head.LinkDestination(tail);

            this.manager   = manager;
            this.character = character;
        }
Esempio n. 2
0
        public CharacterCreationController(CharacterCreationManager manager, Sheet character, List <CharacterCustomizationStep> staticSteps = null
                                           ) : base(manager, character, staticSteps)
        {
            ChooseRace  chooseRace  = new ChooseRace(this);
            ChooseClass chooseClass = new ChooseClass(this);
            ChooseName  chooseName  = new ChooseName(this);
            PointBuy    pointBuy    = new PointBuy(this);

            AddStaticStep(chooseRace);
            AddStaticStep(chooseClass);
            AddStaticStep(pointBuy);
            AddStaticStep(chooseName);

            OnDidConfirmCustomization += SerializeThisShit;
        }
    private void Start()
    {
        // Return if account name is empty.
        if (MainManager.Instance == null || MainManager.Instance.GetAccountName() == null)
        {
            return;
        }

        // Set instance.
        if (Instance != null)
        {
            return;
        }
        Instance = this;

        // Schedule exit to login screen.
        StartCoroutine(ExitToCharacterSelection());

        // Add button listeners.
        _zoomIn.onClick.AddListener(CameraZoomIn);
        _zoomOut.onClick.AddListener(CameraZoomOut);
        _createButton.onClick.AddListener(OnClickCreateButton);
        _backButton.onClick.AddListener(OnClickBackButton);

        // Initialize character data holders.
        _dataHolderMale = new CharacterDataHolder();
        _dataHolderMale.SetRace(0);
        _dataHolderFemale = new CharacterDataHolder();
        _dataHolderFemale.SetRace(1);
        _dataHolder = _dataHolderMale;

        // Initial values.
        _avatar = CharacterManager.Instance.CreateCharacter(_dataHolderMale, 8.28f, 0.1035156f, 20.222f, 180);
        _avatar.SetSlot("Underwear", "MaleUnderwear");
        _avatar.CharacterUpdated.AddListener(Updated);
        _heightSlider.onValueChanged.AddListener(HeightChange);
        _bellySlider.onValueChanged.AddListener(BellyChange);

        // Camera position.
        Camera.main.transform.position = new Vector3(8.29f, 1.29f, 17.7f);
    }
    private void Start()
    {
        // Return if account name is empty.
        if (PlayerManager.instance == null || PlayerManager.instance.accountName == null)
        {
            return;
        }

        // Save instance.
        instance = this;

        // Button listeners.
        selectButtons[0].GetComponent <Button>().onClick.AddListener(OnClickButton1);
        selectButtons[1].GetComponent <Button>().onClick.AddListener(OnClickButton2);
        selectButtons[2].GetComponent <Button>().onClick.AddListener(OnClickButton3);
        selectButtons[3].GetComponent <Button>().onClick.AddListener(OnClickButton4);
        createButton.GetComponent <Button>().onClick.AddListener(OnClickCreateButton);
        backButton.GetComponent <Button>().onClick.AddListener(OnClickBackButton);

        // Select first character model.
        characterSelected = Instantiate(GameObjectManager.instance.playerModels[0], spawnLocation.transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
    }
 void Start()
 {
     characterUi = GetComponentInParent <CharacterCreationManager>();
 }