Ejemplo n.º 1
0
    private void EndTurn()
    {
        if (OnTurnEnd != null)
        {
            OnTurnEnd(m_currentPlayer, m_playerCounter);
        }

        m_playerCounter = m_playerCounter == PlayerNum.Player1 ? PlayerNum.Player2 : PlayerNum.Player1;

        turn_active = false;
        //TODO: unregister EndTurn from current player
        m_currentPlayer.OnTurnEnd -= this.EndTurn;

        PlayerNum winner = PlayerNum.Player1;

        if (GameDone(out winner))
        {
            game_done = true;
            EndGame(winner);
        }
        else
        {
            if (GameObject.ReferenceEquals(m_p1.GetCurrentTile(), m_p2.GetCurrentTile()))
            {
                minigame_in_progress = true;
                ModalPanel.Instance().Activate();
            }

            this.GetComponent <Animator>().SetTrigger("TurnWait");
            //Activate waiting camera
            //StartTurn();
        }
    }
Ejemplo n.º 2
0
    public override void Activate()
    {
        modalPanel = ModalPanel.Instance();

        button1Action = new UnityAction(buildAdditionalBlock);
        button2Action = new UnityAction(base.ExitBuildState);
    }
Ejemplo n.º 3
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();

        firstCandidate  = new UnityAction(firstChoice);
        secondCandidate = new UnityAction(secondChoice);
    }
Ejemplo n.º 4
0
 void Awake()
 {
     modalPanel = ModalPanel.Instance ();
     //Set actions
     AcceptAction = new UnityAction (OnYes);
     DenyAction = new UnityAction (OnNo);
 }
Ejemplo n.º 5
0
 public void SetUpPanel(string title, string text, string buttonText)
 {
     ModalPanelTitle.GetComponent <TMPro.TextMeshProUGUI>().text      = title;
     ModalPanelSubtitle.GetComponent <TMPro.TextMeshProUGUI>().text   = text;
     ModalPanelButtonText.GetComponent <TMPro.TextMeshProUGUI>().text = buttonText;
     ModalPanel.SetActive(true);
 }
Ejemplo n.º 6
0
 void Awake()
 {
     modalPanel     = ModalPanel.Instance();
     myYesAction    = new UnityAction(TestYesFuncion);
     myNoAction     = new UnityAction(TestNoFunction);
     myCancelAction = new UnityAction(TestCancelFunction);
 }
Ejemplo n.º 7
0
    //준비
    void Awake()
    {
        modalpanel = ModalPanel.Instace ();

        reEventAction = new UnityAction (CallRestartFunc);
        maEventAction = new UnityAction (CallGomainFunc);
    }
Ejemplo n.º 8
0
    //decrements number of actions left for the day and returns number of actions left
    //updates day/month as necessary
    public int decrementActionsLeft(int actions = 1)
    {
        ModalPanel mp = FindObjectOfType <ModalPanel>();

        mp.modalPanelObject.GetComponentInChildren <Text>().text = "";
        //mp.QueueMessage("Current ActionsLeft: " + actionsLeft);
        actionsLeft--;        //decrement # of actions left
        mp.QueueMessage("ActionsLeft: " + actionsLeft);
        if (actionsLeft <= 0) //out of actions
        {
            mp.QueueMessage("Out of Actions, New Day!");
            actionsLeft = actionsPerDay;//refresh actions
            day++;

            if (day > 30)//new month
            {
                day = 0;
                month++;
                mp.QueueMessage("New Month!");
            }
        }
        mp.QueueMessage(string.Format("Month {0}, Day {1}", month, day));

        return(actionsLeft);
    }
Ejemplo n.º 9
0
    private void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        onWonOk = new UnityAction(OnWonOk);
    }
