Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 private void DisplayInGame()
 {
     if (World.Dimensions.Count > 0)
     {
         if (!BoundHandler.GUIWindows.Contains(InGameGUI.InGame))
         {
             InGameGUI.Initialize();
         }
     }
 }
Ejemplo n.º 2
0
 private void JoinButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
 {
     World.Mode = MagicalLifeAPI.Networking.EngineMode.ClientOnly;
     FMODUtil.RaiseEvent(SoundsTable.UIClick);
     ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(JoinGameMenu.Menu.IpInputBox.Text, int.Parse(JoinGameMenu.Menu.PortInputBox.Text)));
     Client.Load();
     MenuHandler.Clear();
     InGameGUI.Initialize();
     BoundHandler.Popup(InGameGUI.InGame);
 }
Ejemplo n.º 3
0
 public override void Click(MouseEventArgs e, GUIContainer container)
 {
     World.Mode = MagicalLifeAPI.Networking.EngineMode.ClientOnly;
     FMODUtil.RaiseEvent(EffectsTable.UIClick);
     ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(JoinGameMenu.menu.IpInputBox.Text, int.Parse(JoinGameMenu.menu.PortInputBox.Text)));
     Client.Load();
     MenuHandler.Clear();
     InGameGUI.Initialize();
     BoundHandler.Popup(InGameGUI.InGame);
 }
    void Start()
    {
        sceneManager = GameObject.Find("SceneManager").GetComponent <SceneManager>();

                #if UNITY_ANDROID
        inGameGUI = GetComponent <InGameAndroidGUI>();
        inGameGUI.createButtons(buttonPrefab, jump, attack);
                #endif

                #if UNITY_STANDALONE_WIN || UNITY_WEBPLAYER
        inGameGUI = GetComponent <InGameGUI>();
                #endif
    }
    void Start()
    {
        sceneManager = GameObject.Find("SceneManager").GetComponent<SceneManager>();

        #if UNITY_ANDROID
            inGameGUI = GetComponent<InGameAndroidGUI>();
            inGameGUI.createButtons(buttonPrefab, jump, attack);

        #endif

        #if UNITY_STANDALONE_WIN || UNITY_WEBPLAYER
            inGameGUI = GetComponent<InGameGUI>();
        #endif
    }
Ejemplo n.º 6
0
    private void Start()
    {
        networkManager = new NetworkManager();
        networkManager.init(this);

        viewManager = u_ViewManager.GetComponent <ViewManager>();

        preGameGUI = u_PreGameMgr.GetComponent <PreGameGUI>();
        InGameGUI  = u_InGameMgr.GetComponent <InGameGUI>();
        InGameGUI.Start();
        u_InGameMgr.SetActive(false);

        CameraFollow = mainCamera.GetComponent <CameraFollow>();
        CameraFollow.bind_Game(this);
    }
Ejemplo n.º 7
0
        public override void Click(MouseEventArgs e, GUIContainer container)
        {
            World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
            Server.Load();
            ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings());
            FMODUtil.RaiseEvent(EffectsTable.UIClick);
            ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings());
            Client.Load();
            NewGameInputHandler a = new NewGameInputHandler();

            a.StartNewGame();
            Server.StartGame();
            BoundHandler.RemoveContainer(NewWorldMenu.NewWorldMenuM);
            MenuHandler.Clear();
            BoundHandler.HideAll();
            InGameGUI.Initialize();
            BoundHandler.Popup(InGameGUI.InGame);
        }
Ejemplo n.º 8
0
        private void NewWorldNextButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
        {
            World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
            Server.Load();
            ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
            FMODUtil.RaiseEvent(SoundsTable.UIClick);
            //FMODUtil.RaiseEvent(SoundsTable.Ambience);
            ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
            Client.Load();
            NewGameInputHandler a = new NewGameInputHandler();

            a.StartNewGame();
            Server.StartGame();
            RenderInfo.Camera2D.InitializeForDimension(0);
            BoundHandler.RemoveContainer(NewWorldMenu.NewWorldMenuM);
            MenuHandler.Clear();
            BoundHandler.HideAll();
            InGameGUI.Initialize();
            BoundHandler.Popup(InGameGUI.InGame);
        }
