コード例 #1
0
    void Awake()
    {
        //添加 SceneRoot_Panel
        Object     obj      = Resources.Load("Prefabs/UI/Panel/Canvas_RootCanvas");
        GameObject instance = Instantiate(obj) as GameObject;

        instance.transform.parent        = this.transform;
        instance.transform.localScale    = Vector3.one;
        instance.transform.localPosition = Vector3.zero;
        //PanelSceneRootBehviour panelSceneRootBehviour = instance.gameObject.GetComponent<PanelSceneRootBehviour>();


        //mask 遮罩
        PopMaskMaskManager.Awake();



        //tips的 Prefabs_UI_PopMessage
        obj = Resources.Load("Prefabs/UI/Commons/Prefabs_UI_Message");
        GameObject Prefabs_UI_PopMessage = Instantiate(obj) as GameObject;

        Prefabs_UI_PopMessage.transform.parent        = RootCanvasBehviour.getInstance().Panel_UI_Tips.transform;
        Prefabs_UI_PopMessage.transform.localScale    = Vector3.one;
        Prefabs_UI_PopMessage.transform.localPosition = Vector3.zero;
        Prefabs_UI_PopMessage.name = "Prefabs_UI_Message";
        PopMessageManager.panelMessageBehaviours = Prefabs_UI_PopMessage.GetComponent <PanelMessageBehaviours>();



        //添加对应的ui
        //var Panel_UI_UI =  RootCanvasBehviour.getInstance().Panel_UI_UI;
        //instance = UITool.createUGUI(Prefable_Panel,Panel_UI_UI);
        PopUpManager.createPopUp(Prefable_Panel, 0f);
    }
コード例 #2
0
    public void BuildShip()
    {
        bool canBuild = Manufactory.CanBuild();
        bool canStore = Manufactory.CanStore();

        if (!canStore)
        {
            PopUpManager.CreateSingleButtonTextPopUp("The ship cannot be built because there wont be enough space in the storage", "Ok");
            return;
        }

        if (!canBuild)
        {
            var description = "The ship cannot be built because you are at your maximum production capacity";

            var buttonText = "Ok";

            PopUpManager.CreateSingleButtonTextPopUp(description, buttonText);
            return;
        }

        CloseBuildShipView();

        Manufactory.StartBuildingShip(selectableController.GetSelectedCell().data.shipRecipe);
    }
コード例 #3
0
ファイル: PlayerController.cs プロジェクト: Agraael/HadipoRun
 void Start()
 {
     rb        = GetComponent <Rigidbody2D>();
     popUp     = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpManager>();
     bigErrors = File.ReadAllLines("NameDatabase/errorsExplanations.dat");
     sprite    = GetComponent <SpriteRenderer> ();
 }
コード例 #4
0
    public void Btn_Send()
    {
        List <Dock> destinationDocks = PlayerDataManager.Instance.GetDocksByPlanet(selectedDestination);

        foreach (var destinationDock in destinationDocks)
        {
            if (destinationDock.DockState == DockState.Empty)
            {
                // We need to substract the required fuel from the total fuel
                //dock.Ship.resourcesModule.IncreaseResource(ResourcesDSID.Fuel, -sendShipManager.CalculateReqFuel(selectedLaunchMethod == LaunchMethod.Skyhook));

                InstitutionsUIManager.Instance.CosmicPortUIManager.Back();

                var sendShipData = new SendShipData(dock, destinationDock, selectedDestination);
                Settlement.Instance.CosmicPort.LaunchShip(sendShipData, selectedLaunchMethod);

                // reserve this dock
                destinationDock.UpdateState(DockState.Reserved);
                ReserveDock(destinationDocks);

                return;
            }
        }

        string text = "No docks can receive the ship";

        PopUpManager.CreateSingleButtonTextPopUp(text, "Ok");
        return;
    }
コード例 #5
0
    public void Start()
    {
        //Screen.orientation = ScreenOrientation.Portrait;
        if (ScreenWidth == 0 || ScreenWidth != Screen.width)
        {
            ScreenWidth = Screen.width * 2;
        }

        if (ScreenHeight == 0 || ScreenHeight != Screen.height)
        {
            ScreenHeight = Screen.height;
        }

        // Disable all screens but the MainScreen
        for (int i = 0; i < Screens.Length; i++)
        {
            if (i != MainScreen)
            {
                Screens[i].transform.localPosition = new Vector3(ScreenWidth, 0, 0);
                Screens[i].SetActive(false);
            }
        }
        // Activate Main Screen
        Screens[MainScreen].SetActive(true);

        // Starts Back Screen List and search for PopUpManager
        BackSCreenList = new List <int>();
        popUpManager   = GameObject.FindObjectOfType <PopUpManager>();

        // Sets transition false
        InTransition = false;
        // Active Screen is the same as main screen
        ActiveScreen = MainScreen;
    }
