Пример #1
0
 //------------------------------------
 public void OnClick(NetManager.PlayerType type)
 {
     if (!isMoving)
     {
         return;
     }
     if (type != Args.CircleID.PlayerType)
     {
         return;
     }
     Args.OnClick_CallBack(Args.CircleID, pool_ID, transform.localScale.x);
 }
Пример #2
0
    //---------------------------------
    public void Init(PlayerInitArg _Player1Arg, PlayerInitArg _Player2Arg, NetManager.PlayerType _currentPlayer)
    {
        Player1       = new PlayerArg();
        Player2       = new PlayerArg();
        currentPlayer = _currentPlayer;

        Player1.CurrentCirclesCount = _Player1Arg.CurrentCirclesCount;
        Player1.PlayerType          = _Player1Arg.PlayerType;
        Player1.Scores                        = _Player1Arg.Scores;
        Player1.RandomSeed                    = _Player1Arg.RandomSeed;
        Player1.FinishHPosition               = CircleMoveFinishHPosition;
        Player1.FinishMove_CallBack           = OnFinishMoveCircle;
        Player1.OnClick_CallBack              = OnClickCircle;
        Player1.Random                        = new System.Random(Player1.RandomSeed);
        Player1.CircleSpawnStartPositionLeft  = Player1CircleSpawnStartPositionLeft;
        Player1.CircleSpawnStartPositionRight = Player1CircleSpawnStartPositionRight;

        Player2.CurrentCirclesCount = _Player2Arg.CurrentCirclesCount;
        Player2.PlayerType          = _Player2Arg.PlayerType;
        Player2.Scores                        = _Player2Arg.Scores;
        Player2.RandomSeed                    = _Player2Arg.RandomSeed;
        Player2.FinishHPosition               = CircleMoveFinishHPosition;
        Player2.FinishMove_CallBack           = OnFinishMoveCircle;
        Player2.OnClick_CallBack              = OnClickCircle;
        Player2.Random                        = new System.Random(Player2.RandomSeed);
        Player2.CircleSpawnStartPositionLeft  = Player2CircleSpawnStartPositionLeft;
        Player2.CircleSpawnStartPositionRight = Player2CircleSpawnStartPositionRight;

        int i = 0;

        if (Player1.CurrentCirclesCount > 0)
        {
            i = 0;
            while (i++ < Player1.CurrentCirclesCount)
            {
                Player1.Random.NextDouble();
                Player1.Random.NextDouble();
            }
        }
        if (Player2.CurrentCirclesCount > 0)
        {
            i = 0;
            while (i++ < Player2.CurrentCirclesCount)
            {
                Player2.Random.NextDouble();
                Player2.Random.NextDouble();
            }
        }

        isGameStarted = true;
        StartCoroutine(IE_CircleGeneration());
    }