public MessageFlag(EFlag value) { if (value == EFlag.NonStandart) { throw new ArgumentException("Can't create non standart flag without name. Use ImapMessageFlag(string) constructor.", "value"); } this._type = value; }
// External public void SetFlag(EFlag inFlag, bool inState, float inDuration = 0.0f, bool inNetTransfer = false) { if (inNetTransfer) { photonView.RPC("NetSetFlag", PhotonTargets.All, inFlag, inState, inDuration); } else { NetSetFlag(inFlag, inState, inDuration); } }
public MessageFlag(string value) { Regex regex = new Regex(@"\A(\w+|\*?)\Z"); if (!regex.IsMatch(value)) { throw new FormatException("Flag name doesn't match required format"); } if (string.IsNullOrEmpty(value)) { throw new ArgumentException("Flag name can't be null or an empty string", "value"); } this._type = FromString(value); this.flagString = value; }
void NetSetFlag(EFlag inFlag, bool inState, float inDuration = 0.0f) { _flags[inFlag] = inState; // Start a duration coroutine, and overwrite any earlier duration coroutine of the same type if (inDuration > 0) { _flagHandles[inFlag] = Timing.RunCoroutineSingleton(HandleDuration(inFlag, inDuration, inState), _flagHandles[inFlag], SingletonBehavior.Overwrite); } // If the flag is set without a duration and a duration coroutine is going, kill the coroutine else { Timing.KillCoroutines(_flagHandles[inFlag]); } }
private void SetFlags(bool @value, EFlag flag) { if (@value) { if (!this._flags.Exists(o => o.Type == flag)) { this._flags.Add(new MessageFlag(flag)); } } else { if (this._flags.Exists(o => o.Type == flag)) { MessageFlag messageFlag = this._flags.Find(o => o.Type == flag); this._flags.Remove(messageFlag); } } }
private bool ShouldExecute(Shader shader, EFlag flags) { var path = UnityEditor.AssetDatabase.GetAssetPath(shader).ToLower(); bool isBuiltIn = false; bool isPackage = false; isBuiltIn = IsBuiltInShader(path); if (flags.HasFlag(EFlag.BuiltIn) && isBuiltIn) { return(true); } isPackage = IsPackageShader(path); if (flags.HasFlag(EFlag.Packages) && isPackage) { return(true); } if (flags.HasFlag(EFlag.Assets) && !isBuiltIn && !isPackage) { return(true); } return(false); }
public BaseObject(uint objectKey) { this.m_objectKey = objectKey; this.m_roleType = ERoleType.None; this.m_flag = EFlag.None; }
IEnumerator <float> HandleDuration(EFlag inFlag, float inDuration, bool inState) { yield return(Timing.WaitForSeconds(inDuration)); SetFlag(inFlag, !inState); }
public bool GetFlag(EFlag inFlag) { return(_flags[inFlag]); }
public bool Contains(EFlag flag) { return(base.Contains(new MessageFlag(flag))); }
public SystemVariable(string name, EFlag flag) { this.Name = name; this.Flag = flag; }
public List <ShaderVariantCollection.ShaderVariant> CreateShaderVariantList(EFlag flags) { List <ShaderVariantCollection.ShaderVariant> shaderVariants = new List <ShaderVariantCollection.ShaderVariant>(); var shaderInstance = Shader.Find(this.shader); if (shaderInstance == null) { Debug.LogError("Shader not found " + this.shader); return(shaderVariants); } if (!ShouldExecute(shaderInstance, flags)) { return(shaderVariants); } foreach (var info in shaderDrawInfo) { string[] keywordArray; if (string.IsNullOrEmpty(info.keywords)) { keywordArray = new string[] { "" }; } else { keywordArray = info.keywords.Split(' '); } try { var passType = GetPassType(info.passLightMode); // Debug.Log(info.passLightMode + "->" + passType); ShaderVariantCollection.ShaderVariant variant = new ShaderVariantCollection.ShaderVariant(shaderInstance, passType, keywordArray); shaderVariants.Add(variant); } catch (System.Exception e) { Debug.LogError(e); } } return(shaderVariants); }
private ShaderVariantCollectionCreator(EFlag flags) { this.variantFlags = flags; }
public static void AddFromScannedData(ShaderVariantCollection shaderVariantCollection, EFlag flags) { var obj = new ShaderVariantCollectionCreator(flags); obj.AddToShaderVariantCollection(shaderVariantCollection); }
internal UnloadSceneOperation(Scene scene) { _flag = EFlag.Normal; _scene = scene; }
internal UnloadSceneOperation(string error) { _flag = EFlag.Error; Error = error; }