コード例 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag (TargetTag) || other.IsOvni()) {
            DestroyIt ();

            Juiceness.Run ("ProjectileCameraShake", () => {
                SHCameraHelper.Shake(CameraShakeTime, CameraShakeAmount);
            });

            Juiceness.Run ("ProjectileCameraFlash", () => {
                Camera.main.backgroundColor = CameraFlashColor;
                SHThread.StartEndOfFrame(() => {
                    Camera.main.backgroundColor = Color.black;
                });
            });

            Game.Instance.RaiseMessage ("OnProjectileHit" + TargetTag, gameObject);
        }
        else if (other.IsHorizontalEdge ()) {
            DestroyIt ();
            Game.Instance.RaiseMessage ("OnProjectileMiss" + TargetTag, gameObject);
        }
        else if (other.IsProjectile ()) {
            Juiceness.Run ("ProjectileDetroyProjectile", () => {
                DestroyIt ();
            });

            Game.Instance.RaiseMessage ("OnProjectileMiss" + TargetTag, gameObject);
        }
    }