예제 #1
0
    public void boom()
    {
        if (boomed)
        {
            return;
        }
        boomed = true;

        switch (eType)
        {
        case BombType.BTBomb:
        {
            GameObject particles = (GameObject)Instantiate(explosion);
            particles.transform.position = this.transform.position;
            //	particles.transform.localScale = new Vector3(5000,5000,5000);
            Destroy(this.transform.parent.gameObject);
            hPlayerSidesColliderScriptCS.deactivateCollider();  //dont detect stumbles on death
            hInGameScriptCS.collidedWithObstacle();             //play the death scene
        }
        break;

        case BombType.BTBullet:
        {
            bDead = true;
            if (hControllerScriptCS.getBoss() != null)
            {
                move(this.transform.position, hControllerScriptCS.getBoss().position, 0.3f);
            }
        }
        break;
        }
    }
예제 #2
0
    void OnCollisionEnter(Collision collision)
    {
        MoveForwardCS obj = (MoveForwardCS)collision.collider.GetComponent(typeof(MoveForwardCS));

        if (obj != null)
        {
            obj.stop();
        }
        else
        {
            obj = (MoveForwardCS)collision.collider.GetComponentInChildren(typeof(MoveForwardCS));
            if (obj != null)
            {
                obj.stop();
            }
            else
            {
                obj = (MoveForwardCS)collision.collider.transform.parent.GetComponent(typeof(MoveForwardCS));
                if (obj != null)
                {
                    obj.stop();
                }
            }
        }

        hPlayerSidesColliderScriptCS.deactivateCollider(); //dont detect stumbles on death
        hInGameScriptCS.collidedWithObstacle();            //play the death scene
    }
예제 #3
0
    /*
     *	FUNCTION: Called when player hits an obstacle sideways
     *	CALLED BY: PlayerSidesColliderScript.OnCollisionEnter()
     */
    public void processStumble()
    {
        hCameraControllerCS.setCameraShakeImpulseValue(1);
        iLanePosition = iLastLanePosition;              //stop strafe

        if (hEnemyControllerCS.processStumble())
        {
            hInGameScriptCS.collidedWithObstacle();            //call death if player stumbled twice in unit time
        }
        else
        {
            if (!mecanimEnabled)
            {
                aPlayer.PlayQueued("run", QueueMode.CompleteOthers);
            }

            //enable colliders if they were disabled
            hPlayerFrontColliderScriptCS.activateCollider();
            hPlayerSidesColliderScriptCS.activateCollider();
        }
    }
예제 #4
0
 void OnCollisionEnter(Collision collision)
 {
     hPlayerSidesColliderScriptCS.deactivateCollider(); //dont detect stumbles on death
     hInGameScriptCS.collidedWithObstacle();            //play the death scene
 }