Ejemplo n.º 10
0
    //fight your step dad
    static public void fight()
    {
        ModalPanel mp = FindObjectOfType <ModalPanel>();

        Player ThePlayer = Variables.player;

        UnityEngine.Random.InitState((int)Time.time);//seed random for fight chance

        mp.QueueMessage("Oh man, bro, you're totally 'bout to fight your own dang dad,bro.");

        float fightChance = UnityEngine.Random.value + ThePlayer.skill / 100; //1% chance increase per skill level

        if (fightChance > Variables.dadSkill)                                 //won fight, gain rep
        {
            mp.QueueMessage("You totally dun kicked your dad's butt, yo!");
            ThePlayer.incrementRep(1);
            mp.QueueMessage("Your rep is now " + ThePlayer.rep);
        }
        else//lost fight, lose health
        {
            mp.QueueMessage("Aww shucks, you got your dang butt beat up, son!");
            ThePlayer.decrementHealth(1);
            mp.QueueMessage("Your health is now " + ThePlayer.health);
        }

        ActionManager.Instance.decrementActionsLeft();
    }
 private void Awake()
 {
     modalPanel     = ModalPanel.Instance();
     PlayerMovement =
         GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
     player = GameObject.FindWithTag("Player");
 }
Ejemplo n.º 12
0
    public static void CallLoading(ModalPanel modalPanel, CanvasGroup canvasGroup, string messageText, UnityAction callback)
    {
        ShowModal (modalPanel, canvasGroup);

        modalPanel.loadingPanel.gameObject.SetActive (true);
        modalPanel.loadingPanel.Show (messageText, callback);
    }
Ejemplo n.º 13
0
    void Start()
    {
        water = new List <AudioClip>(new AudioClip[] { sound1, sound2, sound3, sound4, sound5, sound6, sound7, sound8, sound9,
                                                       sound10, sound11, sound12, sound13, sound14, sound15, sound16 });
        wood = new List <AudioClip>(new AudioClip[] { sound17, sound18, sound19, sound20, sound21, sound22, sound23, sound24, sound25,
                                                      sound26, sound27, sound28, sound29, sound30, sound31, sound32 });
        iron = new List <AudioClip>(new AudioClip[] { sound33, sound34, sound35, sound36, sound37, sound38, sound39, sound40, sound41,
                                                      sound42, sound43, sound44, sound45, sound46, sound47, sound48 });
        earth = new List <AudioClip>(new AudioClip[] { sound49, sound50, sound51, sound52, sound53, sound54, sound55, sound56, sound57,
                                                       sound58, sound59, sound60, sound61, sound62, sound63, sound64 });
        fire = new List <AudioClip>(new AudioClip[] { sound65, sound66, sound67, sound68, sound69, sound70, sound71, sound72, sound73,
                                                      sound74, sound75, sound76, sound77, sound78, sound79, sound80 });
        modalPanel = ModalPanel.Instance();
        //water
        watersoundpicker();
        wateractioncreated();
        //wood
        woodsoundpicker();
        woodactioncreated();
        //iron
        ironsoundpicker();
        ironactioncreated();
        //earth
        earthsoundpicker();
        earthactioncreated();
        //fire
        firesoundpicker();
        fireactioncreated();

        gameObject.AddComponent <AudioSource>();
        //source.playOnAwake = false;

        sceneCam = GameObject.Find("Main Camera");
    }
Ejemplo n.º 14
0
 public static void Cancel()
 {
     callback = null;
     flag = true;
     cancelObject.gameObject.SetActive (false);
     cancelObject = null;
 }
Ejemplo n.º 15
0
    private void InitAlertBox()
    {
        _modalPanel = ModalPanel.Instance();

        Transform modalPanel = Instantiate(Resources.Load("HomeScreen/ModalYesNoPanel", typeof(Transform))) as Transform;

        modalPanel.position = new Vector3(0, 0, 0);
        modalPanel.transform.localPosition = new Vector3(0, 0, 0);
        modalPanel.gameObject.SetActive(false);
        modalPanel.SetParent(_stage.transform, false);

        GameObject panel = modalPanel.transform.Find("Panel").gameObject;

        _modalPanel.title   = panel.transform.Find("TitleText").GetComponent <Text>();
        _modalPanel.message = panel.transform.Find("MessageText").GetComponent <Text>();
        GameObject buttonsPanel = panel.transform.Find("ButtonsPanel").gameObject;

        _modalPanel.yesButton        = buttonsPanel.transform.Find("YesBtn").GetComponent <Button>();
        _modalPanel.noButton         = buttonsPanel.transform.Find("NoBtn").GetComponent <Button>();
        _modalPanel.modalPanelObject = modalPanel.gameObject;

        // Initialize Actions
        _mAcceptChallengeYesAction          = new UnityAction(OnAcceptChallengeYesAction);
        _mIngoreChallengeYesAction          = new UnityAction(OnIgnoreChallengeYesAction);
        _mCurrentPlayChallengeYesAction     = new UnityAction(OnCurrentPlayChallengeYesAction);
        _mRematchChallengeYesAction         = new UnityAction(OnRematchChallengeYesAction);
        _mClearChallengesYesAction          = new UnityAction(OnClearChallengesYesAction);
        _mChallengeAcceptedPlayNowYesAction = new UnityAction(OnChallengeAcceptedPlayNowYesAction);
        _mChallengeNoAction = new UnityAction(OnChallengeNoAction);
    }
