// Start is called before the first frame update void Start() { foreach (Transform child in transform) { if (child.TryGetComponent(out EventCollider eventcollider)) { _event = eventcollider; break; } } _move = gameObject.GetComponent <CharController>(); _action = GetComponent <CharAction>(); _state = CharState.NOMAL; _action.Play(); }
internal virtual void Initial(FakeStruct mod) { if (mod == null) { collider = new UIBoxCollider(); return; } FakeStruct fs = null; unsafe { fs = UITransfromLoader.GetEventData(mod); } if (fs == null) { collider = new UIBoxCollider(); } else { switch ((EventColliderType)fs[0]) { case EventColliderType.Circle: collider = new UICircleCollider(); collider.Initial(fs); break; case EventColliderType.Polygon: collider = new UIPolygonCollider(); collider.Initial(fs); break; default: collider = new UIBoxCollider(); break; } } }
// Start is called before the first frame update void Start() { _eventCollider = gameObject.GetComponent <EventCollider>(); }