Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AddComponentMenuを使ってスクリプトを整理する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[AddComponentMenu("ExplorersLab/ObjectMover")]
public class ObjectMover : MonoBehaviour {
bool isMoved;
Vector3 force = new Vector3(10f, 10f, 0f);
void Start(){
}
void FixedUpdate(){
if (Time.frameCount < 10){
return;
}
if (!isMoved){
gameObject.GetComponent<Rigidbody>().AddForce(force, ForceMode.Impulse);
isMoved = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.