Inheritance: MonoBehaviour
 void OnPlayerDeath(Death death)
 {
     if (death.victim == gameObject.GetHashCode())
     {
         DieInTheGameDieInRealLife();
     }
 }
Exemple #2
0
    void Awake()
    {
        _player = GameObject.FindGameObjectWithTag("Player").transform;
        _vectorUnit = Vector2.zero;

        _death = GameObject.FindGameObjectWithTag("Player").GetComponent<Death>();

        enabled = false;
    }
Exemple #3
0
 void OnDeath(Death death) {
     if ("Enemy" != death.victim_obj.tag)
         return;
     // Debug.Log("Ded");
     Debug.Log(num_of_enemies);
     if (0 >= --num_of_enemies) {
         level_to_load = (int)((SceneManager.GetActiveScene().buildIndex + 1) % SceneManager.sceneCountInBuildSettings);
     }
 }
Exemple #4
0
 public void OnDeath(Death death)
 {
     if (death != null && death.decedent != null && death.decedent.gObj == _go)
     {
         beDead = true;
         _death = death;
         animator.SetInteger("State", GlobalConfig.AC_STATE_Die);
     }
 }
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         triggered = true;
         death = other.GetComponent<Death>();
         other.GetComponent<Controller>().enabled = false;
         leftTrap.localRotation = Quaternion.Euler (new Vector3 (60f, 0f, 0f));
         rightTrap.localRotation = Quaternion.Euler (new Vector3 (-60f, 0f, 0f));
         Invoke ("Kill", 0.3f);
     }
 }
        /// <summary>
        /// Projects death entity from the raw set of death entities.
        /// </summary>
        /// <param name="deathRaw">raw set of death entities</param>
        /// <param name="visitOccurrences">the visit occurrence entities for current person</param>
        /// <param name="observationPeriods">the observation period entities for current person</param>
        /// <returns>death entity</returns>
        public override Death BuildDeath(Death[] deathRaw, Dictionary<long, VisitOccurrence> visitOccurrences, ObservationPeriod[] observationPeriods)
        {
            var death = FilterDeathRecords(deathRaw).ToList();

             if (death.Any())
             {
            var maxStartDate = death.Max(d => d.StartDate);
            var result = death.Where(d => d.StartDate == maxStartDate).OrderByDescending(d => d.Primary).First();

            result.CauseConceptId = 0;

            var maxVisitStartDate = visitOccurrences.Values.Max(vo => vo.StartDate);

            if (maxVisitStartDate < result.StartDate.AddDays(32))
            {
               return result;
            }
             }

             return null;
        }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     pDeaths = GetComponent<Death> ();
 }
