/// <summary> /// Gets additional flags of the caller routine. /// </summary> public static RoutineFlags InvocationFlags(this IPhpRoutineSymbol routine) { RoutineFlags f = RoutineFlags.None; var ps = routine.Parameters; foreach (var p in ps) { if (p.IsImplicitlyDeclared) { if (SpecialParameterSymbol.IsLocalsParameter(p)) { f |= RoutineFlags.UsesLocals; } else if (SpecialParameterSymbol.IsCallerArgsParameter(p)) { f |= RoutineFlags.UsesArgs; } else if (SpecialParameterSymbol.IsCallerStaticClassParameter(p)) { f |= RoutineFlags.UsesLateStatic; } } else { break; } } return(f); }
/// <summary> /// Gets additional flags of the caller routine. /// </summary> public static RoutineFlags InvocationFlags(this IPhpRoutineSymbol routine) { RoutineFlags f = RoutineFlags.None; var ps = routine.Parameters; foreach (var p in ps) { if (p.IsImplicitlyDeclared) { if (SpecialParameterSymbol.IsQueryValueParameter(p, out var ctor, out var container)) { switch (container) { case SpecialParameterSymbol.QueryValueTypes.CallerArgs: f |= RoutineFlags.UsesArgs; break; case SpecialParameterSymbol.QueryValueTypes.LocalVariables: f |= RoutineFlags.UsesLocals; break; } } else if (SpecialParameterSymbol.IsCallerStaticClassParameter(p)) { f |= RoutineFlags.UsesLateStatic; } }
CoroutineHandle StartInternal(IEnumerator enumerator, Component attachTo, RoutineFlags flags = RoutineFlags.None) { if (enumerator == null) { throw new ArgumentNullException("routine"); } if (attachTo != null && !attachTo.gameObject.activeInHierarchy) { Dbg.LogError( attachTo, "Coroutine couldn't be started because the the game object '{0}' is inactive!", GarbageCache.GetName(attachTo.gameObject) ); return(new CoroutineHandle()); } var routine = new Routine( id: ++idCounter, flags: flags, enumerator: enumerator, attachedTo: attachTo ); bool started = Resolve(ref routine, cameFromPostRender: false); return(new CoroutineHandle( id: started?routine.id: 0 )); }
public ZilRoutine([CanBeNull] ZilAtom name, [CanBeNull] ZilAtom activationAtom, [NotNull] IEnumerable <ZilObject> argspec, [ItemNotNull][NotNull] IEnumerable <ZilObject> body, RoutineFlags flags) { Name = name; ArgSpec = ArgSpec.Parse("ROUTINE", name, activationAtom, argspec); this.body = body.ToArray(); Flags = flags; }
public Routine(int id, RoutineFlags flags, IEnumerator enumerator, Component attachedTo) { this.id = id; this.flags = flags; this.enumerator = enumerator; this.attachedTo = attachedTo; this.lastFrame = -1; this.delay = -1.0f; }