예제 #1
0
 private void OnMessage(Messages.Param param)
 {
     if (param.Is(Messages.Type.BallPurchased))
     {
         UpdateState();
     }
 }
예제 #2
0
 private void OnMessage(Messages.Param param)
 {
     if (param.Is(Messages.Type.TurnEnded))
     {
         isShooting = false;
     }
 }
예제 #3
0
파일: UiAvatar.cs 프로젝트: seganx/ameza
 private void OnMessage(Messages.Param param)
 {
     if (param.Is(Messages.Type.AvatarChanged))
     {
         UpdateVisual();
     }
 }
예제 #4
0
 private void OnMessage(Messages.Param param)
 {
     if (param.Is(Messages.Type.AvatarChanged))
     {
         avatar.Setup(Profile.Avatar.Current);
     }
 }
예제 #5
0
    private void OnMessage(Messages.Param param)
    {
        if (PlayModel.level.targetItem0 < 1 && PlayModel.level.targetItem1 < 1)
        {
            return;
        }

        if (param.Is(Messages.Type.BlockDead) && param.Is <BlockValue>())
        {
            var subject = param.As <BlockValue>();
            if (PlayModel.level.targetItem0 > 0 && subject.ItemIndex == 0)
            {
                StartCoroutine(DoMoveToMissionUi(subject.transform, item0Image.transform.position));
            }
            else if (PlayModel.level.targetItem1 > 0 && subject.ItemIndex == 1)
            {
                StartCoroutine(DoMoveToMissionUi(subject.transform, item1Image.transform.position));
            }
        }
    }
예제 #6
0
    public void OnMessage(Messages.Param param)
    {
        switch (param.type)
        {
        case Messages.Type.OnBlockHit:
        {
            if (param.Is <BlockBase>())
            {
                DispatchOnBlockHit(param.As <BlockBase>().Type);
            }
        }
        break;

        case Messages.Type.OnBlockDeath:
        {
            if (param.Is <BlockBase>())
            {
                DispatchOnBlockDeath(param.As <BlockBase>().Type);
            }
        }
        break;
        }
    }
예제 #7
0
파일: BallManager.cs 프로젝트: seganx/ameza
    private void OnMessage(Messages.Param param)
    {
        switch (param.type)
        {
        case Messages.Type.StartTurn:
        {
            turnStarted = true;
            float speed = GlobalConfig.Difficulty.startBallSpeed;
            if (BlockManager.blocks.Count < 16)
            {
                speed += speed * (16 - BlockManager.blocks.Count) * 0.05f;
            }
            StartCoroutine(DoStartTurn(param.As <Vector3>().normalized *speed));
            transform.root.Broadcast(Messages.Type.TurnStarted, this);
        }
        break;

        case Messages.Type.EndTurn:
        {
            StopAllCoroutines();
            ballsShooting = false;
            CheckAllBalls();
        }
        break;

        case Messages.Type.BlockDead:
        {
            if (param.Is <BlockBall>())
            {
                var ball = param.As <BlockBall>();
                if (ball.IsPregnant)
                {
                    var newball = SpawnBall(ball.transform.localPosition);
                    newball.Rigidbody.velocity = GlobalConfig.Difficulty.startBallSpeed * new Vector2(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f)).normalized;
                }
            }
        }
        break;
        }
    }