Ejemplo n.º 9
0
        public override void Click(MouseEventArgs e, GUIContainer container)
        {
            int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex;

            if (selected != -1)
            {
                FMODUtil.RaiseEvent(SoundsTable.UIClick);
                World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
                RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected];
                WorldStorage.LoadWorld(selectedItem.Text);

                Server.Load();
                ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                Client.Load();
                Server.StartGame();
                BoundHandler.RemoveContainer(LoadGameMenu.Menu);
                MenuHandler.Clear();
                BoundHandler.HideAll();
                InGameGUI.Initialize();
                BoundHandler.Popup(InGameGUI.InGame);
            }
        }
Ejemplo n.º 10
0
        private void LoadSaveButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
        {
            int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex;

            if (selected != -1)
            {
                FMODUtil.RaiseEvent(SoundsTable.UIClick);
                World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
                RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected];
                WorldStorage.LoadWorld(selectedItem.Text);

                Server.Load();
                ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                Client.Load();
                Server.StartGame();
                BoundHandler.RemoveContainer(LoadGameMenu.Menu);
                MenuHandler.Clear();
                BoundHandler.HideAll();
                InGameGUI.Initialize();
                BoundHandler.Popup(InGameGUI.InGame);
                RenderInfo.Camera2D.InitializeForDimension(0);
            }
        }
Ejemplo n.º 11
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 12
0
    public override void Start()
    {
        base.Start();

        _inGameGUI = transform.parent.GetComponent <InGameGUI>();
    }
Ejemplo n.º 13
0
 void Update()
 {
     if( isInGame && gameGUI == null )
     {
         Debug.Log ("finding attachingGUI");
         gameGUI = GameObject.Find ("attachingGUI").GetComponent<InGameGUI>();
         unitManager = GameObject.Find ("UnitManager").GetComponent<UnitManager> ();
         Debug.Log (gameGUI);
     }
 }
Ejemplo n.º 14
0
 private void Awake()
 {
     player   = FindObjectOfType <PlayerController>();
     Instance = this;
 }
Ejemplo n.º 15
0
 // Use this for initialization
 void Start()
 {
     villageManager = GameObject.Find ("VillageManager").GetComponent<VillageManager>();
     tileManager = GameObject.Find ("TileManager").GetComponent<TileManager> ();
     gameGUI = GameObject.Find ("attachingGUI").GetComponent<InGameGUI>();
 }
