重力ビームの作成(クラスの継承)




重力ビーム
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GravityBeam : BeamBase
{
public override void OnTriggerEnter(Collider other)
{
base.OnTriggerEnter(other);
if(other.attachedRigidbody)
{
// 重力をオンにする
other.attachedRigidbody.useGravity = true;
AudioSource.PlayClipAtPoint(Sound, Camera.main.transform.position);
}
}
}




【2021版】X_Mission(全34回)
他のコースを見る



重力ビーム
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GravityBeam : BeamBase
{
public override void OnTriggerEnter(Collider other)
{
base.OnTriggerEnter(other);
if(other.attachedRigidbody)
{
// 重力をオンにする
other.attachedRigidbody.useGravity = true;
AudioSource.PlayClipAtPoint(Sound, Camera.main.transform.position);
}
}
}




重力ビームの作成(クラスの継承)