Ejemplo n.º 16
0
    public static void CallAlert(ModalPanel modalPanel, CanvasGroup canvasGroup, string alertText, string buttonText, UnityAction callback)
    {
        ShowModal (modalPanel, canvasGroup);

        modalPanel.alertPanel.gameObject.SetActive (true);
        modalPanel.alertPanel.Show (alertText, buttonText, callback);
    }
Ejemplo n.º 17
0
 void Awake()
 {
     modalPanel               = ModalPanel.Instance();
     displayManager           = DisplayManager.Instance();
     inGameUIManagerTimerClue = InGameUIManagerTimerClue.Instance();
     finderController         = FinderController.Instance();
 }
Ejemplo n.º 18
0
	void Start()
	{
		// Caching
		userDatamanager = UserDataManager.ins;
		if (userDatamanager == null)
		{
			Debug.LogError("No UserDataManager?!");
		}
		applicationManager = ApplicationManager.ins;
		if (applicationManager == null)
		{
			Debug.LogError("No ApplicationManager?!");
		}
		courseManager = CourseManager.ins;
		if (courseManager == null)
		{
			Debug.LogError("No CourseManager?!");
		}
		modalPanel = ModalPanel.ins;
		if (modalPanel == null)
		{
			Debug.LogError("No ModalPanel?!");
		}
		courseCompletedOKEvent = new UnityAction(_CourseCompleted);
		courseViewCompletedOKEvent = new UnityAction(_CourseViewContinue);
		courseViewCompletedCancelEvent = new UnityAction(_CourseViewStay);

		audioManager = ASAudioManager.ins;
		if (audioManager == null)
		{
			Debug.LogError("No ASAudioManager?!");
		}
	}
Ejemplo n.º 19
0
    void Start()
    {
        userDataManager = UserDataManager.ins;
        if (userDataManager == null)
        {
            Debug.LogError("No UserDataManager found");
        }
        courseManager = CourseManager.ins;
        if (courseManager == null)
        {
            Debug.LogError("No CourseManager found");
        }

        modalPanel               = ModalPanel.ins;
        yesQuitAction            = new UnityAction(_QuitAndSave);
        noQuitAction             = new UnityAction(_DoNothing);
        yesReloadCourseViewScene = new UnityAction(_ReloadCourseViewScene);
        noReloadCourseViewScene  = new UnityAction(_DoNothing);

        fade = Fade.ins;
        if (fade == null)
        {
            Debug.LogError("No Fade found");
        }
    }
 public void Start()
 {
     _testModal     = new TestModalWindow();
     _visual        = _waypoints.GetComponent <VisualConnections>();
     modalPanel     = ModalPanel.Instance();
     displayManager = DisplayManager.Instance();
 }
Ejemplo n.º 21
0
    public void DeleteProfiles()
    {
        //Confirm that profiles are going to be deleted.
        ModalPanel modalPanel = ModalPanel.Instance();

        modalPanel.Choice("Delete profiles?", ConfirmProfileDeletion, AbortAction);
    }
Ejemplo n.º 22
0
    void Awake()
    {
        modalPanel = ModalPanel.getInstance();

        yesAction = new UnityAction(testYes);
        noAction  = new UnityAction(testNo);
    }