Ejemplo n.º 16
0
    private void SetupTutorial()
    {
        this.m_playing = true;
        InGameGUI inGameGUI = WPFMonoBehaviour.levelManager.InGameGUI;

        this.m_partselector   = inGameGUI.BuildMenu.PartSelector;
        this.m_constructionUI = WPFMonoBehaviour.levelManager.ConstructionUI;
        GameObject tutorialButton = inGameGUI.BuildMenu.TutorialButton;
        GameObject playButton     = inGameGUI.BuildMenu.PlayButton;

        if (this.m_constructionUI == null)
        {
            return;
        }
        this.m_tutorialTimeline = new PointerTimeLine(this.m_pointer);
        List <Vector3> list = new List <Vector3>();

        list.Add(tutorialButton.transform.position + 21f * Vector3.down);
        list.Add(tutorialButton.transform.position);
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Wait(0.1f));
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Move(list, 2.5f));
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Press());
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Release());
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Wait(0.75f));
        this.m_tutorialTimeline.AddEvent(new PointerTimeLine.Hide());
        this.m_dragPartTimeline = new PointerTimeLine(this.m_pointer);
        ConstructionUI.PartDesc partDesc = this.m_constructionUI.FindPartDesc(BasePart.PartType.WoodenFrame);
        GameObject     gameObject        = this.m_partselector.FindPartButton(partDesc);
        Vector3        position          = gameObject.transform.position;
        Vector3        vector            = this.m_constructionUI.GridPositionToGuiPosition(this.m_dragTargetX, this.m_dragTargetY);
        List <Vector3> list2             = new List <Vector3>();

        list2.Add(position + 3f * Vector3.down + 1f * Vector3.left);
        list2.Add(position);
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Move(list2, 1.5f));
        List <Vector3> list3 = new List <Vector3>();

        list3.Add(position);
        list3.Add(0.5f * (position + vector) + 0.5f * Vector3.left);
        list3.Add(vector);
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Press());
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Move(list3, 1.75f));
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Wait(0.2f));
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Release());
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Hide());
        this.m_dragPartTimeline.AddEvent(new PointerTimeLine.Wait(2f));
        ConstructionUI.PartDesc partDesc2 = this.m_constructionUI.FindPartDesc(BasePart.PartType.Pig);
        GameObject gameObject2            = this.m_partselector.FindPartButton(partDesc2);
        Vector3    position2 = gameObject2.transform.position;
        Vector3    vector2   = this.m_constructionUI.GridPositionToGuiPosition(this.m_pigTargetX, this.m_pigTargetY);

        this.m_dragPigTimeline = new PointerTimeLine(this.m_pointer);
        List <Vector3> list4 = new List <Vector3>();

        list4.Add(position2 + 3f * Vector3.down + 1f * Vector3.left);
        list4.Add(position2);
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Move(list4, 1.5f));
        List <Vector3> list5 = new List <Vector3>();

        list5.Add(position2);
        list5.Add(0.5f * (position2 + vector2) + 0.5f * Vector3.left);
        list5.Add(vector2);
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Press());
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Move(list5, 1.75f));
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Wait(0.2f));
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Release());
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Hide());
        this.m_dragPigTimeline.AddEvent(new PointerTimeLine.Wait(2f));
        this.m_startContraptionTimeline = new PointerTimeLine(this.m_pointer);
        List <Vector3> list6 = new List <Vector3>();

        list6.Add(playButton.transform.position + 11f * Vector3.down);
        list6.Add(playButton.transform.position + 5.5f * Vector3.down + 0.5f * Vector3.left);
        list6.Add(playButton.transform.position);
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Wait(1f));
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Move(list6, 2f));
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Press());
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Wait(0.5f));
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Release());
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Wait(0.75f));
        this.m_startContraptionTimeline.AddEvent(new PointerTimeLine.Hide());
        if (!this.m_tutorialBookOpened)
        {
            this.m_state    = Tutorial.State.OpenBook;
            this.m_timeline = this.m_tutorialTimeline;
            this.m_timeline.Start();
        }
        else if (WPFMonoBehaviour.levelManager.ContraptionProto.Parts.Count == 0)
        {
            this.m_state    = Tutorial.State.DragPart;
            this.m_timeline = this.m_dragPartTimeline;
            this.m_timeline.Start();
        }
        else if (!this.m_contraptionStarted)
        {
            this.m_state    = Tutorial.State.StartContraption;
            this.m_timeline = this.m_startContraptionTimeline;
            this.m_timeline.Start();
        }
        else
        {
            this.m_playing = false;
        }
        this.m_setupCompleted = true;
    }
Ejemplo n.º 17
0
 // Update is called once per frame
 void Update()
 {
     if( isInGame && (gameGUI == null) )
     {
         Debug.Log ("finding attaching GUI");
         gameGUI = GameObject.Find ("attachingGUI").GetComponent<InGameGUI>();
         Debug.Log (gameGUI);
     }
     if (printList) {
         print (localPlayer.getName ());
         printList = false;
     }
 }
 void Start()
 {
     Instance = this;
 }
Ejemplo n.º 19
0
 public void bind_InGameMgr(GameObject InGameMgr)
 {
     this.InGameMgr = InGameMgr;
     InGameGUI      = InGameMgr.GetComponent <InGameGUI>();
 }
Ejemplo n.º 20
0
 public void bind_InGameGUI(InGameGUI inGameGUI)
 {
     this.InGameGUI = inGameGUI;
 }