Exemplo n.º 1
0
    public void Btn_Go()
    {
        player_Info[] data = new player_Info[player];
        for (int i = 0; i < player; i++)
        {
            data[i] = select.transform.GetChild(i).GetComponent <PlayerSelect>().Data;
        }
        Info info = new Info(player, data);

        SceneManager.LoadScene(1);
    }
Exemplo n.º 2
0
    private void Start()
    {
        data = new player_Info(0, new Color(0, 0, 0), 0);
        string name = this.transform.GetChild(0).GetComponent <Text>().text;

        char[] ID = name.Substring(name.Length - 1).ToCharArray();
        data.Player_ID = ID[0] - 49;
        character      = this.transform.GetChild(1).GetComponentInChildren <RawImage>();
        r = this.transform.GetChild(1).GetChild(1).GetComponent <Slider>();
        g = this.transform.GetChild(1).GetChild(2).GetComponent <Slider>();
        b = this.transform.GetChild(1).GetChild(3).GetComponent <Slider>();
        //Debug.Log(name);
        //Debug.Log(data.Player_ID);
        //Debug.Log(this.transform.GetChild(2).gameObject.name);
        skill_image         = this.transform.GetChild(2).GetComponentInChildren <RawImage>();
        skill_image.texture = skill[data.Skill];
    }
Exemplo n.º 3
0
    public void Init(int userId, player_Info player)
    {
        //init color and movespeend and jumpspeed
        this.GetComponent <SpriteRenderer>().color = player.Color;
        _skill_ID = player.Skill;
        this.transform.GetChild(1).GetChild(0).GetChild(2).GetComponent <RawImage>().texture = _skill[_skill_ID];
        _moveSpeed = 4;
        _jumpForce = 5.0f;
        //_userId = userId;

        //Initial playerInterface Info
        _playerInterface.GetComponent <RectTransform>().localPosition = new Vector2(-645 + userId * 485, -513);
        _playerInterfaceManager._title.text = "P" + (userId + 1).ToString();
        SetKeycode(userId);

        //_collider = this.GetComponent<CapsuleCollider2D>();

        // _animator = this.GetComponent<Animator>();
        // _rigid2D = this.GetComponent<Rigidbody2D>();
    }
Exemplo n.º 4
0
 public Info(int p, player_Info[] data)
 {
     People       = p;
     Player_Infos = new player_Info[p];
     Player_Infos = data;
 }