Exemple #8
0
 public List<CombatLog.CombatLogEntry> CombatLogForDeath(Death Death)
 {
     List<CombatLog.CombatLogEntry> tempList = new List<CombatLog.CombatLogEntry>();
     for (int i = 0; i < _combatLog.Count; i++)
     {
         if (_combatLog[i].TimeStamp >= Death.StartDisplayTime && _combatLog[i].TimeStamp <= Death.TimeOfDeath)
             tempList.Add(_combatLog[i]);
     }
     return tempList;
 }
		/// <summary>Required method for Designer support - do not modify the contents of this method with the code editor.</summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			// 
			// connect
			// 
			this.Create_Death_connect = new SampleModelContext.ConnectionDelegate(GetConnection);
			// 
			// testVar
			// 
			this.testVar = new SampleModelContext(Create_Death_connect);
			// 
			// abstractTypeVar
			// 
			this.abstractTypeVar = null;
			// 
			// lbl
			// 
			this.lblCreate = new System.Windows.Forms.Label();
			this.lblCreate.Dock = System.Windows.Forms.DockStyle.Top;
			this.lblCreate.Name = "lblCreate";
			this.lblCreate.Text = "Enter data to Create Death by:";
			// 
			// btn
			// 
			this.btnCreate = new System.Windows.Forms.Button();
			this.btnCreate.Location = new System.Drawing.Point(400, 10);
			this.btnCreate.Name = "btnCreate";
			this.btnCreate.TabIndex = 3;
			this.btnCreate.Text = "Create";
			this.btnCreate.UseVisualStyleBackColor = true;
			this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click);
			// 
			// dgv
			// 
			this.dgvCreate = new System.Windows.Forms.DataGridView();
			this.dgvCreate.Dock = System.Windows.Forms.DockStyle.Top;
			this.dgvCreate.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.dgvCreate.Name = "dgvCreate";
			this.dgvCreate.TabIndex = 0;
			this.dgvCreate.Columns.Add("Date_YMD", "Date_YMD");
			this.dgvCreate.Columns.Add("DeathCause_DeathCause_Type", "DeathCause_DeathCause_Type");
			this.dgvCreate.Columns.Add("isinvolvedin{1}", "isinvolvedin{1}");
			this.dgvCreate.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			this.dgvCreate.Height = 75;
			// 
			// pnlDisplay
			// 
			this.pnlDisplay = new System.Windows.Forms.Panel();
			this.pnlDisplay.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlDisplay.AutoSize = true;
			this.pnlDisplay.Location = new System.Drawing.Point(0, 0);
			this.pnlDisplay.Name = "pnlDisplay";
			this.pnlDisplay.AutoScroll = true;
			this.pnlDisplay.TabIndex = 1;
			this.pnlDisplay.Controls.Add(this.btnCreate);
			// 
			// this
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.Controls.Add(this.pnlDisplay);
			this.Controls.Add(this.dgvCreate);
			this.Controls.Add(this.lblCreate);
			this.Name = "icCreateDeathInputControl";
			this.Size = new System.Drawing.Size(530, 490);
			((System.ComponentModel.ISupportInitialize)this.dgvCreate).EndInit();
			this.ResumeLayout(false);
		}
		/// <summary>Required method for Designer support - do not modify the contents of this method with the code editor.</summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.editMode = false;
			// 
			// lblNeedToSave
			// 
			this.lblNeedToSave = new System.Windows.Forms.Label();
			this.lblNeedToSave.Location = new System.Drawing.Point(0, 10);
			this.lblNeedToSave.Name = "lblNeedToSave";
			this.lblNeedToSave.Size = new System.Drawing.Size(200, 15);
			this.lblNeedToSave.Text = "";
			// 
			// btnCancel
			// 
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnCancel.Location = new System.Drawing.Point(300, 10);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 6;
			this.btnCancel.Text = "Cancel";
			this.btnCancel.UseVisualStyleBackColor = true;
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// btnSave
			// 
			this.btnSave = new System.Windows.Forms.Button();
			this.btnSave.Location = new System.Drawing.Point(400, 10);
			this.btnSave.Name = "btnSave";
			this.btnSave.TabIndex = 7;
			this.btnSave.Text = "Save";
			this.btnSave.UseVisualStyleBackColor = true;
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// pnlSave
			// 
			this.pnlSave = new System.Windows.Forms.Panel();
			this.pnlSave.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlSave.AutoSize = true;
			this.pnlSave.Location = new System.Drawing.Point(0, 0);
			this.pnlSave.Name = "pnlSave";
			this.pnlSave.AutoScroll = true;
			this.pnlSave.TabIndex = 5;
			this.pnlSave.Controls.Add(this.btnSave);
			this.pnlSave.Controls.Add(this.btnCancel);
			this.pnlSave.Controls.Add(this.lblNeedToSave);
			this.pnlSave.Visible = false;
			// 
			// lblSelectionMode
			// 
			this.lblSelectionMode = new System.Windows.Forms.Label();
			this.lblSelectionMode.Location = new System.Drawing.Point(0, 10);
			this.lblSelectionMode.Name = "lblSelectionMode";
			this.lblSelectionMode.Text = "SelectionMode:";
			// 
			// cbxSelectionMode
			// 
			this.cbxSelectionMode = new System.Windows.Forms.ComboBox();
			this.cbxSelectionMode.Location = new System.Drawing.Point(100, 10);
			this.cbxSelectionMode.Name = "cbxSelectionMode";
			this.cbxSelectionMode.Size = new System.Drawing.Size(200, 15);
			this.cbxSelectionMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbxSelectionMode.TabIndex = 2;
			this.cbxSelectionMode.SelectedIndexChanged += new System.EventHandler(this.cbxSelectionMode_SelectedIndexChanged);
			// 
			// lblCurrentObject
			// 
			this.lblCurrentObject = new System.Windows.Forms.Label();
			this.lblCurrentObject.Location = new System.Drawing.Point(0, 45);
			this.lblCurrentObject.Width = 300;
			this.lblCurrentObject.Name = "lblCurrentObject";
			this.lblCurrentObject.Text = "There is no selected Death.";
			// 
			// dgvCurrentObject
			// 
			this.dgvCurrentObject = new System.Windows.Forms.DataGridView();
			this.dgvCurrentObject.Dock = System.Windows.Forms.DockStyle.Top;
			this.dgvCurrentObject.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.dgvCurrentObject.Location = new System.Drawing.Point(0, 265);
			this.dgvCurrentObject.Name = "dgvCurrentObject";
			this.dgvCurrentObject.Size = new System.Drawing.Size(500, 150);
			this.dgvCurrentObject.TabIndex = 4;
			this.dgvCurrentObject.Columns.Add("Date_YMD", "Date_YMD");
			this.dgvCurrentObject.Columns["Date_YMD"].Visible = false;
			this.dgvCurrentObject.Columns.Add("DeathCause_DeathCause_Type", "DeathCause_DeathCause_Type");
			this.dgvCurrentObject.Columns["DeathCause_DeathCause_Type"].Visible = false;
			this.dgvCurrentObject.Columns.Add("isinvolvedin{1}", "isinvolvedin{1}");
			this.dgvCurrentObject.Columns["isinvolvedin{1}"].Visible = false;
			this.dgvCurrentObject.Visible = false;
			this.dgvCurrentObject.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dgvCurrentObject_CellBeginEdit);
			this.Controls.Add(this.pnlSave);
			this.Controls.Add(this.dgvCurrentObject);
			// 
			// connect
			// 
			this.Select_Death_connect = new SampleModelContext.ConnectionDelegate(GetConnection);
			// 
			// testVar
			// 
			this.testVar = new SampleModelContext(Select_Death_connect);
			// 
			// abstractTypeVar
			// 
			this.abstractTypeVar = null;
			// 
			// lbl
			// 
			this.lblSelect = new System.Windows.Forms.Label();
			this.lblSelect.Dock = System.Windows.Forms.DockStyle.Top;
			this.lblSelect.Name = "lblSelect";
			this.lblSelect.Text = "Enter data to Select Death by:";
			// 
			// btn
			// 
			this.btnSelect = new System.Windows.Forms.Button();
			this.btnSelect.Location = new System.Drawing.Point(400, 10);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.TabIndex = 3;
			this.btnSelect.Text = "Select";
			this.btnSelect.UseVisualStyleBackColor = true;
			this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
			// 
			// dgv
			// 
			this.dgvSelect = new System.Windows.Forms.DataGridView();
			this.dgvSelect.Dock = System.Windows.Forms.DockStyle.Top;
			this.dgvSelect.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.dgvSelect.Name = "dgvSelect";
			this.dgvSelect.TabIndex = 0;
			this.dgvSelect.Columns.Add("Date_YMD", "Date_YMD");
			this.dgvSelect.Columns.Add("DeathCause_DeathCause_Type", "DeathCause_DeathCause_Type");
			this.dgvSelect.Columns.Add("isinvolvedin{1}", "isinvolvedin{1}");
			this.dgvSelect.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			this.dgvSelect.Height = 75;
			// 
			// pnlDisplay
			// 
			this.pnlDisplay = new System.Windows.Forms.Panel();
			this.pnlDisplay.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlDisplay.AutoSize = true;
			this.pnlDisplay.Location = new System.Drawing.Point(0, 0);
			this.pnlDisplay.Name = "pnlDisplay";
			this.pnlDisplay.AutoScroll = true;
			this.pnlDisplay.TabIndex = 1;
			this.pnlDisplay.Controls.Add(this.btnSelect);
			// 
			// this
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.Controls.Add(this.pnlDisplay);
			this.Controls.Add(this.dgvSelect);
			this.Controls.Add(this.lblSelect);
			this.Name = "icSelectDeathInputControl";
			this.Size = new System.Drawing.Size(530, 490);
			((System.ComponentModel.ISupportInitialize)this.dgvSelect).EndInit();
			this.ResumeLayout(false);
			this.dgvCurrentObject.Height = this.dgvSelect.Height;
			this.pnlDisplay.Controls.Add(this.lblCurrentObject);
			this.pnlDisplay.Controls.Add(this.cbxSelectionMode);
			this.pnlDisplay.Controls.Add(this.lblSelectionMode);

			if (this.cbxSelectionMode.Items.Count > 0)
			{
				this.cbxSelectionMode.SelectedIndex = 0;
			}
		}
Exemple #11
0
    protected virtual void InitializeStateMachine()
    {
        Idle idleState = new Idle(this);
        idleState.AddTransition(Transition.E_FAILGESTURE, StateID.E_ATTACK);
        idleState.AddTransition(Transition.E_LOSTHP, StateID.E_DAMAGED);
        idleState.AddTransition(Transition.E_NOHP, StateID.E_DEATH);

        Attack atkState = new Attack(this);
        atkState.AddTransition(Transition.E_FINISHATTACK, StateID.E_IDLE);
        atkState.AddTransition(Transition.E_LOSTHP, StateID.E_DAMAGED);

        Damaged dmgState = new Damaged(this);
        dmgState.AddTransition(Transition.E_NOHP, StateID.E_DEATH);
        dmgState.AddTransition(Transition.E_FINISHATTACK, StateID.E_IDLE);
        dmgState.AddTransition(Transition.E_LOSTHP, StateID.E_DAMAGED);

        Death deathState = new Death(this);
        enemyState = new FiniteStateMachine();
        enemyState.AddState(idleState);

        enemyState.AddState(atkState);
        enemyState.AddState(dmgState);
        enemyState.AddState(deathState);
    }