Ejemplo n.º 23
0
    void Start()
    {
        if (title == null)
        {
            Debug.LogError("No title text object referenced");
        }
        if (subject == null)
        {
            Debug.LogError("No subject text object referenced");
        }
        if (explaination == null)
        {
            Debug.LogError("No explaination text object referenced");
        }
        if (codeDesc == null)
        {
            Debug.LogError("No codeDesc object referenced");
        }
        if (descBulletPoint == null)
        {
            Debug.LogError("No descBulletPoint prefab referenced");
        }
        if (examples == null)
        {
            Debug.LogError("No examples object referenced");
        }
        if (codeField == null)
        {
            Debug.LogError("No codeField object referenced");
        }
        if (stepBulletPoint == null)
        {
            Debug.LogError("No stepBulletPoint prefab referenced");
        }
        if (instructions == null)
        {
            Debug.LogError("No instructions object referenced");
        }
        if (goal == null)
        {
            Debug.LogError("No goal object referenced");
        }

        // Modal panel
        modalPanel = ModalPanel.ins;
        if (modalPanel == null)
        {
            Debug.LogError("No modal panel?");
        }
        yesResetCode = new UnityAction(_ResetCode);
        noResetCode  = new UnityAction(_DoNothing);

        // Course manager
        courseManager = CourseManager.ins;
        if (courseManager == null)
        {
            Debug.LogError("No CourseManager?");
        }
        LoadCurrentCourseView();
    }
Ejemplo n.º 24
0
    public void OpenImportOps()
    {
        List <KeyValuePair <string, UnityAction> > importOptions =
            new List <KeyValuePair <string, UnityAction> >();

        GameInterface GI = GameInterface.instance;


        importOptions.Add(new KeyValuePair <string, UnityAction>("JSON Array - Don't use if attackers and defenders share troop types", () => {
            GI.textInputPanel.SetPanelInfo("JSON Text to Import", "insert the JSON string here", "", "Import", () => {
                SerializedTroop[] readTroops = JsonHandlingUtils.JsonToSerializedTroopArray
                                                   (GI.textInputPanel.theInputField.text);
                if (readTroops == null)
                {
                    ModalPanel.Instance().OkBox("Json Import Failed", "Please check your JSON string, it must be something like [{'name':'troop', 'amount':5}]");
                    return;
                }

                TroopList attackersRemaining = new TroopList(),
                defendersRemaining           = new TroopList();

                foreach (SerializedTroop tnp in readTroops)
                {
                    //Debug.Log("got this kvp: " + tnp.name + " : " + tnp.amount);

                    TroopNumberPair convertedTNP = JsonHandlingUtils.SerializedTroopToTroopNumberPair(tnp);
                    if (convertedTNP.troopAmount > 0)
                    {
                        if (battlePhase.battleData.defenderSideInfo.sideArmy.IndexOfTroopInThisList(convertedTNP.troopTypeID) != -1)
                        {
                            defendersRemaining.Add(convertedTNP);
                        }
                        else if (battlePhase.battleData.attackerSideInfo.sideArmy.IndexOfTroopInThisList(convertedTNP.troopTypeID) != -1)
                        {
                            attackersRemaining.Add(convertedTNP);
                        }
                    }
                }

                battlePhase.battleData.defenderSideInfo.SetPostBattleArmyData_RemainingArmy(defendersRemaining);
                battlePhase.battleData.attackerSideInfo.SetPostBattleArmyData_RemainingArmy(attackersRemaining);

                if (!battlePhase.battleData.BattleEndCheck())
                {
                    //we only need to update side info displays if the battle hasn't ended yet,
                    //because the delegate would take care of it otherwise
                    UpdateArmyDisplays();
                }

                GI.textInputPanel.Close();
            });
            GI.textInputPanel.Open();
            GI.exportOpsPanel.gameObject.SetActive(false);
        }));


        //when done preparing options, open the import ops panel
        GI.exportOpsPanel.Open("Remaining Armies: Import Options", importOptions);
    }
Ejemplo n.º 25
0
    void Awake()
    {
        mp = ModalPanel.Instance();

        yeAct   = new UnityAction(TestYesFunc);
        noAct   = new UnityAction(TestNoFunc);
        maybAct = new UnityAction(TestMaybeFunc);
    }
Ejemplo n.º 26
0
    // Use this for initialization
    void Awake()
    {
        modalPanel = ModalPanel.Instance ();

        myButton1Action = new UnityAction (Button1Function);
        myButton2Action = new UnityAction (Button2Function);
        myExitAction = new UnityAction (ExitFunction);
    }