コード例 #6
0
    private void CreateUnlockPopUp(Study study)
    {
        if (StudiesManager.Instance.CheckIfStudyIsUnlocked(study.GetCode()))
        {
            CreateCannotUnlockPopUp();
            return;
        }

        string text            = $"Do you want to unlock {study.GetCode()} study?";
        string button1Text     = "Yes";
        string button2Text     = "No";
        Action button1Callback = new Action(() =>
        {
            StudiesManager.Instance.UnlockStudy(
                (StudyCode)Enum.Parse(typeof(StudyCode),
                                      study.GetCode())
                );

            pressedStudyCell.Refresh();
        });

        PopUpManager.CreateDoubleButtonTextPopUp(text,
                                                 button1Text,
                                                 button2Text,
                                                 button1Callback);
    }
コード例 #7
0
 public static PopUpManager getInstance()
 {
     if (_instance == null)
     {
         _instance = new PopUpManager();
     }
     return _instance;
 }
コード例 #8
0
 void Start()
 {
     pum                = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpManager>();
     isOpen             = false;
     isShowing          = false;
     panelRectTransform = transform as RectTransform;
     panelRectTransform.anchoredPosition = new Vector2(panelRectTransform.anchoredPosition.x, yMin);
 }
コード例 #9
0
 // Start is called before the first frame update
 void Start()
 {
     playerController = FindObjectOfType <PlayerController>();
     timeManager      = FindObjectOfType <TimeManager>();
     audioSource      = GetComponent <AudioSource>();
     animator         = GetComponent <Animator>();
     popUpManager     = FindObjectOfType <PopUpManager>();
 }
コード例 #10
0
    private void ShowNoSkyhooksPopUp()
    {
        var description = "There are no Skyhooks in the storage";

        var buttonText = "Ok";

        PopUpManager.CreateSingleButtonTextPopUp(description, buttonText);
    }
コード例 #11
0
 private void Start()
 {
     mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
     popUp      = FindObjectOfType <PopUpManager>();
     guiLogic   = FindObjectOfType <GUILogic>();
     StartCoroutine(Timer(timerMax));
     score = 0;
     guiLogic.ShowScore(score);
 }
コード例 #12
0
    private void CreateCannotUnlockPopUp()
    {
        string text        = $"This study is already unlocked.";
        string button1Text = "Ok";

        PopUpManager.CreateSingleButtonTextPopUp(text,
                                                 button1Text,
                                                 new Action(() => { }));
    }
コード例 #13
0
ファイル: DeviceManager.cs プロジェクト: sdnavin/Scripts
 void Start()
 {
     serviceInterface = GetComponent <ServiceInterface>();
     _imageGrabber    = GetComponent <ImageGrabber>();
     _popUpManager    = GetComponent <PopUpManager>();
     LoadingPanel.SetActive(false);
     DeviceCanvas.SetActive(false);
     LoggingCanvas.SetActive(true);
 }
