private void GenerateCharacter(bool is_starter)
    {
        int num = 0;

        do
        {
            info = Immigration.Instance.RandomCarePackage();
            num++;
        }while (IsCharacterRedundant() && num < 20);
        if ((UnityEngine.Object)animController != (UnityEngine.Object)null)
        {
            ScreenResize instance = ScreenResize.Instance;
            instance.OnResize = (System.Action)Delegate.Remove(instance.OnResize, new System.Action(OnResize));
            UnityEngine.Object.Destroy(animController.gameObject);
            animController = null;
        }
        SetAnimator();
        SetInfoText();
        selectButton.ClearOnClick();
        if (!controller.IsStarterMinion)
        {
            selectButton.onClick += delegate
            {
                SelectDeliverable();
            };
        }
    }
Exemple #2
0
    private void GenerateCharacter(bool is_starter, string guaranteedAptitudeID = null)
    {
        int num = 0;

        do
        {
            stats = new MinionStartingStats(is_starter, guaranteedAptitudeID);
            num++;
        }while (IsCharacterRedundant() && num < 20);
        if ((UnityEngine.Object)animController != (UnityEngine.Object)null)
        {
            ScreenResize instance = ScreenResize.Instance;
            instance.OnResize = (System.Action)Delegate.Remove(instance.OnResize, new System.Action(OnResize));
            UnityEngine.Object.Destroy(animController.gameObject);
            animController = null;
        }
        SetAnimator();
        SetInfoText();
        StartCoroutine(SetAttributes());
        selectButton.ClearOnClick();
        if (!controller.IsStarterMinion)
        {
            selectButton.enabled  = true;
            selectButton.onClick += delegate
            {
                SelectDeliverable();
            };
        }
    }
Exemple #3
0
 public void RefreshToggleContents()
 {
     foreach (KeyValuePair <Tag, KToggle> elementToggle in ElementToggles)
     {
         KToggle    value                = elementToggle.Value;
         Tag        elem                 = elementToggle.Key;
         GameObject gameObject           = value.gameObject;
         LocText[]  componentsInChildren = gameObject.GetComponentsInChildren <LocText>();
         LocText    locText              = componentsInChildren[0];
         LocText    locText2             = componentsInChildren[1];
         Image      image                = gameObject.GetComponentsInChildren <Image>()[1];
         locText2.text = Util.FormatWholeNumber(WorldInventory.Instance.GetAmount(elem));
         locText.text  = Util.FormatWholeNumber(activeMass);
         GameObject gameObject2 = Assets.TryGetPrefab(elementToggle.Key);
         if ((Object)gameObject2 != (Object)null)
         {
             KBatchedAnimController component = gameObject2.GetComponent <KBatchedAnimController>();
             image.sprite = Def.GetUISpriteFromMultiObjectAnim(component.AnimFiles[0], "ui", false, string.Empty);
         }
         gameObject.SetActive(WorldInventory.Instance.IsDiscovered(elem) || DebugHandler.InstantBuildMode || Game.Instance.SandboxModeActive);
         SetToggleBGImage(elementToggle.Value, elementToggle.Key);
         value.soundPlayer.AcceptClickCondition = (() => IsEnoughMass(elem));
         value.ClearOnClick();
         if (IsEnoughMass(elem))
         {
             value.onClick += delegate
             {
                 OnSelectMaterial(elem, activeRecipe, false);
             };
         }
     }
     SortElementToggles();
     UpdateMaterialTooltips();
     UpdateHeader();
 }