private Company CreateObject(IDataReader objReader) { Company objCompany = new Company(); NullManager oNullManager = new NullManager(objReader); try { objCompany.CompanyID = oNullManager.GetInt32("CompanyID"); objCompany.CompanyName = oNullManager.GetString("CompanyName"); objCompany.AddressLine1 = oNullManager.GetString("AddressLine1"); objCompany.AddressLine2 = oNullManager.GetString("AddressLine2"); objCompany.Phone = oNullManager.GetString("Phone"); objCompany.Fax = oNullManager.GetString("Fax"); objCompany.WebSite = oNullManager.GetString("WebSite"); objCompany.Email = oNullManager.GetString("Email"); objCompany.BusinessSubTypeID = oNullManager.GetInt32("BusinessSubTypeID"); objCompany.TradeLicense = oNullManager.GetString("TradeLicense"); objCompany.TINno = oNullManager.GetString("TINno"); objCompany.IRCNo = oNullManager.GetString("IRCNo"); objCompany.ERCNo = oNullManager.GetString("ERCNo"); objCompany.MembershipNo1 = oNullManager.GetString("MembershipNo1"); objCompany.MembershipNo2 = oNullManager.GetString("MembershipNo2"); objCompany.ContactPerson = oNullManager.GetString("ContactPerson"); objCompany.ContactPersonPhone = oNullManager.GetString("ContactPersonPhone"); objCompany.CompanyLogo = oNullManager.GetBytes("CompanyLogo"); objCompany.CurrencyID = oNullManager.GetInt32("CurrencyID"); } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objCompany); }
private UserPrivilege CreateObject(IDataReader oReader, bool IsDefault) { UserPrivilege objUserPrivilege = new UserPrivilege(); NullManager reader = new NullManager(oReader); try { objUserPrivilege.UserID = reader.GetInt32("UserID"); objUserPrivilege.FriendlyName = reader.GetString("FriendlyName"); objUserPrivilege.CompanyID = reader.GetInt32("CompanyID"); if (!IsDefault) { objUserPrivilege.CanEdit = (int)reader.GetByte("CanEdit"); objUserPrivilege.CanDelete = (int)reader.GetByte("CanDelete"); objUserPrivilege.CanAdd = (int)reader.GetByte("CanAdd"); objUserPrivilege.CanView = (int)reader.GetByte("CanView"); } } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objUserPrivilege); }
//Apply force to the parsed objects void ApplyForce(SpellInfo info, int forceModifier) { Vector3 origin = info.collisionPoints[0]; Vector3 direction; RaycastHit hit; for (int i = 0; i < info.collisionObjects.Count; i++) { GameObject obj = info.collisionObjects[i]; if (obj != null) { if (obj.GetComponent <Rigidbody>() != null) { bool canBeForced = true; NullManager nullManager = obj.GetComponent <NullManager>(); if (nullManager != null) { if (nullManager.IsNulled) { canBeForced = false; } } if (canBeForced) { direction = obj.transform.position - origin; if (Physics.Raycast(origin - Vector3.Normalize(direction) * 0.01f, direction, out hit, 1000, ~(1 << LayerMask.NameToLayer("Ignore Raycast")))) { if (hit.collider.gameObject == obj) { float pushForce = (1 - (hit.distance / maxForceDistance)) * maxForce * forceModifier; Vector3 pushVector = Vector3.Normalize(obj.transform.position - origin) * pushForce; pushVector.y = 0; GameObject FX = Instantiate(pushFX); FX.transform.position = hit.transform.position; FX.transform.LookAt(transform.position + pushVector); AudioSource.PlayClipAtPoint(ForceSound, hit.transform.position, Info.optionsData.sfxLevel); obj.GetComponent <Rigidbody>().AddForce(pushVector); } } } } } } }
private ModuleDictionary CreateObject(IDataReader oReader) { ModuleDictionary objModuleDictionary = new ModuleDictionary(); NullManager reader = new NullManager(oReader); try { objModuleDictionary.TotalPrivilege = (int)reader.GetByte("TotalPrivilege"); objModuleDictionary.MenuName = reader.GetString("MenuName"); } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objModuleDictionary); }
//Invert the null stated of collided objects IEnumerator Null(SpellInfo info) { for (int i = 0; i < info.collisionObjects.Count; i++) { GameObject obj = info.collisionObjects[i]; if (obj != null) { NullManager nullManager = obj.GetComponent <NullManager>(); if (nullManager != null) { nullManager.HandleNullEvent(); } } } yield return(info); }
private BusinessType CreateObject(IDataReader objReader) { BusinessType objBusinessType = new BusinessType(); NullManager reader = new NullManager(objReader); try { objBusinessType.BusinessTypeID = reader.GetInt32("BusinessTypeID"); objBusinessType.Name = reader.GetString("Name"); objBusinessType.CompanyID = reader.GetInt32("CompanyID"); objBusinessType.UserID = reader.GetInt32("UserID"); objBusinessType.ModifiedDate = reader.GetDateTime("ModifiedDate"); } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objBusinessType); }
private User CreateObject(IDataReader oReader) { User objUser = new User(); NullManager Reader = new NullManager(oReader); try { objUser.UserID = Reader.GetInt32("UserID"); objUser.UserName = Reader.GetString("UserName"); objUser.Password = Reader.GetString("Password"); objUser.ConfirmPassword = Reader.GetString("ConfirmPassword"); objUser.Role = Reader.GetString("Role"); objUser.CompanyID = Reader.GetInt32("CompanyID"); } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objUser); }
private Designation CreateObject(IDataReader oReader) { Designation objDesg = new Designation(); NullManager reader = new NullManager(oReader); try { objDesg.DesignationID = reader.GetInt32("DesignationID"); objDesg.DesignationName = reader.GetString("Name"); objDesg.PayScaleID = reader.GetInt32("PayScaleID"); objDesg.CompanyID = reader.GetInt32("CompanyID"); objDesg.UserID = reader.GetInt32("UserID"); objDesg.ModifiedDate = reader.GetDateTime("ModifiedDate"); } catch (Exception Ex) { throw new Exception("Error while creating object" + Ex.Message); } return(objDesg); }
//On entering the flame, set flammable, un-nulled objects on fire private void OnTriggerEnter(Collider other) { BurnController bc = other.gameObject.GetComponent <BurnController>(); if (bc != null) { bool canBurn = true; NullManager nm = other.gameObject.GetComponent <NullManager>(); if (nm != null) { if (nm.IsNulled) { nullObjects.Add(nm); canBurn = false; } } bc.enabled = canBurn; } }
//Handle laser and impact void Update() { if (Info.isPaused) { return; } laserObject.SetActive(isActivated); HitFX.SetActive(isActivated); if (isActivated) { RaycastHit hit; float laserLength = 1000.0f; if (Physics.Raycast(laserOrigin.position, laserOrigin.forward, out hit, 1000.0f, ~laserIgnore)) { HitFX.transform.position = hit.point; laserLength = hit.distance * scaleModifier; if (hit.collider.gameObject != impactObject) { impactObject = hit.collider.gameObject; nullManager = impactObject.GetComponent <NullManager>(); } if (impactObject.tag == "Interactable") { bool shouldDestroy = true; if (nullManager != null) { if (nullManager.IsNulled) { shouldDestroy = false; } } if (shouldDestroy) { Destroy(impactObject); GameObject FX = Instantiate(DestroyFX); AudioSource.PlayClipAtPoint(destroySound, hit.point, Info.optionsData.sfxLevel); FX.transform.position = impactObject.transform.position; FX.transform.localScale = impactObject.transform.localScale * 0.5f; impactObject = null; } } } laserObject.transform.localScale = new Vector3(0.0625f, 0.0625f, laserLength); laserObject.transform.LookAt(hit.point); if (rotationSpeed != 0) { currentRotation.y += rotationSpeed; transform.Rotate(new Vector3(0, rotationSpeed, 0)); } } }