IEnumerator SetWindowRefs() { yield return(new WaitForEndOfFrame()); GameObject options = Instantiate(dialogWindowPrefab); //get the window out of it's own canvas Transform optionsTransform = options.transform.GetChild(0); //add it to the creation ui transform // optionsTransform.SetParent (ui,false); //finally set the ref to it's window component optionsWindow = optionsTransform.GetComponent <GenericDialog>(); optionsWindow.gameObject.SetActive(false); confirmSelection = optionsWindow.ConfirmBtn; backButton = optionsWindow.CancelBtn; //This should be a tooltip on each option that is created.... // GameObject descriptionWindow = Instantiate (descriptionWindowPrefab); //get the window out of it's own canvas // Transform descsTransform = descriptionWindow.transform.GetChild (0); //add it to the creation ui transform // descsTransform.SetParent (ui,false); //finally set the ref to it's window component // Utilities.UtilUnity.PasteValuesFromComponentAToB<GenericDialog>( // descriptionWindow.GetComponent<GenericDialog>(), // infoWindow = descsTransform.GetComponent<GenericDialog>(); GameObject runningSheet = Instantiate(inventoryViewPrefab); //get the window out of it's own canvas // Transform runningSheetTransform = runningSheet.transform.GetChild (0); //add it to the creation ui transform // runningSheetTransform.SetParent (ui,false); //finally set the ref to it's window component //finally set the ref to it's window component // Utilities.UtilUnity.PasteValuesFromComponentAToB<GenericDialog>( // runningSheet.GetComponent<GenericDialog>(), // ); InventoryView.instance.doStubCharacters = false; InventoryView.instance.interactivityDisabled = true; character = new Sheet(); character.Name = "New Character"; customizationController = new CharacterCreationController(this, character); customizationController.BeginCustomization(); StartCoroutine(ShowInv()); }
// Basic Info /*public Person (int skinColor, int eyeColor, int hairColor, int faceShape, int eyeShape, int noseShape, int mouthShape, int earShape, int bangShape, * int hairShape, int mustache, int beard, int piercing, int freckles, int mole) * { * SkinColor = skinColors[skinColor]; * EyeColor = eyeColors[eyeColor]; * HairColor = hairColors[hairColor]; * * FaceShape = faceShapes[faceShape]; * EyeShape = eyeShapes[eyeShape]; * NoseShape = noseShapes[noseShape]; * MouthShape = mouthShapes[mouthShape]; * EarShape = earShapes[earShape]; * * BangShape = bangShapes[bangShape]; * HairShape = hairShapes[hairShape]; * * Mustache = mustaches[mustache]; * Beard = beards[beard]; * * Piercing = piercings[piercing]; * Freckles = frecklesTypes[freckles]; * Mole = moles[mole]; * }*/ public Person(string firstName, string lastName, int skinColor, int eyeColor, int hairColor, int faceShape, int eyeShape, int mouthShape, int hairShape, GameObject avatar) { FirstName = firstName; LastName = lastName; CharacterCreationController CharacterController = GameObject.FindObjectOfType <CharacterCreationController>(); SkinColor = CharacterController.skinColors[skinColor]; EyeColor = CharacterController.eyeColors[eyeColor]; HairColor = CharacterController.hairColors[hairColor]; FaceShape = CharacterController.faceShapes[faceShape]; EyeShape = CharacterController.eyeShapes[eyeShape]; MouthShape = CharacterController.mouthShapes[mouthShape]; HairShape = CharacterController.hairShapes[hairShape]; UpdateAvatar(avatar); }
private void Awake() { Instance = this; enterWorldButton.onClick.AddListener(EnterWorld); }