get() public static method

public static get ( ) : DevicesDisplayer,
return DevicesDisplayer,
    void initIfNecessary()
    {
        Logger.Log("EquipedDisplayedDevice::initIfNecessary starts", Logger.Level.INFO);
        if (
            (null == equipedDevice) ||
            (null == tinyBioBrickIcon) ||
            (null == tinyBioBrickIcon2) ||
            (0 == _tinyIconVerticalShift) ||
            (0 == _width)
            )
        {
            equipedDevice = DevicesDisplayer.get().equipedDevice;

            tinyBioBrickIcon  = GameObject.Find("InterfaceLinkManager").GetComponent <InterfaceLinkManager>().tinyBioBrickIconPrefabPos;
            tinyBioBrickIcon2 = GameObject.Find("InterfaceLinkManager").GetComponent <InterfaceLinkManager>().tinyBioBrickIconPrefabPos2;
        }

        if (null != tinyBioBrickIcon)
        {
            if (null != equipedDevice)
            {
                _tinyIconVerticalShift = (tinyBioBrickIcon.transform.localPosition - equipedDevice.transform.localPosition).y;
            }
            if (null != tinyBioBrickIcon2)
            {
                _width = tinyBioBrickIcon2.transform.localPosition.x - tinyBioBrickIcon.transform.localPosition.x;
                tinyBioBrickIcon.SetActive(false);
                tinyBioBrickIcon2.SetActive(false);
            }
            Logger.Log("EquipedDisplayedDevice::initIfNecessary ends", Logger.Level.INFO);
        }
    }
Beispiel #2
0
 void Start()
 {
     if (null == _devicesDisplayer)
     {
         _devicesDisplayer = DevicesDisplayer.get();
     }
 }
Beispiel #3
0
 public static void Initialize(
     DisplayedDevice displayedDeviceScript
     , Device device
     , DevicesDisplayer devicesDisplayer
     , DevicesDisplayer.DeviceType deviceType
     )
 {
     if (device == null)
     {
         Logger.Log("DisplayedDevice::Initialize device==null", Logger.Level.WARN);
     }
     Logger.Log("DisplayedDevice::Initialize(" + displayedDeviceScript + ", " + device + ", " + devicesDisplayer + ", " + deviceType + ") starts", Logger.Level.DEBUG);
     displayedDeviceScript._device = Device.buildDevice(device);
     if (displayedDeviceScript._device == null)
     {
         Logger.Log("DisplayedDevice::Initialize _device==null", Logger.Level.WARN);
     }
     Logger.Log("DisplayedDevice::Create built device " + displayedDeviceScript._device + " from " + device, Logger.Level.TRACE);
     if (_devicesDisplayer == null)
     {
         _devicesDisplayer = DevicesDisplayer.get();
     }
     displayedDeviceScript._deviceType = deviceType;
     Logger.Log("DisplayedDevice::Initialize ends", Logger.Level.TRACE);
 }
 protected DevicesDisplayer safeGetDisplayer()
 {
     if (_displayer == null)
     {
         _displayer = DevicesDisplayer.get();
     }
     return(_displayer);
 }
    public ArrowAnimationManager arrowManager;                  //Manager for the arrow Animation

    // Use this for initialization
    void Start()
    {
        _reactionEngine   = ReactionEngine.get();
        _devicesDisplayer = DevicesDisplayer.get();

        SetScreen2(false);
        SetScreen3(false);
        SetScreen1(true);


        _devicesDisplayer.UpdateScreen();
        _currentScreen = GameScreen.screen1;

        _timeAtLastFrame = Time.realtimeSinceStartup;

        arrowManager = new ArrowAnimationManager();
    }
