void SetupMySide()
 {
     foreach (var ele in playerInven.field)
     {
         if (transform.parent.gameObject == ele.champion)
         {
             mySide    = MySide.PLAYER;
             enemyList = computerInven.field;
             unit      = playerInven.FindChampFromInstance(unitObj);
             unit.VisibleHpBar(true);
             unit.hpBar.color      = Color.green;
             unit.hpBar.fillAmount = 1.0f;
             break;
         }
     }
     foreach (var ele in computerInven.field)
     {
         if (transform.parent.gameObject == ele.champion)
         {
             mySide    = MySide.COMPUTER;
             enemyList = playerInven.field;
             unit      = computerInven.FindChampFromInstance(unitObj);
             unit.VisibleHpBar(true);
             unit.hpBar.color      = Color.red;
             unit.hpBar.fillAmount = 1.0f;
             break;
         }
     }
 }
    public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
    {
        StartLan = true;
        MySide newplayer = Instantiate <MySide>(myside);

        DontDestroyOnLoad(newplayer);
        NetworkServer.AddPlayerForConnection(conn, newplayer.gameObject, playerControllerId);
        if (conn.playerControllers[0].unetView.isServer)
        {
            inhost = true;
        }
        else
        {
            inhost = false;
        }
    }
Esempio n. 3
0
    public void ConnectPlayerServer(MySide myplayer)
    {
        connections.Add(myplayer);
        if (NetworkServer.active)
        {
            for (int i = 0; i < connections.Count; i++)
            {
                connections[i].ViewId(i);
            }
        }
        string sceneName = SceneManager.GetActiveScene().name;

        if (sceneName == netside.onlineScene)
        {
        }
    }
Esempio n. 4
0
        void btClick(object sender, EventArgs e)
        {
            Button tmp = (Button)sender;

            switch (tmp.Name)
            {
            case "btUp":
            {
                Y   -= 5;
                last = MySide.Up;
            }
            break;

            case "btDown":
            {
                Y   += 5;
                last = MySide.Down;
            }
            break;

            case "btRight":
            {
                X   += 5;
                last = MySide.Right;
            }
            break;

            case "btLeft":
            {
                X   -= 5;
                last = MySide.Left;
            }
            break;
            }
            if (checkWarning.CheckState == CheckState.Checked)
            {
                Check();
            }
            else
            {
                Fgcolor = "green.jpg";
            }
            if (checkTeleport.CheckState == CheckState.Checked)
            {
                Telepo();
            }
            else if (checkTeleport.CheckState == CheckState.Unchecked || checkTeleport.CheckState == CheckState.Indeterminate)
            {
                Stena();
            }
            if (checkMove.CheckState == CheckState.Checked)
            {
                auto.Start();
            }
            else
            {
                auto.Stop();
            }

            panelObj.BackgroundImage = Image.FromFile(puth + Fgcolor);
            panelObj.Location        = new Point(X, Y);
        }
Esempio n. 5
0
        void btClick(object sender, EventArgs e)
        {
            Button tmp = (Button)sender;
            switch (tmp.Name)
            {
                case "btUp":
                    {
                        Y -= 5;
                        last=MySide.Up;
                    }
                    break;
                case "btDown":
                    {
                        Y += 5;
                        last = MySide.Down;
                    }
                    break;
                case "btRight":
                    {
                        X += 5;
                        last = MySide.Right;
                    }
                    break;
                case "btLeft":
                    {
                        X -= 5;
                        last = MySide.Left;
                    }
                    break;

            }
            if (checkWarning.CheckState == CheckState.Checked)
                Check();
            else
                Fgcolor = "green.jpg";
            if (checkTeleport.CheckState == CheckState.Checked)
                Telepo();
            else if(checkTeleport.CheckState == CheckState.Unchecked || checkTeleport.CheckState == CheckState.Indeterminate)
                Stena();
            if (checkMove.CheckState == CheckState.Checked)
                auto.Start();
            else
                auto.Stop();

            panelObj.BackgroundImage = Image.FromFile(puth + Fgcolor);
            panelObj.Location = new Point(X, Y);
        }