コード例 #1
0
 public void OnEndDrag(PointerEventData eventData)
 {
     if (SceneManager.GetActiveScene().name == "Level_Tuto" && TutoManager.Instance().ReturnDemand())
     {
         TutoManager.Instance().RequestDone();
     }
 }
コード例 #2
0
ファイル: TutoManager.cs プロジェクト: Mangiang/cody-cat
 private void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
     }
 }
コード例 #3
0
        public void Message_fct()
        {
            GameManager.Instance.AllKeepersList[0].GetComponent <Inventory>().SelectedInventoryPanel.gameObject.SetActive(true); // Inventory

            if (feedback == null)
            {
                feedback = Instantiate(TutoManager.s_instance.uiPointer, GameManager.Instance.Ui.transform.GetChild(0));
                feedback.GetComponent <FlecheQuiBouge>().PointToPoint   = GameManager.Instance.AllKeepersList[0].GetComponent <Inventory>().SelectedInventoryPanel.transform.position + Vector3.up * (100 * (Screen.height / 1080.0f));
                feedback.GetComponent <FlecheQuiBouge>().distanceOffset = 250.0f;

                feedback.transform.localEulerAngles = new Vector3(0, 0, 90);
            }

            if (feedbackCircle == null)
            {
                feedbackCircle = Instantiate(GameManager.Instance.PrefabUIUtils.PrefabImageUI);
                feedbackCircle.transform.SetParent(GameManager.Instance.AllKeepersList[0].GetComponent <Inventory>().SelectedInventoryPanel.transform.GetChild(0).GetChild(0));
                feedbackCircle.transform.localPosition       = Vector3.zero;
                feedbackCircle.transform.localScale          = Vector3.one * 2.0f;
                feedbackCircle.GetComponent <Image>().sprite = GameManager.Instance.SpriteUtils.spriteTutoCircleFeedback;
                feedbackCircle.AddComponent <ThrowDiceButtonFeedback>();
            }

            TutoManager.s_instance.EcrireMessage(str);
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.WaitingForClickUI;
            TutoManager.EnablePreviousButton(false);
        }
コード例 #4
0
ファイル: SeqTutoCombat.cs プロジェクト: transkuja/keepers
        public void Message_fct()
        {
            SeqTutoCombat seqTutoCombat = TutoManager.s_instance.GetComponent <SeqTutoCombat>();
            Button        skillButton   = seqTutoCombat.skillPanel.GetComponentInChildren <Button>();

            skillButton.interactable = true;

            if (feedback == null)
            {
                feedback = Instantiate(TutoManager.s_instance.uiPointer, GameManager.Instance.Ui.transform.GetChild(0));
                feedback.GetComponent <FlecheQuiBouge>().PointToPoint   = seqTutoCombat.skillPanel.transform.GetChild(0).GetChild(0).position;
                feedback.GetComponent <FlecheQuiBouge>().distanceOffset = 40.0f;

                feedback.transform.localEulerAngles = new Vector3(0, 0, -60);
            }

            if (skillButton.gameObject.GetComponent <MouseClickExpected>() == null)
            {
                skillButton.gameObject.AddComponent <MouseClickExpected>();
            }

            Behaviour.Monster monster = BattleHandler.CurrentBattleKeepers[0].CurrentTile.GetComponentInChildren <Behaviour.Monster>();
            if (monster.gameObject.GetComponent <MouseClickedOnIngameElt>() == null)
            {
                monster.gameObject.AddComponent <MouseClickedOnIngameElt>();
            }

            TutoManager.s_instance.EcrireMessage(str);
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.WaitingForSkillUse;
            TutoManager.EnablePreviousButton(false);
        }
コード例 #5
0
ファイル: TutoManager.cs プロジェクト: transkuja/keepers
 private void Awake()
 {
     if (s_instance == null)
     {
         s_instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #6
0
ファイル: TutoManager.cs プロジェクト: malobil/Projet-mobile
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }

        else

        {
            instance = this;
        }
    }
コード例 #7
0
    public void OnDrop(PointerEventData eventData)
    {
        if (eventData.pointerDrag.gameObject.GetComponent <Formes_Et_Ingredients>() != null)
        {
            breakAudioSource.Play();
            Debug.Log(eventData.pointerDrag.name);
            if (TutoRecipeManager.Instance() != null && TutoRecipeManager.Instance().ReturnDemand())
            {
                if (TutoRecipeManager.Instance().ReturnState() <= 4)
                {
                    //LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject) ;
                    //LevelManager.Instance().UnpopObject() ;
                    Debug.Log("Tuto destroy");
                    LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject);
                    LevelManager.Instance().PopParticularObject(1);
                    //Destroy(eventData.pointerDrag.gameObject) ;
                }
                else if (TutoRecipeManager.Instance().ReturnState() == 6)
                {
                    Debug.Log("Tuto destroy");
                    LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject);
                    LevelManager.Instance().PopParticularObject(0);
                }
            }
            else
            {
                LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject);
            }
        }

        if (SceneManager.GetActiveScene().name == "Level_Tuto" && TutoManager.Instance().ReturnDemand())
        {
            //TutoManager.Instance().RequestDone() ;
            if (TutoManager.Instance().ReturnState() == 3)
            {
                //LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject) ;
                //LevelManager.Instance().UnpopObject() ;
                Debug.Log("Tuto destroy");
                LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject);
                LevelManager.Instance().PopParticularObject(1);
                //Destroy(eventData.pointerDrag.gameObject) ;
            }
            else if (TutoManager.Instance().ReturnState() == 5)
            {
                Debug.Log("Tuto destroy");
                LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject);
                LevelManager.Instance().PopParticularObject(0);
            }
        }
    }
