public void InvokeNow() { if (timedEvent != null) { timedEvent.Invoke(); } }
/// <summary> /// キックコルーチン。 /// 向き変えて、アニメーション開始して、コリジョン発生させる。 /// </summary> /// <param name="kickPoint"></param> /// <returns></returns> internal IEnumerator Kick(Vector3 kickPoint) { isKicking = true; hitKickable = null; var tdir = kickPoint - mTrans.position; StartCoroutine(LookAt(tdir, 0.3f)); animatorCtrl.Kick(); onKickStart.Invoke(); yield return(new WaitForSeconds(kickTime)); kickCollider.SetActive(false); isKicking = false; onKickEnd.Invoke(); }
public override void OnTick() { DateTime currentTimeTemp = currentTime; AddSecond(1); if (currentTimeTemp.Minute != currentTime.Minute) { timeEvent_Minute.Invoke(currentTime); //Debug.Log("add minute"); } if (currentTimeTemp.DayOfWeek != currentTime.DayOfWeek) { timeEvent_Day.Invoke(currentTime); //Debug.Log("add day"); } }
public void Start() { timeEvent_Day?.Invoke(currentTime); timeEvent_Minute?.Invoke(currentTime); timeEvent_Second?.Invoke(currentTime); }
public void Update() { TimeEvent?.Invoke(this, EventArgs.Empty); }
//Increase the time by any amount of minutes public static void IncrementMinutes(int AddedTime) { /* * //Hours, Minutes * int[] AddArray = new int[2]{0,0}; * if (AddedTime < 100) //x or xx * { * AddArray = new int[]{0, AddedTime}; * } * /* * else * { * * float multiplier = AddedTime / 99; * for (int i = 0; i < multiplier; i++) * { * IncrementTime(99); * } * float remainder = multiplier - Mathf.Floor(multiplier); * IncrementTime((int)(remainder*99)); * return; * }*/ /* * else //xxxxxxxxx * { * float ms = AddedTime / 100; * int min = (int) ((ms - Mathf.Floor(ms))*100); * int hours = (int)Mathf.Floor(ms); * //int h = Int32.Parse(AddedTime.ToString()[0].ToString()); * //Debug.Log("is it a byte or "+ h); * AddArray = new int[] {hours, min}; * Debug.Log(AddedTime); * Debug.Log(AddArray[0] + " Hours | Mins " + AddArray[1]); * } */ int Limit = 60; int result = Time[1] + AddedTime; int hours = 0; int days = 0; while (result >= Limit) { result -= Limit; hours++; } Time[1] = result; Time[0] += hours; while (Time[0] >= 24) { Time[0] -= 24; days++; } ProgressDays(days); if (days > 0) { Debug.Log(days + " days have passed"); } TimeChange.Invoke(GetTime()); }
public void Start() { timeTickEvent?.Invoke(currentTime); timeDayEvent?.Invoke(currentTime); }
// Invokes the event private void OnRaiseTimeEvent(TimeEventArgs e) => TimeEvent?.Invoke(this, e);