mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-14 09:14:37 +07:00
32 lines
842 B
C#
32 lines
842 B
C#
using UnityEngine;
|
|
|
|
namespace IsoTools.Physics.Internal {
|
|
[AddComponentMenu("")]
|
|
[DisallowMultipleComponent]
|
|
[RequireComponent(typeof(IsoObject))]
|
|
public class IsoPhysicsHelper : MonoBehaviour {
|
|
|
|
GameObject _isoFakeObject = null;
|
|
public GameObject isoFakeObject {
|
|
get { return _isoFakeObject; }
|
|
}
|
|
|
|
void Awake() {
|
|
hideFlags = HideFlags.HideInInspector;
|
|
var iso_object = GetComponent<IsoObject>();
|
|
if ( iso_object ) {
|
|
_isoFakeObject = new GameObject("_Fake" + gameObject.name);
|
|
_isoFakeObject.AddComponent<IsoFakeObject>().Init(iso_object);
|
|
_isoFakeObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.NotEditable;
|
|
GameObject.DontDestroyOnLoad(_isoFakeObject);
|
|
}
|
|
}
|
|
|
|
void OnDestroy() {
|
|
if ( _isoFakeObject ) {
|
|
DestroyImmediate(_isoFakeObject);
|
|
_isoFakeObject = null;
|
|
}
|
|
}
|
|
}
|
|
} |