コード例 #8
0
ファイル: SeqTutoCombat.cs プロジェクト: transkuja/keepers
        public void Message_fct()
        {
            // Give back the character his skills
            BattleHandler.CurrentBattleKeepers[0].GetComponent <GlowObjectCmd>().ActivateBlinkBehaviour(false);
            BattleHandler.CurrentBattleKeepers[0].GetComponent <Behaviour.Fighter>().BattleSkills.Clear();
            BattleHandler.CurrentBattleKeepers[0].GetComponent <Behaviour.Fighter>().BattleSkills = TutoManager.s_instance.GetComponent <SeqTutoCombat>().previousCharacterSkills;
            GameManager.Instance.GetBattleUI.GetComponent <UIBattleHandler>().TutoReloadSkillPanel(BattleHandler.CurrentBattleKeepers[0]);


            TutoManager.s_instance.EcrireMessage(str);
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.WaitingForExternalEvent;
            TutoManager.EnablePreviousButton(false);
            TutoManager.EnableNextButton(true);
        }
コード例 #9
0
 public override void End()
 {
     base.End();
     if (pawnMrResetti != null)
     {
         TutoManager.UnSpawn(pawnMrResetti);
     }
     if (TutoManager.s_instance.TutoPanelInstance != null)
     {
         Destroy(TutoManager.s_instance.TutoPanelInstance);
     }
     TutoManager.s_instance.GetComponent <SeqLowHunger>().AlreadyPlayed = true;
     TutoManager.s_instance.PlayingSequence = null;
 }
コード例 #10
0
 public override void End()
 {
     base.End();
     selectedKeepersPanel.SetActive(true);
     if (pawnMrResetti != null)
     {
         TutoManager.UnSpawn(pawnMrResetti);
     }
     if (TutoManager.s_instance.TutoPanelInstance != null)
     {
         Destroy(TutoManager.s_instance.TutoPanelInstance);
     }
     TutoManager.s_instance.GetComponent <SeqFirstMove>().AlreadyPlayed = true;
     TutoManager.s_instance.PlayingSequence = null;
 }
コード例 #11
0
ファイル: seqTeamCrocket.cs プロジェクト: transkuja/keepers
        public void Message_fct()
        {
            EcrireMessage(speaker.GetComponent <PawnInstance>().Data.AssociatedSprite, str);

            TutoManager.EnableNextButton();
            if (TutoManager.s_instance.PlayingSequence.isPreviousStepReachable())
            {
                TutoManager.EnablePreviousButton();
            }
            else
            {
                TutoManager.EnablePreviousButton(false);
            }
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.Idle;
            return;
        }
コード例 #12
0
ファイル: seqTeamCrocket.cs プロジェクト: transkuja/keepers
        public void SeDeplacer_fct()
        {
            speaker.GetComponent <Behaviour.AnimatedPawn>();

            TutoManager.EnableNextButton();
            if (TutoManager.s_instance.PlayingSequence.isPreviousStepReachable())
            {
                TutoManager.EnablePreviousButton();
            }
            else
            {
                TutoManager.EnablePreviousButton(false);
            }
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.Idle;
            return;
        }
コード例 #13
0
ファイル: SeqTutoCombat.cs プロジェクト: transkuja/keepers
        public void Message_fct()
        {
            SeqTutoCombat seqTutoCombat = TutoManager.s_instance.GetComponent <SeqTutoCombat>();
            Button        rdButton      = seqTutoCombat.rollDiceButton.GetComponentInChildren <Button>();

            if (rdButton.gameObject.GetComponent <MouseClickExpected>() == null)
            {
                rdButton.gameObject.AddComponent <MouseClickExpected>();
            }
            rdButton.GetComponent <ThrowDiceButtonFeedback>().enabled = true;
            rdButton.interactable = true;

            rdButton.transform.parent.SetParent(GameManager.Instance.Ui.transform.GetChild(0));

            TutoManager.s_instance.EcrireMessage(str);
            TutoManager.s_instance.PlayingSequence.CurrentState = SequenceState.WaitingForClickUI;
            TutoManager.EnablePreviousButton(false);
        }
