コード例 #1
0
ファイル: Store.cs プロジェクト: ebgolden/The-Robot-Games
    public Store(List <Mesh> meshes, Robot previewRobot, Part[] storeParts, List <Part> humanParts, Part[] robotParts, long credits, ConfigurationCard configurationCard, Color colorScheme, bool enableCreditsSpentAnimation)
    {
        MESHES            = meshes;
        this.previewRobot = previewRobot;
        this.humanParts   = humanParts;
        this.credits      = credits;
        this.colorScheme  = colorScheme;
        this.enableCreditsSpentAnimation = enableCreditsSpentAnimation;
        GameObject storePanel = GameObject.Find("StorePanel");

        foreach (Transform child in storePanel.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        MASK = GameObject.Find("Store").transform.Find("StoreMask").gameObject;
        MASK.SetActive(false);
        this.robotParts = new List <Part>();
        if (robotParts != null && robotParts.Length > 0)
        {
            this.robotParts.AddRange(robotParts);
            robot       = new Robot("", true, true, this.robotParts.ToArray());
            STORE_PARTS = new List <Part>();
            STORE_PARTS.AddRange(storeParts);
            STORE_CARD = new StoreCard(this.credits, STORE_PARTS.ToArray(), this.humanParts.ToArray(), this.robotParts.ToArray(), colorScheme, enableCreditsSpentAnimation);
            STORE_CARD.enable();
            CONFIGURATION_CARD = configurationCard;
        }
        mode = StoreCard.MODES.VIEW_PART_STATS;
        PERFORMANCE_METRIC_CALCULATOR = new PerformanceMetricCalculator();
        partBought = null;
        partWithPreviewedTexture = null;
    }
コード例 #2
0
ファイル: Workshop.cs プロジェクト: ebgolden/The-Robot-Games
    public Workshop(List <Mesh> meshes, Robot previewRobot, string robotName, List <Part> humanParts, Part[] robotParts, long credits, Color colorScheme, bool enableCreditsSpentAnimation)
    {
        MESHES            = meshes;
        this.previewRobot = previewRobot;
        this.robotName    = robotName;
        this.humanParts   = humanParts;
        this.credits      = credits;
        this.colorScheme  = colorScheme;
        this.enableCreditsSpentAnimation = enableCreditsSpentAnimation;
        goToField = false;
        GameObject widgetsPanel = GameObject.Find("WidgetsPanel");

        foreach (Transform child in widgetsPanel.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        GameObject partsPanel = GameObject.Find("PartsPanel");

        foreach (Transform child in partsPanel.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        MASK = GameObject.Find("Workshop").transform.Find("WorkshopMask").gameObject;
        MASK.SetActive(false);
        BATTLE_BUTTON = GameObject.Find("BattleButton");
        ACTIVE_BATTLE_BUTTON_COLOR = BATTLE_BUTTON.GetComponent <UnityEngine.UI.Image>().color;
        this.robotParts            = new List <Part>();
        if (robotParts != null && robotParts.Length > 0)
        {
            this.robotParts.AddRange(robotParts);
            robot = new Robot("", true, true, this.robotParts.ToArray());
            CONFIGURATION_CARD = new ConfigurationCard(robotName, credits, robot.getDurability(), robot.getRemainingDurability(), robot.getRobotStatStrings(), robot.getWeight() > robot.getMaxForce(), this.robotParts.ToArray(), colorScheme, enableCreditsSpentAnimation);
            CONFIGURATION_CARD.enable();
            INVENTORY_CARD = new InventoryCard(this.credits, this.humanParts.ToArray(), this.robotParts.ToArray());
            INVENTORY_CARD.enable();
        }
        partWithPreviewedTexture = null;
    }