本文整理汇总了C#中CallBack.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# CallBack.Invoke方法的具体用法?C# CallBack.Invoke怎么用?C# CallBack.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CallBack
的用法示例。
在下文中一共展示了CallBack.Invoke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Change
/// <summary>
/// Изменяет аттрибуты календарного дня
/// </summary>
/// <param name="calendarDayDescription">Расшифровка календарного дня</param>
/// <param name="calendarWorkDayAttribute">Аттрибуты календарного дня</param>
/// <param name="calendarDayComment">Комментарий</param>
/// <param name="calendarDay">структура, календарный день, переданная по ссылке</param>
/// <param name="callBackMetod">Метод, запускаемый при изменнени аттрибутов календарного дня</param>
public static void Change(CalendarDayDescription calendarDayDescription,
WorkDayAttribute calendarWorkDayAttribute,
string calendarDayComment, ref CalendarDay calendarDay, CallBack callBackMetod)
{
calendarDay.ChangeCalendarDayAttribute(calendarWorkDayAttribute);
calendarDay.ChangeCaledarDayDescription(calendarDayDescription);
calendarDay.CalendarDayComment = calendarDayComment;
// Если указан делегат, то выполняем его
if (callBackMetod != null) callBackMetod.Invoke();
}
示例2: EaseCoroutine
//.........这里部分代码省略.........
Debug.LogError("Easing with incorrect parameters");
}
else
{
// Start the easing...
float timeScale = 1.0f / easeTime;
float time = 0;
while (time < 1)
{
// Wait until the next frame
yield return null;
// Advance iterator and solve easing for this frame
time += Time.deltaTime * timeScale;
switch (property)
{
case EaseProperty.POSITION:
{
source.localPosition = VecEaseInOut((Vector3)orig, (Vector3)target, time, easeIn, easeOut);
break;
}
case EaseProperty.ROTATION:
{
Vector3 a = ((Quaternion)orig).eulerAngles;
Vector3 b = ((Quaternion)target).eulerAngles;
while (Mathf.Abs(a.x - b.x) > 180)
{
if (a.x - b.x < 0)
{
b.x -= 360;
}
else
{
b.x += 360;
}
}
while (Mathf.Abs(a.y - b.y) > 180)
{
if (a.z - b.z < 0)
{
b.z -= 360;
}
else
{
b.z += 360;
}
}
while (Mathf.Abs(a.z - b.z) > 180)
{
if (a.z - b.z < 0)
{
b.z -= 360;
}
else
{
b.z += 360;
}
}
source.localRotation = Quaternion.Euler(VecEaseInOut(a, b,
time, easeIn, easeOut));
break;
}
case EaseProperty.SCALE:
{
source.localScale = VecEaseInOut((Vector3)orig, (Vector3)target, time, easeIn, easeOut);
break;
}
}
}
// Once the time has elapsed set the property to the final value
switch (property)
{
case EaseProperty.POSITION:
{
source.localPosition = (Vector3)target;
break;
}
case EaseProperty.ROTATION:
{
source.localRotation = (Quaternion)target;
break;
}
case EaseProperty.SCALE:
{
source.localScale = (Vector3)target;
break;
}
}
}
// If we got a callback method, call it
if (callback != null)
{
callback.Invoke();
}
// End the coroutine!
yield break;
}