Пример #1
0
    // 이동 종료 검사
    bool IsEndOfMoving(Collider c)
    {
        WallCollider wall = c.GetComponent <WallCollider>();

        if (wall)
        {
            // Debug.Log ("Bullet:IsEndOFMoveing() wall id=" + gameObject.GetInstanceID());
            state = E_STATE.End;
            return(true);
        }

        // block decrease HP
        Block block = c.GetComponent <Block> ();

        if (block)
        {
            block.hp -= 1;
            //block.OnHit (1);
            PlayManager.Inst.score++;

            // Debug.Log ("Bullet:IsEndOFMoveing() block id=" + gameObject.GetInstanceID());
            state = E_STATE.End;
            return(true);
        }

        // Debug.Log ("Bullet:IsEndOfMoving() not found");
        return(false);
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     body           = GetComponent <Rigidbody2D>();
     anim           = GetComponent <Animator>();
     render         = GetComponent <SpriteRenderer>();
     groundCollider = GetComponentInChildren <GroundCollider>();
     wallCollider   = GetComponentInChildren <WallCollider>();
     anim.SetBool("dead", false);
 }
Пример #3
0
        public void WallCollider_Collides(int radius1, double x2, double y2, int radius2, bool expectation)
        {
            var collider1 = new Collider(radius1, CreateLocatable(new Vector()));
            var collider2 = new WallCollider(radius2, CreateLocatable(new Vector(x2, y2)));

            var collides = collider2.Collides(collider1);

            Assert.AreEqual(expectation, collides);
        }
Пример #4
0
    // 이동 종료 검사
    bool IsEndOfMoving(Collider c)
    {
        WallCollider wall = c.GetComponent <WallCollider>();

        if (wall)
        {
            if (!wall.isStopArea)
            {
                // 공 여러개일 때 너무 시끄러움
                // SoundManager.Inst.Play ("Sound/Block-Hit");
                return(false);
            }
            // reach bottom wall
            if (null != onMovingEnd)
            {
                onMovingEnd(this);
            }

            state = E_STATE.Sort;
            return(true);
        }

        // block decrease HP
        Block block = c.GetComponent <Block> ();

        if (block)
        {
            PlayManager.Inst.CollisionBallWithBlock();

            // block.OnHit (1);
            block.hp -= 1;

            switch (block.eType)
            {
            case ItemType.EType.TRI:
            case ItemType.EType.ROTATION_TRI:
                break;

            default:
                PlayManager.Inst.score++;
                break;
            }
        }
        return(false);
    }
Пример #5
0
 public TestWallObject(int radius, Vector location) : base(radius, location)
 {
     Collider = new WallCollider(radius, this);
 }