/// <summary> /// Finds or creates the RoutineIdentity for the given GameObject. /// </summary> static public RoutineIdentity Require(GameObject inGameObject) { RoutineIdentity obj = Find(inGameObject); if (obj == null) { obj = inGameObject.AddComponent <RoutineIdentity>(); } return(obj); }
/// <summary> /// Finds or creates the RoutineIdentity for the given behaviour. /// </summary> static public RoutineIdentity Require(MonoBehaviour inBehaviour) { RoutineIdentity obj = Find(inBehaviour.gameObject); if (obj == null) { obj = inBehaviour.gameObject.AddComponent <RoutineIdentity>(); } return(obj); }
static private void RegisterIdentity(RoutineIdentity inIdentity) { int key = inIdentity.gameObject.GetInstanceID(); if (s_IdentityRegistry.ContainsKey(key)) { return; } s_IdentityRegistry.Add(key, inIdentity); }
/// <summary> /// Calculates the time scale for the given object. /// </summary> static public float CalculateTimeScale(RoutineIdentity inIdentity) { Manager m = Manager.Get(); if (m != null) { if (inIdentity != null) { return(m.GetTimescale(inIdentity.Group) * m.TimeScale * inIdentity.TimeScale); } return(m.TimeScale); } return(1.0f); }
/// <summary> /// Calculates the time scale for the given object. /// </summary> static public float CalculateTimeScale(GameObject inObject) { Manager m = Manager.Get(); if (m != null) { RoutineIdentity identity = RoutineIdentity.Find(inObject); if (identity != null) { return(m.GetTimescale(identity.Group) * m.TimeScale * identity.TimeScale); } return(m.TimeScale); } return(1.0f); }
static private void UnregisterIdentity(RoutineIdentity inIdentity) { int key = inIdentity.gameObject.GetInstanceID(); s_IdentityRegistry.Remove(key); }
public TweenData_RoutineIdentity_TimeScale(RoutineIdentity inIdentity, float inTarget) { m_Identity = inIdentity; m_Target = inTarget; }
/// <summary> /// Changes the TimeScale of the RoutineIdentity on this GameObject. /// </summary> static public Tween TimeScaleTo(this GameObject inGameObject, float inTarget, TweenSettings inSettings) { return(Tween.Create(new TweenData_RoutineIdentity_TimeScale(RoutineIdentity.Require(inGameObject), inTarget), inSettings)); }
/// <summary> /// Changes the TimeScale of the RoutineIdentity. /// </summary> static public Tween TimeScaleTo(this RoutineIdentity inIdentity, float inTarget, TweenSettings inSettings) { return(Tween.Create(new TweenData_RoutineIdentity_TimeScale(inIdentity, inTarget), inSettings)); }