コード例 #14
0
ファイル: Prism.cs プロジェクト: gatkins2/Light-Game
    // Spawn colored copies of the player
    public bool SplitRefract()
    {
        // Check if all colors can spawn
        validRefract = true;
        foreach (Transform image in playerImages)
        {
            if (!image.GetComponent <SpriteRenderer>().enabled)
            {
                validRefract = false;
            }
        }

        if (validRefract)
        {
            // Create player objects at each image
            Camera.main.GetComponent <PlayerSelector>().playerPointers = new Pointer[4];
            for (int i = 0; i < playerImages.Count; i++)
            {
                GameObject colorPlayer  = GameObject.Instantiate(player, playerImages[i].transform.position, playerImages[i].rotation);
                GameObject colorPointer = colorPlayer.transform.GetChild(0).GetChild(0).gameObject;
                Destroy(colorPointer.GetComponent <Pointer>());
                colorPlayer.GetComponent <PlayerMove>().pointer = colorPointer.AddComponent <ColorPointer>();
                Color color = playerImages[i].GetComponent <SpriteRenderer>().color;
                color.a = 1;
                colorPlayer.GetComponent <SpriteRenderer>().color             = color;
                colorPointer.GetComponent <ColorPointer>().normalPointer      = colorPointerMaterials[i];
                colorPointer.GetComponent <ColorPointer>().errorPointer       = (Material)Resources.Load("Materials/ErrorLight");
                colorPointer.GetComponent <ColorPointer>().maxRays            = 10;
                colorPointer.GetComponent <ColorPointer>().maxLength          = 1000;
                colorPointer.GetComponent <ColorPointer>().color              = (PlayerColor)i;
                Camera.main.GetComponent <PlayerSelector>().playerPointers[i] = colorPointer.GetComponent <ColorPointer>();
                if (i != 0)
                {
                    colorPointer.GetComponent <ColorPointer>().Active = false;
                }
            }

            // Dsiable colored lines
            foreach (ColorPointer p in lines)
            {
                p.Active = false;
            }

            // Show arrows popup
            PopUpManager popupMgr = Camera.main.GetComponent <PopUpManager>();
            if (popupMgr != null && !PopUpManager.arrowsPopupShown)
            {
                Camera.main.GetComponent <PopUpManager>().ArrowsPopup(gameObject);
            }

            return(true);
        }

        return(false);
    }