コード例 #14
0
 public override void End()
 {
     base.End();
     if (pawnMrResetti != null)
     {
         TutoManager.UnSpawn(pawnMrResetti);
     }
     if (TutoManager.s_instance.TutoPanelInstance != null)
     {
         Destroy(TutoManager.s_instance.TutoPanelInstance);
     }
     if (TutoManager.s_instance.waitForFeedSlotAppearance)
     {
         TutoManager.s_instance.GetComponent <SeqAshleyLowHunger>().position = -1;
     }
     TutoManager.s_instance.GetComponent <SeqAshleyLowHunger>().AlreadyPlayed = !TutoManager.s_instance.waitForFeedSlotAppearance;
     TutoManager.s_instance.PlayingSequence = null;
 }
コード例 #15
0
    private void Awake()
    {
        INSTANCE = this;

        conditionsByStep.Add(msgStart, () => GameManager.INSTANCE.isStarted);
        conditionsByStep.Add(msgFood, () => harvests > 0);
        conditionsByStep.Add(msgMove, () => dstMoved > 10);
        conditionsByStep.Add(msgMoveIslands, () => islandDstMoved > 5);
        conditionsByStep.Add(msgConnectIslands, () => islandsConnected > 0);
        conditionsByStep.Add(msgFindIslands, () => dstMoved > 20);

        steps.Add(msgStart);
        steps.Add(msgFood);
        steps.Add(msgMove);
        steps.Add(msgMoveIslands);
        steps.Add(msgConnectIslands);
        steps.Add(msgFindIslands);
    }
コード例 #16
0
    public override void End()

    {
        base.End();

        if (pawnMrResetti != null)
        {
            TutoManager.UnSpawn(pawnMrResetti);
        }

        if (TutoManager.s_instance.TutoPanelInstance != null)
        {
            Destroy(TutoManager.s_instance.TutoPanelInstance);
        }



        for (int i = 0; i < GameManager.Instance.AllKeepersList.Count; i++)

        {
            if (GameManager.Instance.AllKeepersList[i].GetComponent <Behaviour.MentalHealthHandler>() != null)
            {
                GameManager.Instance.AllKeepersList[i].GetComponent <Behaviour.MentalHealthHandler>().SelectedMentalHealthUI.SetActive(true);
            }
        }


        if (isLaunchedDuringASnowEvent)
        {
            foreach (PawnInstance pi in TileManager.Instance.KeepersOnTile[GameManager.Instance.ActiveTile])
            {
                if (pi.GetComponent <Behaviour.MentalHealthHandler>() != null)
                {
                    pi.GetComponent <Behaviour.MentalHealthHandler>().CurrentMentalHealth -= 5;
                }
            }
        }

        EventManager.HandleWeather();
        TutoManager.s_instance.GetComponent <SeqMoraleExplained>().AlreadyPlayed = true;
        TutoManager.s_instance.PlayingSequence = null;
    }
コード例 #17
0
    public override void End()
    {
        base.End();
        GameManager.Instance.AllKeepersList[0].GetComponent <Behaviour.Keeper>().BtnLeft.GetComponent <Button>().interactable  = true;
        GameManager.Instance.AllKeepersList[0].GetComponent <Behaviour.Keeper>().BtnRight.GetComponent <Button>().interactable = true;
        for (int i = 0; i < GameManager.Instance.AllKeepersList.Count; i++)
        {
            GameManager.Instance.AllKeepersList[i].GetComponent <GlowObjectCmd>().ActivateBlinkBehaviour(false);
        }

        if (pawnMrResetti != null)
        {
            TutoManager.UnSpawn(pawnMrResetti);
        }
        if (TutoManager.s_instance.TutoPanelInstance != null)
        {
            Destroy(TutoManager.s_instance.TutoPanelInstance);
        }
        TutoManager.s_instance.GetComponent <SeqMultiCharacters>().AlreadyPlayed = true;
        TutoManager.s_instance.PlayingSequence = null;
    }
コード例 #18
0
 public override void End()
 {
     base.End();
     if (pawnMrResetti != null)
     {
         TutoManager.UnSpawn(pawnMrResetti);
     }
     if (TutoManager.s_instance.TutoPanelInstance != null)
     {
         Destroy(TutoManager.s_instance.TutoPanelInstance);
     }
     TutoManager.s_instance.GetComponent <SeqAshleyEscort>().AlreadyPlayed = true;
     TutoManager.s_instance.PlayingSequence = null;
     if (GameManager.Instance.Ui.goConfirmationPanel.activeSelf)
     {
         foreach (Button b in GameManager.Instance.Ui.goConfirmationPanel.GetComponentsInChildren <Button>())
         {
             b.interactable = true;
         }
     }
 }
コード例 #19
0
 // Use this for initialization
 void Start()
 {
     tutoMan = GetComponentInParent <TutoManager> ();
 }
コード例 #20
0
 void Awake()
 {
     instance = this;
     SceneManager.sceneLoaded   += OnSceneLoaded;
     SceneManager.sceneUnloaded += OnSceneUnloaded;
 }
コード例 #21
0
    public List <Bubble> bubbles; //bool to know if the next bubble is to be printed now or after

    private void Start()
    {
        _instance = this;
        Next();
    }