// Method for global demolition subscription void GlobalMethod(RayfireRigid rigid) { // Show amount of fragments Debug.Log("Global demolition: " + rigid.name + " was just demolished and created " + rigid.fragments.Count.ToString() + " fragments"); // Show contact point Debug.Log("Contact point: " + rigid.limitations.contactVector3.ToString()); transform.position = rigid.limitations.contactVector3; }
// Update is called once per frame void Update() { if (Input.GetKeyDown("space") == true) { if (targetObject != null) { RayfireRigid rigidComponent = targetObject.AddComponent <RayfireRigid>(); rigidComponent.simulationType = SimType.Dynamic; rigidComponent.demolitionType = DemolitionType.Runtime; rigidComponent.objectType = ObjectType.Mesh; rigidComponent.Initialize(); } } }
// Method for global activation subscription void GlobalMethod(RayfireRigid rigid) { // Show amount of fragments Debug.Log("Global activation: " + rigid.name + " was just activated"); }
//public float damageValue = 50f; //public Transform damagePoint; //public float damageRadius = 2f; // Start is called before the first frame update void Start() { rigid = GetComponent <RayfireRigid>(); }
private void Start() { _rayfireRigid = gameObject.GetComponent <RayfireRigid>(); }