コード例 #15
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #16
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }
コード例 #17
0
 private void Awake()
 {
     if (s_Instance == null)
     {
         s_Instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
コード例 #18
0
    // Start is called before the first frame update
    void Start()
    {
        //portal.SetActive(false);
        _soundContainer  = SoundContainer.Instance;
        _soundSource     = _soundContainer.GetComponent <AudioSource>();
        _languageManager = LanguageManager.Instance;
        _hudCanvas       = GameObject.FindWithTag("HUD").GetComponent <PopUpManager>();

        dialogueCallback = DialogueEventCallback;
        Invoke("EstellaAppears", 2);
    }
コード例 #19
0
 private void Awake()
 {
     if (pop == null)
     {
         pop = this;
     }
     if (pop != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #20
0
ファイル: DialogPlayer.cs プロジェクト: DanielCantz/Dawntown
 void Start()
 {
     _soundContainer   = SoundContainer.Instance;
     _soundSource      = _soundContainer.GetComponent <AudioSource>();
     _enemyGameManager = EnemyGameManager.Instance;
     _languageManager  = LanguageManager.Instance;
     _hudCanvas        = GameObject.FindWithTag("HUD").GetComponent <PopUpManager>();
     _player           = GameObject.FindWithTag("Player");
     dialogueCallback  = DialogueEventCallback;
     StartCoroutine(Cooldown());
 }
コード例 #21
0
 void Awake()
 {
     if (pm == null)
     {
         pm = this;
     }
     else if (pm != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #22
0
ファイル: PopUpManager.cs プロジェクト: WeArePawns/Articoding
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
         Instance                = this;
         imageMaterial           = new Material(highlightShader);
         highlightImage.material = imageMaterial;
         mainContent.SetActive(false);
         return;
     }
     Destroy(gameObject);
 }
コード例 #23
0
    public void Btn_ClearDock()
    {
        string text            = $"Do you really want to clear the dock and destroy the ship?";
        string button1Text     = "Yes";
        string button2Text     = "No";
        Action button1Callback = new Action(() =>
        {
            dock.RemoveShip();

            cosmicPortUIManager.Back();
        });

        PopUpManager.CreateDoubleButtonTextPopUp(text, button1Text, button2Text, button1Callback);
    }
コード例 #24
0
ファイル: PlayerActions.cs プロジェクト: AArtlone/SnowBrawl
    public void PickUp()
    {
        pickUpKeyDownTime = 0;

        player.Inventory.Snowballs++;

        if (player.NearbyPlayerBase != null)
        {
            player.NearbyPlayerBase.Snowballs--;
        }

        PopUpManager.PickedUpSnowball(player);

        SoundManager.PlaySound(Sound.PickUpSnowball);
    }
コード例 #25
0
 public void OnDisposeItem(object sender, EventArgs args)
 {
     //TODO: Kai bus sukurtas alert boxas, paklausti zaidejo, ar tikrai nori ismest daikta
     if (!IsMouseInside() && inventoryManager.DraggedItem != null)
     {
         // Null is passed into PopUpManager.CreateInstance method because it is
         // a singleton class and should be initialized somewhere else
         //TODO: hardcoded PopUp message
         SimpleHUDWindow window = WindowFactory.CreatePopup("Drop item?", OnPopupYes, OnPopupNo);
         this.enabled   = false;
         window.Enabled = true;
         window.Visible = true;
         PopUpManager.CreateInstance(null).Push(window);
     }
 }
コード例 #26
0
    private static PopUpManager FindOrCreate()
    {
        PopUpManager popUpManager = Resources.Load <PopUpManager>(FileName);

#if UNITY_EDITOR
        if (!popUpManager)
        {
            popUpManager = CreateInstance <PopUpManager>();
            AssetDatabase.CreateAsset(popUpManager, "Assets/Resources/" + FileName + ".asset");
            AssetDatabase.SaveAssets();

            Debug.LogWarning($"popUpManager is null:{popUpManager==null}");
        }
#endif
        return(popUpManager);
    }
コード例 #27
0
    private void ShowConfirmationPopUp(Planet planet)
    {
        string text            = $"Do you really want to go to {planet}?";
        string button1Text     = "Yes";
        string button2Text     = "No";
        Action button1Callback = new Action(() =>
        {
            print($"Changing to {planet} settlement");

            MySceneManager.Instance.LoadNewSettlement(planet);
        });

        PopUpManager.CreateDoubleButtonTextPopUp(text,
                                                 button1Text,
                                                 button2Text,
                                                 button1Callback);
    }
コード例 #28
0
 void Start()
 {
     rb        = GetComponent <Rigidbody2D>();
     popUp     = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpManager>();
     bigErrors = new string[] {
         "NullReferenceException: Object reference not set to an instance of an object",
         "WTF just contact the support",
         "vs_core.dll was not found",
         "vs_system.dll was loaded but the entry point dllregisterserver was not found",
         "Missing FROM-clause entry for table USER",
         "The class DownloadEntry was not found in the chain configured namespaces Entries",
         "This application has requested the runtime to terminate it in an unusual way",
         "Controller is missing a template for this request format and variant",
         "user is missing the Overtall/Read permission"
     };
     sprite = GetComponent <SpriteRenderer> ();
 }
コード例 #29
0
ファイル: PlayerActions.cs プロジェクト: AArtlone/SnowBrawl
    public void Drop()
    {
        if (!CheckIfCanDrop())
        {
            return;
        }

        PlayerBase homeBase = player.NearbyPlayerBase;

        if (homeBase != null)
        {
            homeBase.Snowballs++;
        }

        player.Inventory.Snowballs--;

        SoundManager.PlaySound(Sound.DropSnowball);

        PopUpManager.DroppedSnowballPopUp(homeBase);
    }
コード例 #30
0
    public void CrossBreed()
    {
        PlantManager plantManager = GameObject.Find("GameManager").GetComponent <PlantManager>(); //get plant manager object
        int          index1       = plantDisplay1.GetComponent <PlantDisplay>().indexNum;         //index of plants in collection
        int          index2       = plantDisplay2.GetComponent <PlantDisplay>().indexNum;
        string       name         = inputField.GetComponent <TMP_InputField>().text;              //user input field

        //handle errors - not enough plants in collection, crossbreeding same breed, invalid/existing name input
        string invMessage = "";

        if (plantManager.plantCollection.Count <= 1)
        {
            invMessage = "There aren't a enough plants in the collection";
        }
        else if (index1 == index2)
        {
            invMessage = "cannot crossbreed the same plant";
        }

        else
        {
            try
            {
                plantManager.Breed(plantManager.plantCollection[index1], plantManager.plantCollection[index2], name);
            }
            catch (ArgumentException)
            {
            }
        }

        //show pop up panel to confirm/deny crossbreed status
        PopUpManager popUpManager = GameObject.Find("GameManager").GetComponent <PopUpManager>();

        if (invMessage != "")
        {
            popUpManager.PopUpMessage(invMessage);
        }
    }
コード例 #31
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     dialogueInst = DialogueManager.dialogueManagerInstance;
     popUpManag   = dialogueInst.gameObject.GetComponent <PopUpManager>();
     popUpManag.ChangePopUp(textToShow, popUpDuration);
 }
コード例 #32
0
ファイル: PopUpManager.cs プロジェクト: antonyip/HexaTD
 void Awake()
 {
     instance = this;
 }