示例#1
0
    public void ToggleModel(int index)
    {
        for (int i = 0; i < transform.GetChild(0).transform.childCount; i++)
        {
            transform.GetChild(0).transform.GetChild(i).gameObject.SetActive(false);
        }

        ShowcaseModel model = showcaseContainer.GetChild(index).GetComponent <ShowcaseModel>();

        if (!model.isUnlocked())
        {
            index = 0;

            model = showcaseContainer.GetChild(index).GetComponent <ShowcaseModel>();

            GameController.SELECTED_MODEL_INDEX = index;
        }

        selectedModel = model;

        transform.GetChild(0).transform.GetChild(index).gameObject.SetActive(true);

        modelCollider = transform.GetChild(0).transform.GetChild(index).GetComponent <BoxCollider>();

        GameController.ActiveModel = model;

        CameraController.Instance.SetCameraHeightOffset(model.cameraPositionOffset);
    }
示例#2
0
    void OnShowcaseModelHover(ShowcaseModel model)
    {
        bool unlocked = model.isUnlocked();

        ui_selectButton.alpha          = unlocked ? 1f : 0f;
        ui_selectButton.blocksRaycasts = unlocked;
        ui_upgrades.alpha          = unlocked ? 1f : 0f;
        ui_upgrades.blocksRaycasts = unlocked;

        ui_conditionText.alpha          = !unlocked ? 1f : 0f;
        ui_conditionText.blocksRaycasts = !unlocked;

        ui_conditionText.transform.GetComponent <Text>().text = model.lockMessage;

        ToggleActiveSelectButton((model.modelType == GameController.ActiveModel.modelType));

        upgradeHandler.UpdateUpgradeUI(model);
    }