Ejemplo n.º 27
0
    public GameObject salsaRecipe;                                        //assign a gameobject in the editor

    /*Initializes the panel*/
    private void Awake()
    {
        modalPanel = ModalPanel.Instance();                         //set modal panel to a new instance

        myYesAction  = new UnityAction(YesFunction);                //assign the action for Yes
        myNoAction   = new UnityAction(NoFunction);                 //assign the action for No
        myOkayAction = new UnityAction(OkayFunction);               //assign the action for Okay
    }
Ejemplo n.º 28
0
    public static void CallQuestion(ModalPanel modalPanel, CanvasGroup canvasGroup, string question, string yesText, string noText, string cancelText, 
	                                 UnityAction yesCallback, UnityAction noCallback)
    {
        ShowModal (modalPanel, canvasGroup);

        modalPanel.questionPanel.gameObject.SetActive (true);
        modalPanel.questionPanel.Show (question, yesText, noText, cancelText, yesCallback, noCallback);
    }
Ejemplo n.º 29
0
    void Awake()
    {
        Instance = this;

        gameObject.SetActive(false);
        yesButton.gameObject.SetActive(false);
        cancelButton.gameObject.SetActive(false);
    }
Ejemplo n.º 30
0
    private static ModalPanel modalPanel;                       //keep a static reference to this modal panel

    /*This function will return a static instance of the modal panel*/
    public static ModalPanel Instance()
    {
        if (!modalPanel)                                                     //see if the modalPanel instance exists yet
        {
            modalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel; //if not find it and cast it as a ModalPanel
        }
        return(modalPanel);
    }
Ejemplo n.º 31
0
 public static void RemoveListeners()
 {
     if(modalPanel != null) {
         modalPanel.OkButton.onClick.RemoveAllListeners();
         modalPanel.CancelButton.onClick.RemoveAllListeners();
         modalPanel = null;
     }
 }
Ejemplo n.º 32
0
    // Use this for initialization
    public override void Activate()
    {
        modalPanel      = ModalPanel.Instance();
        buildBeforeMove = false;

        button1Action = new UnityAction(BuildBeforeMove);
        button2Action = new UnityAction(base.ExitState);
    }
Ejemplo n.º 33
0
    void Awake()
    {
        Library.initializeGameData();

        modalPanel = ModalPanel.Instance();
        quitAction = new UnityAction(QuitAction);
        logEvent   = new StringEvent();
    }
Ejemplo n.º 34
0
    private void InitAlertBox()
    {
        _modalPanel = ModalPanel.Instance();

        // Initialize Actions
        _mPlayYesAction = new UnityAction(OnPlayYesAction);
        _mPlayNoAction  = new UnityAction(OnPlayNoAction);
    }
    GameObject menu_panel = default;        // Reference to return panel

    private void Awake()
    {
        modal_panel = ModalPanel.Instance();
        // Get the reference to the GameFilesHandler game object
        GameObject game_files = GameObject.FindGameObjectWithTag("GameFiles");

        files_handler = game_files.GetComponent <GameFilesHandler>();
    }
Ejemplo n.º 36
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();

        yesEvent    = new UnityAction(Testbutton1);
        noEvent     = new UnityAction(Testbutton2);
        cancelEvent = new UnityAction(TestCancel);
    }
Ejemplo n.º 37
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();
        //personPanelPrefab = Resources.LoadAssetAtPath<GameObject>("Assets/GroupManagement/Prefabs/PersonListItem.prefab");

        personsListContent = personsListPanel.FindComponentInChildWithTag <RectTransform>("ListViewContent");
        listHeaderText     = personsListPanel.FindComponentInChildWithTag <Text>("ListHeaderText");
    }
Ejemplo n.º 38
0
    private void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        myOkAction   = new UnityAction(TestOkFunction);
        myExitAction = new UnityAction(TestExitFunction);
    }
Ejemplo n.º 39
0
    void Awake()
    {
        hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>();
        hintUIController.toggleHint();

        modalPanel = ModalPanel.Instance();
        entered    = false;
    }
Ejemplo n.º 40
0
    // Use this for initialization
    void Start()
    {
        scream = Resources.Load<AudioClip>("scream");
        breathing = Resources.Load<AudioClip>("rampBreathing2");
        originalAmbientIntensity = RenderSettings.ambientIntensity;

        modalPanel = ModalPanel.Instance();
        endPanel = EndPanel.Instance();
    }
    void Awake()
    {
        modalPanel = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        //myOpt1Action = new UnityAction(TestOpt1);
        //myOpt2Action = new UnityAction(TestOpt2);
        //myOpt3Action = new UnityAction(TestOpt3);
    }
