/// <summary> /// This Method is used to Select data from tbl_state table on the behalf of country /// </summary> /// <param name="objState">Action</param> /// <returns>1 for success and -1 for fail</returns> public string CountryWiseState(PropState objState) { //if (userName != null && userName != "") //{ SqlCommand cmd = new SqlCommand("proc_state", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "Dropdown"); cmd.Parameters.AddWithValue("@name", objState.StateName); //cmd.Parameters.AddWithValue("@status", objState.flag); //cmd.Parameters.AddWithValue("@CountryId", objState.CountryId); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Connection = objCon.Con; adpt.SelectCommand = cmd; adpt.Fill(ds, "States1"); objCon.Con.Close(); return(ds.GetXml()); //} //else //{ // return "Not Valid"; //} }
/// <summary> /// This Method is used to Select data from tbl_state table /// </summary> /// <param name="objState">Action</param> /// <returns>1 for success and -1 for fail</returns> public string SelectState(PropState objState, string userName) { if (userName != null && userName != "") { SqlCommand cmd = new SqlCommand("proc_state", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "Select"); cmd.Parameters.AddWithValue("@status", objState.flag); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Connection = objCon.Con; adpt.SelectCommand = cmd; adpt.Fill(ds, "States"); objCon.Con.Close(); return(ds.GetXml()); } else { return("Not Valid"); } }
public override void OnStart() { startTime = Time.time; animator = Owner.GetComponent <Animator>(); m_QipaoAnimator = Owner.GetComponentsInChildren <Animator>()[1]; propState = movetoGameObject.Value.GetComponent <PropState>(); }
/// <summary> /// This Method is used to Delete data into tbl_category table /// </summary> /// <param name="objState">ID and Action</param> /// <returns>1 for success and -1 for fail</returns> public string DeleteState(PropState objState, string userName) { if (userName != null && userName != "") { SqlCommand cmd = new SqlCommand("proc_state", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; objCon.Con.Open(); try { cmd.Parameters.AddWithValue("@ID", objState.ID); cmd.Parameters.AddWithValue("@status", objState.flag); cmd.Parameters.AddWithValue("@Action", "Delete"); return(cmd.ExecuteNonQuery().ToString()); } catch (Exception showError) { throw showError; } finally { cmd.Dispose(); objCon.Con.Close(); objCon.Con.Dispose(); } } else { return("Not Valid"); } }
protected override void Awake() { base.Awake(); this._rigidbody = base.GetComponent <Rigidbody>(); this._rigidbody.velocity = Vector3.zero; this._state = PropState.Idle; }
public void OnFetching() { if (DataManager.instance.isDeviceFetched[(int)requiredDevice]) { nextPropState = PropState.RETURNING; } fetchText.transform.LookAt(DataManager.instance.playerCamera.transform); }
public override void Update(GameTime gameTime) { if (state == PropState.Normal && Vector3.Dot(physicalData.OrientationMatrix.Up, Vector3.Up) < .25f) { state = PropState.KnockedOver; Game.ToppleProp(stupid); Topple(); } base.Update(gameTime); }
// return the current state of this prop // so that MainControl can decide what it should do next when another interaction is required public virtual PropState Interact() { PropState state = UpdateState(); if (state != PropState.PATH) { feedbackController.OnInteract(); } return(state); }
public void OnDelivering() { if (DataManager.instance.isDeviceReady[(int)requiredDevice] && !propStand.activeInHierarchy) { propStand.SetActive(true); Sequence propStandRisingSequence = DOTween.Sequence(); propStandRisingSequence.Append(propStand.transform.DOMoveY(propStandMaxHeight, propStandAnimationTime)) .SetEase(propStandAnimationCurve) .AppendCallback(() => { nextPropState = PropState.FETCHING; }); propStandRisingSequence.Play(); } }
public void StartParabolaBorn(Vector3 bornPosition, Vector3 bornVelocity, Vector3 bornAcceleration) { this._state = PropState.Born; this._rigidbody.constraints &= ~RigidbodyConstraints.FreezePositionY; base.transform.position = bornPosition; float num = Vector3.Dot(Vector3.up, bornVelocity); num = Vector3.Dot(Vector3.down, bornAcceleration); base.transform.position = bornPosition; this._bornVelocity = bornVelocity; this._bornAcceleration = bornAcceleration; }
/// <summary> 道具过期 </summary> public virtual void Expired() { if (_propState == PropState.IsExpiring) { return; } _propState = PropState.IsExpiring; foreach (var cell in PropEventSystemListeners.Instance.Listeners) { ExecuteEvents.Execute <IPropEvents <T> >(cell, null, (prop, player) => prop.OnPropExpired(this, _playerBrain)); } RollBack(); AfterDelay(); }
public string SelectState(int flag) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropState propState = new PropState(); propState.flag = flag; BllState objState = new BllState(); str = objState.RecordSelect(propState, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
/// <summary> /// This Method is used to Select data /// </summary> /// <param name="objCountry">Action</param> /// <returns>1 for success and -1 for fail</returns> public string RecordSelect(PropState objState, string UserName) { DllState objDal = new DllState(); try { return(objDal.SelectState(objState, UserName)); } catch (Exception info) { throw info; } finally { objDal = null; } }
/// <summary> /// This Method is used to Select data /// </summary> /// <param name="objCountry">Action</param> /// <returns>1 for success and -1 for fail</returns> public string SelectStates(PropState objState) { DllState objDal = new DllState(); try { return(objDal.CountryWiseState(objState)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string InsertState(int CountryID, string State) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropState proState = new PropState(); proState.StateName = State; proState.CountryId = CountryID; BllState objState = new BllState(); str = objState.RecordInsert(proState, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string DeleteState(int ID, int Status) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropState proState = new PropState(); proState.ID = ID; proState.flag = Status; BllState objState = new BllState(); str = objState.RecordDelete(proState, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string UpdateState(string Name, int ID, int CountryId) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropState proState = new PropState(); proState.StateName = Name; proState.ID = ID; proState.CountryId = CountryId; BllState objState = new BllState(); str = objState.RecordUpdate(proState, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string CountryWiseState(int Status, string CountryID) { string str = string.Empty; //if (Session["admin"] != "" || Session["admin"].ToString() != null) //{ PropState proState = new PropState(); proState.flag = Status; proState.StateName = CountryID; BllState objState = new BllState(); str = objState.SelectStates(proState); return(str); //} //else //{ // return "Error in Authentication"; //} }
/// <summary> 道具Trigger </summary> protected virtual void PropCollected(GameObject obj) { if (!obj.CompareTag(TriggerTag)) { return; } if (_propState == PropState.IsCollected || _propState == PropState.IsExpiring) { return; } _propState = PropState.IsCollected; _playerBrain = obj.GetComponent <T>(); if (_playerBrain == null) { return; } ///如果玩家身上已经有同名道具,销毁 if (SharedMethods.DeepFindTransform(_playerBrain.transform, gameObject.name) != null) { AfterDelay(); return; } gameObject.transform.parent = _playerBrain.transform; PropUsed(); Effects(); //作用于UI的事件系统 foreach (GameObject cell in PropEventSystemListeners.Instance.Listeners) { ExecuteEvents.Execute <IPropEvents <T> >(cell, null, (prop, player) => prop.OnPropCollected(this, _playerBrain)); } AfterTrigger(); }
private void BindState() { DataSet dsresult = new DataSet(); XmlDocument doc = new XmlDocument(); BllState objState = new BllState(); PropState proState = new PropState(); proState.flag = 1; proState.StateName = "US"; doc.LoadXml(objState.SelectStates(proState)); XmlElement exelement = doc.DocumentElement; if (exelement.IsEmpty == false) { XmlNodeReader nodereader = new XmlNodeReader(exelement); dsresult.ReadXml(nodereader, XmlReadMode.Auto); cardState.DataSource = dsresult; cardState.DataTextField = "stateid"; cardState.DataValueField = "stateid"; cardState.DataBind(); } }
/// <summary> /// This Method will be used to Post data into tbl_state table /// </summary> /// <param name="objState">Name</param> /// <returns>1 for success and -1 for fail</returns> public string InsertState(PropState objState, string userName) { if (userName != null && userName != "") { //proc_state is the stored procedure name which will be used to Insert data into the table SqlCommand cmd = new SqlCommand("proc_state", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Parameters.AddWithValue("@Name", objState.StateName); cmd.Parameters.AddWithValue("@CountryId", objState.CountryId); cmd.Parameters.AddWithValue("@Action", "Add"); return(cmd.ExecuteNonQuery().ToString()); } else { return("Not Valid"); } }
private void ChangePropState() { propStateExits[currentPropState](); propStateInits[nextPropState](); currentPropState = nextPropState; }
protected virtual void Start() { _propState = PropState.Default; _timer = new Timer(); }
protected override void Update() { base.Update(); float angle = (Time.deltaTime * this._selfRotateSpeed) * this.TimeScale; base.transform.Rotate(base.transform.up, angle); if (this._state == PropState.Born) { this._bornVelocity += (Vector3)((this._bornAcceleration * this.TimeScale) * Time.deltaTime); this._rigidbody.velocity = this._bornVelocity; if ((Vector3.Dot(Vector3.down, this._bornVelocity) > 0f) && (base.transform.position.y < this._height)) { this._rigidbody.constraints |= RigidbodyConstraints.FreezePositionY; this._state = PropState.Idle; } } else { BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar(); if (localAvatar != null) { if (this._state == PropState.Idle) { this._currentSpeed = 0f; this._rigidbody.velocity = Vector3.zero; float warningRange = base.config.PropArguments.WarningRange; if (Vector3.Distance(localAvatar.XZPosition, this.XZPosition) < warningRange) { this._state = PropState.Chase; } } else if (this._state == PropState.Chase) { if (this._currentSpeed < base.config.PropArguments.MaxMoveSpeed) { this._currentSpeed += (base.config.PropArguments.Acceleration * this.TimeScale) * Time.deltaTime; if (this._currentSpeed > base.config.PropArguments.MaxMoveSpeed) { this._currentSpeed = base.config.PropArguments.MaxMoveSpeed; } } float escapeRange = base.config.PropArguments.EscapeRange; if (Vector3.Distance(localAvatar.XZPosition, this.XZPosition) > escapeRange) { this._state = PropState.Idle; } Vector3 xZPosition = localAvatar.XZPosition; if (GlobalVars.USE_GET_PATH_SWITCH && Singleton <DetourManager> .Instance.GetTargetPosition(this, this.XZPosition, localAvatar.XZPosition, ref xZPosition)) { Debug.DrawLine(this.XZPosition, xZPosition, Color.yellow, 0.1f); } Vector3 vector3 = xZPosition - this.XZPosition; this._rigidbody.velocity = (Vector3)(vector3.normalized * this._currentSpeed); } else if (this._state == PropState.Died) { } base.transform.position = new Vector3(base.transform.position.x, this._height, base.transform.position.z); } } }
// Use this for initialization void Start() { Debug.Log("PropsSprite start"); State = PropState.Default; }
public void Initialize() { PropStatus = PropState.PROP_INITIALIZED; }