コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        pre_Info.skill = new bool[4];

        player_Info.playerPos = transform.position;
        player_Info.playerRot = transform.rotation;
        player_Info.health    = player_Health.cuurenthealth;
        player_Info.shoot     = player_Shoot.shoot;
        player_Info.walking   = player_Move.GetWalking();
        player_Info.death     = player_Health.isDeadF();
        player_Info.skill[0]  = player_skill.MultiActive();
        player_Info.skill[1]  = player_skill.BoomActive();
        player_Info.skill[3]  = player_skill.AccelS();
        if (GameObject.FindGameObjectsWithTag("SkillAim").Length > 0)
        {
            player_Info.skill[2]  = player_skill.GetCannonAim().GetComponent <CannonBarrage>().Active();
            player_Info.CannonPos = player_skill.GetCannonAim().transform.position;
        }
        else
        {
            player_Info.skill[2] = false;
        }

        if (Vector3.SqrMagnitude(player_Info.playerPos - pre_Info.pos) > 0.01f)
        {
            pre_Info.pos = player_Info.playerPos;
            send         = true;
        }
        if (pre_Info.rot != player_Info.playerRot)
        {
            pre_Info.rot = player_Info.playerRot;
            send         = true;
        }
        if (pre_Info.hp != player_Info.health)
        {
            pre_Info.hp = player_Info.health;
            send        = true;
        }
        if (pre_Info.shoot != player_Info.shoot)
        {
            pre_Info.shoot = player_Info.shoot;
            send           = true;
        }
        if (pre_Info.walking != player_Info.walking)
        {
            pre_Info.walking = player_Info.walking;
            send             = true;
        }
        if (pre_Info.death != player_Info.death)
        {
            pre_Info.death = player_Info.death;
            send           = true;
        }
        if (pre_Info.skill[0] != player_Info.skill[0])
        {
            pre_Info.skill[0] = player_Info.skill[0];
            send = true;
        }
        if (pre_Info.skill[1] != player_Info.skill[1])
        {
            pre_Info.skill[1] = player_Info.skill[1];
            send = true;
        }
        if (pre_Info.skill[2] != player_Info.skill[2])
        {
            pre_Info.skill[2] = player_Info.skill[2];
            send = true;
        }
        if (pre_Info.skill[3] != player_Info.skill[3])
        {
            pre_Info.skill[3] = player_Info.skill[3];
            send = true;
        }
        if (pre_Info.cpos != player_Info.CannonPos)
        {
            pre_Info.cpos = player_Info.CannonPos;
            send          = true;
        }
    }