Ejemplo n.º 42
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();
        displayMan = DisplayManager.Instance();

        myYesAction = new UnityAction(TestYesFunc);			//
        myNoAction = new UnityAction(TestNoFunc);			//unityactions are assigned to their respective functions
        myCancelAction = new UnityAction(TestCancelFunc);	//
    }
Ejemplo n.º 43
0
 public static ModalPanel Instance()
 {
     if (!modalPanel) {
         modalPanel = FindObjectOfType(typeof (ModalPanel)) as ModalPanel;
         if (!modalPanel) {
             Debug.LogError ("There needs to be at least one active modalPanel script on a gameobject in this scene");
         }
     }
     return modalPanel;
 }
Ejemplo n.º 44
0
 public static ModalPanel Instance()
 {
     if (!modalPanel) {
         modalPanel = FindObjectOfType<ModalPanel>();
         if (!modalPanel) {
             Debug.LogError("No ModalPanel script attatched to any gameobject in the scene");
         }
     }
     return modalPanel;
 }
Ejemplo n.º 45
0
    //    private UnityAction myResponse1Action;
    //    private UnityAction myResponse2Action;
    //    private UnityAction myResponse3Action;
    void Awake()
    {
        modalPanel = ModalPanel.Instance ();

        database = GameObject.FindGameObjectWithTag ("TalkDatabase").GetComponent<TalkDataBase>(); //********************************

        //	myResponse1Action = new UnityAction (TestResponse1);
        //	myResponse2Action = new UnityAction (TestResponse2);
        //	myResponse3Action = new UnityAction (TestResponse3);
    }
Ejemplo n.º 46
0
    public static ModalPanel Instance()
    {
        if (!modalPanel) {
            modalPanel = FindObjectOfType(typeof (ModalPanel)) as ModalPanel;
            if (!modalPanel)
                Debug.LogError ("There needs to be one active ModalPanel script on a GameObject in your scene.");
        }

        return modalPanel;
    }
Ejemplo n.º 47
0
    IEnumerator Wait()
    {
        while (!flag) yield return new WaitForSeconds (0.2f);

        if (cancelObject != null) {
            ClosePanel ();
            cancelObject = null;
        }

        if (callback != null) callback ();
    }
Ejemplo n.º 48
0
    public void Show(string messageText, UnityAction callback)
    {
        cancelObject = this.modalPanel;
        flag = false;
        LoadingDialog.callback = callback;

        this.gameObject.SetActive (true);
        this.messageText.text = messageText;

        StartCoroutine (Wait ());
    }
Ejemplo n.º 49
0
    private bool activo; //Esto es para controlar cuando el panel esta activo

    #endregion Fields

    #region Methods

    //Constructor
    public static ModalPanel Instance()
    {
        if (!modalPanel)
        {
            modalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
            if (!modalPanel)
                Debug.LogError("No hay paneles en tu escena.");
        }

        return modalPanel;
    }
Ejemplo n.º 50
0
	public static ModalPanel Instance(){
		if(!modalPanel){
			modalPanel =FindObjectOfType(typeof (ModalPanel)) as ModalPanel;
			//maybe I could use two instances methods- or one that gets two parameters
			//they will find a component in the child of the object, indicating if it's an npc attached component
			//also this method will sort through all of the conversation windows
		}
		if(!modalPanel)
			Debug.LogError ("There needs to be one active ModalPanel script on a GameObject in my scene");
	return modalPanel;
	}
Ejemplo n.º 51
0
    public static ModalPanel Instance()
    {
        //Check if we already have a ModalPanel instance. If not, make this the current modalPanel instance.
        if (!modalPanel) {
            modalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
            if(!modalPanel){
                Debug.LogError("No quest panel found. Create one with 'ModalPanel.cs' attached");
            }
        }

        return modalPanel;
    }
Ejemplo n.º 52
0
 //ModalPanel의 유무확인(?)
 public static ModalPanel Instace()
 {
     if (!modalpanel)
     {
         modalpanel = FindObjectOfType(typeof (ModalPanel)) as ModalPanel;
         if(!modalpanel)
         {
             Debug.Log("ModalPanel need");
         }
     }
     return modalpanel;
 }
