Exemplo n.º 1
0
        public static void addSlave(MainPart self, CharaBase playerC, CharaBase friend)
        {
            if (friend.type != CharaType.Slave)
            {
                CharaBase.changeToSlave(friend);
            }
            removeSlave(self, playerC, friend);
            var player = playerC.player();
            var listL  = player.nodeListL;
            var listR  = player.nodeListR;

            var nodeList = (listL.Count < listR.Count) ? listL : listR;

            nodeList.Add(new PlayerNode()
            {
                nodeId = friend.gameInstanceId,
            });
        }
Exemplo n.º 2
0
        public static void removeSlave(MainPart self, CharaBase playerC, CharaBase friend)
        {
            if (friend.type != CharaType.Slave)
            {
                CharaBase.changeToSlave(friend);
            }
            var player = playerC.player();
            var listL  = player.nodeListL;
            var listR  = player.nodeListR;

            listL.RemoveAll(_node => _node.nodeId == friend.gameInstanceId);
            listR.RemoveAll(_node => _node.nodeId == friend.gameInstanceId);


            var tangle = 0f;

            UpdateRing(self.player.nodeListL, tangle, self.player.angleSpeed);
            UpdateRing(self.player.nodeListR, tangle, self.player.angleSpeed);
        }