Beispiel #6
0
    //public Camera _uicamera;


    // Use this for initialization
    void Awake()
    {
        //shortcut
        CraftZoneManager    craftZoneManager    = CraftZoneManager.get();
        GameStateController gameStateController = GameStateController.get();
        //CraftFinalizer _craftfinalizer = craftFinalizer;
        GUITransitioner           guiTransitioner           = GUITransitioner.get();
        DevicesDisplayer          devicesDisplayer          = DevicesDisplayer.get();
        InfoWindowManager         infoWindowManager         = InfoWindowManager.get();
        AvailableBioBricksManager availableBioBricksManager = AvailableBioBricksManager.get();
        TooltipManager            tooltipManager            = TooltipManager.get();
        ModalManager modalManager        = ModalManager.get();
        GameObject   mediumInfoPanelCell = GameObject.Find("MediumInfoPanelCell");

        //GUITransitioner
        guiTransitioner.celliaGraph = mediumInfoPanelCell.transform.Find("CellMediumInfoBackgroundSprite").gameObject
                                      .GetComponent <VectrosityPanel>();
        guiTransitioner.roomGraph = GameObject.Find("MediumInfoPanelRoom").transform.Find("RoomMediumInfoBackgroundSprite").gameObject
                                    .GetComponent <VectrosityPanel>();
        guiTransitioner.animator    = GameObject.Find("WorldEquipButton").GetComponent <InventoryAnimator>();
        guiTransitioner.worldScreen = GameObject.Find("WorldScreensPanel");
        guiTransitioner.craftScreen = craftScreenPanel;

        ContinueButton  cb  = okButton1.GetComponent <ContinueButton>();
        StartGameButton sgb = okButton2.GetComponent <StartGameButton>();

        //GameStateController
        gameStateController.intro = introduction1;
        gameStateController.introContinueButton = cb;
        gameStateController.fadeSprite          = fade;
        gameStateController.endWindow           = end;
        EndMainMenuButton emmb = endMainMenuButton.GetComponent <EndMainMenuButton>();

        gameStateController.endMainMenuButton = emmb;
        gameStateController.mainMenu          = mainMenu;

        //TODO should be done in gameStateController instead
        tutorialPanels.SetActive(true);
        introduction1.SetActive(false);
        introduction2.SetActive(false);
        end.SetActive(false);
        pauseIndicator.SetActive(false);
        genericModalWindow.SetActive(false);

        craftScreenPanel.SetActive(false);

        mainMenu.open();

        gameStateController.pauseIndicator = pauseIndicator;

        //initialization of intro panels
        cb.nextInfoPanel         = introduction2;
        cb.nextInfoPanelContinue = sgb;

        //CraftFinalizer
        craftFinalizer.ToCraftZoneManager = craftZoneManager;

        //CraftZoneManager
        craftZoneManager.GetComponent <CraftZoneManager>().craftFinalizer = craftFinalizer;

        //CraftFinalizer _craftFinalizer2 = CraftZoneManager.get().GetComponent<CraftZoneManager>().craftFinalizer;
        if (null == craftFinalizer.craftFinalizationButton)
        {
            craftFinalizer.craftFinalizationButton = GameObject.Find("CraftButton").GetComponent <CraftFinalizationButton>();
        }

        craftZoneManager.displayedBioBrick      = craftZoneDisplayedBioBrickPrefab;
        craftZoneManager.lastHoveredInfoManager = lastHoveredInfo.GetComponent <LastHoveredInfoManager>();
        craftZoneManager.assemblyZonePanel      = craftScreenPanel.transform.FindChild("TopPanel").transform.FindChild("AssemblyZonePanel").gameObject;


        //DevicesDisplayer

        devicesDisplayer.equipPanel           = equipedDevicesSlotsPanel;
        devicesDisplayer.inventoryPanel       = inventoryDevicesSlotsPanel;
        devicesDisplayer.listedInventoryPanel = craftScreenPanel.transform.FindChild("BottomPanel").transform.FindChild("DevicesPanel").GetComponent <UIPanel>();

        devicesDisplayer.graphMoleculeList = mediumInfoPanelCell.GetComponent <GraphMoleculeList>() as GraphMoleculeList;

        devicesDisplayer.equipedDevice  = equipedDeviceButtonPrefabPos;
        devicesDisplayer.equipedDevice2 = equipedDeviceButtonPrefabPos2;

        devicesDisplayer.inventoryDevice       = inventoryDevicePrefab;
        devicesDisplayer.listedInventoryDevice = listedDevicePrefab;


        //InfoWindowManager
        infoWindowManager.infoPanel        = genericInfoWindow;
        infoWindowManager.titleLabel       = genericInfoWindow.transform.FindChild("TitleLabel").GetComponent <UILocalize>();
        infoWindowManager.subtitleLabel    = genericInfoWindow.transform.FindChild("SubtitleLabel").GetComponent <UILocalize>();
        infoWindowManager.explanationLabel = genericInfoWindow.transform.FindChild("ExplanationLabel").GetComponent <UILocalize>();
        infoWindowManager.bottomLabel      = genericInfoWindow.transform.FindChild("BottomLabel").GetComponent <UILocalize>();
        infoWindowManager.infoSprite       = genericInfoWindow.transform.FindChild("InfoSprite").GetComponent <UISprite>();

        //ModalManager
        modalManager.modalBackground               = modalBackground;
        modalManager.genericModalWindow            = genericModalWindow;
        modalManager.titleLabel                    = genericModalWindow.transform.FindChild("TitleLabel").GetComponent <UILocalize>();
        modalManager.explanationLabel              = genericModalWindow.transform.FindChild("ExplanationLabel").GetComponent <UILocalize>();
        modalManager.infoSprite                    = genericModalWindow.transform.FindChild("InfoSprite").GetComponent <UISprite>();
        modalManager.genericValidateButton         = genericModalWindow.transform.FindChild("ValidateButton").gameObject;
        modalManager.genericCenteredValidateButton = genericModalWindow.transform.FindChild("CenteredValidateButton").gameObject;
        modalManager.genericCancelButton           = genericModalWindow.transform.FindChild("CancelButton").gameObject;


        //DeviceInventory
        Inventory.get().animator = GameObject.Find("WorldEquipButton").GetComponent <InventoryAnimator>();
        Inventory.get().animator.tutorialArrowAnimation = tutorialArrow.GetComponent <ArrowAnimation>();

        //BiobrickInventory

        //AvailableBioBricksManager.get().bioBricksPanel = GameObject.Find("BiobricksPanel");
        availableBioBricksManager.bioBricksPanel    = craftScreenPanel.transform.FindChild("BottomPanel").transform.FindChild("BiobricksPanel").gameObject;
        availableBioBricksManager.availableBioBrick = availableBioBricksManager.bioBricksPanel.transform.FindChild("AvailableDisplayedBioBrickPrefab").gameObject;
        //AvailableBioBricksManager.get ().availableBioBrick = GameObject.Find ("AvailableDisplayedBioBrickPrefab");

        //TooltipManager
        tooltipManager.bioBrickTooltipPanel = biobrickTooltipPanel;
        tooltipManager.deviceTooltipPanel   = deviceTooltipPanel;
        tooltipManager.uiCamera             = GameObject.Find("Camera").GetComponent <Camera>();

        Logger.get().loggerGUIComponent = loggerGUIComponent;
    }