Ejemplo n.º 53
0
 public static ModalPanel Instance()
 {
     if (!modalPanel)
     {
         gGameData = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
         //modalPanel = new ModalPanel();
         modalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
         if (!modalPanel)
             Debug.LogError("There needs to be one active ModalPanel script on a GameObject in your scene.");
     }
     return modalPanel;
 }
Ejemplo n.º 54
0
 // Use this for initialization
 void Awake()
 {
     modalPanel = ModalPanel.Instance();
     endPanel = EndPanel.Instance();
     lampOnSound = Resources.Load<AudioClip>("lampOn");
     lampOffSound = Resources.Load<AudioClip>("lampOff");
     doorLockedSound = Resources.Load<AudioClip>("doorLocked");
     itemPickupSound = Resources.Load<AudioClip>("itemPickup");
     keyPickupSound = Resources.Load<AudioClip>("keyPickup1");
     knifePickupSound = Resources.Load<AudioClip>("knifePickup1");
     singleBreathSound1 = Resources.Load<AudioClip>("singleBreath1");
     singleBreathSound2 = Resources.Load<AudioClip>("singleBreath2");
 }
Ejemplo n.º 55
0
    //Use this on Awake
    public static void Configure(ModalPanel modalPanel)
    {
        modalPanel.gameObject.SetActive (false);
        modalPanel.alertPanel.gameObject.SetActive (false);
        modalPanel.questionPanel.gameObject.SetActive (false);
        modalPanel.loadingPanel.gameObject.SetActive (false);
        modalPanel.closePanel.gameObject.SetActive (false);

        if (modalPanel.genericPanels != null && modalPanel.genericPanels.Count > 0)
            foreach (GenericPanel gp in modalPanel.genericPanels)
                if (gp != null)
                    gp.gameObject.SetActive (false);
    }
Ejemplo n.º 56
0
    /*
     * Constructor de instancias, para que otros
     * scripts puedan acceder a este.
     */
    public static ModalPanel Instance()
    {
        //Si no es creado el objeto estatico
        if (!mPanel)
        {
            mPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
            //Si no ha sido creado, aviso.
            if (!mPanel)
                Debug.LogError("No hay paneles en tu escena.");
        }

        return mPanel;
    }
Ejemplo n.º 57
0
	void Awake()
	{
		if (_ins == null)
		{
			// Populate with first instance
			_ins = this;
			DontDestroyOnLoad(this);
		}
		else
		{
			// Another instance exists, destroy
			if (this != _ins)
				Destroy(this.gameObject);
		}
	}
Ejemplo n.º 58
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance ();

        myButton1Action = new UnityAction (TestButton1Function);
        myButton2Action = new UnityAction (TestButton2Function);
        myExitAction = new UnityAction (TestExitFunction);

        //read in dialogue from text file into string array
        if (textFile != null) {
            textLines = (textFile.text.Split ('\n'));
        }

        currentLine = beginDialogueLine;
    }
Ejemplo n.º 59
0
    public static void CallGenericPanel(ModalPanel modalPanel, CanvasGroup canvasGroup, string panelName)
    {
        if (modalPanel.genericPanels == null)
            Debug.LogError ("Generic Panel is null!");

        ShowModal (modalPanel, canvasGroup);

        //Fetch the properly named generic panel and show it
        if (modalPanel.genericPanels != null && modalPanel.genericPanels.Count > 0) {
            foreach (GenericPanel gp in modalPanel.genericPanels) {
                if (gp != null && gp.gameObject.name.Equals (panelName))
                    gp.Show ();
            }
        }
    }
Ejemplo n.º 60
0
    private static ModalPanel staticModalPanel; //a private and static reference to the ModalPanel

    #endregion Fields

    #region Methods

    //you'll reference this singleton when you want access to this script, this is an instance of the above variable
    public static ModalPanel Instance()
    {
        //if the modal panel exists in the game...
        if (!staticModalPanel)
        {
            //...then locate it
            staticModalPanel = FindObjectOfType(typeof (ModalPanel)) as ModalPanel;

            //and this checks again, there must be one, and only one
            if (!staticModalPanel)
            {
                Debug.LogError("There needs to be one active ModalPanel script on a GameObject in the scene");
            }
        }
        return staticModalPanel;
    }