static public OutObject <Color, bool> StringToColorRGBA(string _str) { OutObject <Color, bool> ret = new OutObject <Color, bool>(); ret.mReturnValue = ColorUtility.TryParseHtmlString(_str, out ret.mObject); return(ret); }
static public OutObject <T, M> GetOutTypeStruct <T, M>(object _object, string _methodname, int _pos, params object[] _parmas) { OutObject <T, M> ret = new OutObject <T, M>(); Type ttype = _object.GetType(); if (_parmas != null) { Type[] ttypes = new Type[_parmas.Length]; for (int i = 0; i < _parmas.Length; i++) { if (i != _pos) { ttypes[i] = _parmas[i].GetType(); } else { ttypes[i] = _parmas[i].GetType().MakeByRefType(); } } MethodInfo methodinfo = ttype.GetMethod(_methodname, ttypes); ret.mReturnValue = (M)methodinfo.Invoke(_object, _parmas); ret.mObject = (T)_parmas[_pos]; } return(ret); }
static public void IsWheelTouchGrount(OutObject <RaycastHit, bool> _obj, Vector3 origin, Vector3 direction) { if (_obj == null) { return; } RaycastHit thit; _obj.mReturnValue = Physics.Raycast(origin, direction, out thit); _obj.mObject = thit; }
static public OutObject <RaycastHit, bool> RayCast(Vector3 origin, Vector3 direction) { OutObject <RaycastHit, bool> ret = new OutObject <RaycastHit, bool>(); RaycastHit thit; ret.mReturnValue = Physics.Raycast(origin, direction, out thit); ret.mObject = thit; return(ret); }