public override void Process() { base.Process(); NiParent.Material.EnableKeyword(vertexMode.ToString()); NiParent.Material.EnableKeyword(lightingMode.ToString()); //NiParent.Material.EnableKeyword() }
/// <summary> /// Returns Visibility.Visible if the value matches the parameter. Returns Visibility.Collapsed /// otherwise. /// </summary> /// <param name="value">The LightMode to convert.</param> /// <param name="targetType">Unused.</param> /// <param name="parameter">The string value of the LightMode value checked against.</param> /// <param name="language">Unused.</param> /// <returns>Visibility</returns> public object Convert(object value, Type targetType, object parameter, string language) { LightMode lightMode = (LightMode)value; String refMode = parameter.ToString().Trim(); bool match = refMode.Equals(lightMode.ToString()); return(match ? Visibility.Visible : Visibility.Collapsed); }
// Use this for initialization void Start() { _anim = GetComponent <Animator>(); if (_anim != null) { if (_anim.runtimeAnimatorController == null) { _anim.runtimeAnimatorController = controller; } if (mode != LightMode.none) { _anim.SetTrigger(mode.ToString()); } } }
public XmlElement Save(XmlDocument doc) { XmlElement me = doc.CreateElement("pass"); me.SetAttribute("name", Name); if (IsSM3.HasValue) { me.SetAttribute("sm3", IsSM3.Value ? "true" : "false"); } if (IsDesktop.HasValue) { me.SetAttribute("desktop", IsDesktop.Value ? "true" : "false"); } if (VS != null && VS.Length > 0) { me.SetAttribute("vs", VS); } if (PS != null && PS.Length > 0) { me.SetAttribute("ps", PS); } if (VSDefines.Count > 0) { me.SetAttribute("vsdefines", string.Join(" ", VSDefines.ToArray())); } if (PSDefines.Count > 0) { me.SetAttribute("psdefines", string.Join(" ", PSDefines.ToArray())); } me.SetAttribute("lighting", LightMode.ToString().ToLower()); me.SetAttribute("blend", BlendMode.ToString().ToLower()); me.SetAttribute("depthtest", DepthTest.ToString().ToLower()); me.SetAttribute("depthwrite", DepthWrite ? "true" : "false"); me.SetAttribute("alphamask", AlphaMask ? "true" : "false"); return(me); }
public string SelectedMode() { return(LightMode.ToString()); }