当前位置: 首页>>代码示例>>C#>>正文


C# Decal类代码示例

本文整理汇总了C#中Decal的典型用法代码示例。如果您正苦于以下问题:C# Decal类的具体用法?C# Decal怎么用?C# Decal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Decal类属于命名空间,在下文中一共展示了Decal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VirindiViewsPresent

        static bool VirindiViewsPresent(Decal.Adapter.Wrappers.PluginHost pHost)
        {
#if VVS_REFERENCED
            System.Reflection.Assembly[] asms = AppDomain.CurrentDomain.GetAssemblies();

            foreach (System.Reflection.Assembly a in asms)
            {
                AssemblyName nmm = a.GetName();
                if ((nmm.Name == "VirindiViewService") && (nmm.Version >= new System.Version("1.0.0.37")))
                {
                    try
                    {
                        return Curtain_VVS_Running();
                    }
                    catch
                    {
                        return false;
                    }
                }
            }

            return false;
#else
            return false;
#endif
        }
开发者ID:Kkarinisme,项目名称:Handyman,代码行数:26,代码来源:ViewSystemSelector.cs

示例2: CharacterFilter_ChangePortalMode

 private void CharacterFilter_ChangePortalMode(object sender, Decal.Adapter.Wrappers.ChangePortalModeEventArgs e)
 {
     if (e.Type == this._expectedPortalEventType)
     {
         this._event.Set();
     }
 }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:7,代码来源:PortalSpaceWaiter.cs

示例3: BuildDecalForObject

    public static void BuildDecalForObject(Decal decal, GameObject affectedObject)
    {
        Mesh affectedMesh = affectedObject.GetComponent<MeshFilter>().sharedMesh;
        if(affectedMesh == null) return;

        float maxAngle = decal.maxAngle;

        Plane right = new Plane( Vector3.right, Vector3.right/2f );
        Plane left = new Plane( -Vector3.right, -Vector3.right/2f );

        Plane top = new Plane( Vector3.up, Vector3.up/2f );
        Plane bottom = new Plane( -Vector3.up, -Vector3.up/2f );

        Plane front = new Plane( Vector3.forward, Vector3.forward/2f );
        Plane back = new Plane( -Vector3.forward, -Vector3.forward/2f );

        Vector3[] vertices = affectedMesh.vertices;
        int[] triangles = affectedMesh.triangles;
        int startVertexCount = bufVertices.Count;

        Matrix4x4 matrix = decal.transform.worldToLocalMatrix * affectedObject.transform.localToWorldMatrix;

        for(int i=0; i<triangles.Length; i+=3) {
            int i1 = triangles[i];
            int i2 = triangles[i+1];
            int i3 = triangles[i+2];

            Vector3 v1 = matrix.MultiplyPoint( vertices[i1] );
            Vector3 v2 = matrix.MultiplyPoint( vertices[i2] );
            Vector3 v3 = matrix.MultiplyPoint( vertices[i3] );

            Vector3 side1 = v2 - v1;
            Vector3 side2 = v3 - v1;
            Vector3 normal = Vector3.Cross(side1, side2).normalized;

            if( Vector3.Angle(-Vector3.forward, normal) >= maxAngle ) continue;

            DecalPolygon poly = new DecalPolygon( v1, v2, v3 );

            poly = DecalPolygon.ClipPolygon(poly, right);
            if(poly == null) continue;
            poly = DecalPolygon.ClipPolygon(poly, left);
            if(poly == null) continue;

            poly = DecalPolygon.ClipPolygon(poly, top);
            if(poly == null) continue;
            poly = DecalPolygon.ClipPolygon(poly, bottom);
            if(poly == null) continue;

            poly = DecalPolygon.ClipPolygon(poly, front);
            if(poly == null) continue;
            poly = DecalPolygon.ClipPolygon(poly, back);
            if(poly == null) continue;

            AddPolygon( poly, normal );
        }

        GenerateTexCoords(startVertexCount, decal.sprite);
    }
开发者ID:Jalict,项目名称:MED5-PGP-P1,代码行数:59,代码来源:DecalBuilder.cs

示例4: InitializeRawXML

 public void InitializeRawXML(Decal.Adapter.Wrappers.PluginHost p, string pXML, string pWindowKey)
 {
     VirindiViewService.XMLParsers.Decal3XMLParser ps = new VirindiViewService.XMLParsers.Decal3XMLParser();
     ViewProperties iprop;
     ControlGroup igroup;
     ps.Parse(pXML, out iprop, out igroup);
     myView = new VirindiViewService.HudView(iprop, igroup, pWindowKey);
 }
开发者ID:Kkarinisme,项目名称:Mishna,代码行数:8,代码来源:Wrapper_MyHuds.cs

示例5: _decalEvents_SpellCast

 void _decalEvents_SpellCast(object sender, Decal.Adapter.Wrappers.SpellCastEventArgs e)
 {
     switch (e.SpellId)
     {
         case Data.SpellIds.LifestoneRecall:
             this.OnSelfLifestoneRecall();
             break;
     }
 }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:9,代码来源:MasterOrSlaveReactions.cs

示例6: CharacterFilter_Login

		void CharacterFilter_Login(object sender, Decal.Adapter.Wrappers.LoginEventArgs e)
		{
			try
			{
				if (!Settings.SettingsManager.Misc.RemoveWindowFrame.Value)
					return;

				RemoveWindowFrame();
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
开发者ID:IbespwnAC,项目名称:MagTools,代码行数:11,代码来源:WindowFrameRemover.cs

示例7: CharacterFilter_Death

		void CharacterFilter_Death(object sender, Decal.Adapter.Wrappers.DeathEventArgs e)
		{
			try
			{
				if (!Settings.SettingsManager.Misc.LogOutOnDeath.Value)
					return;

				CoreManager.Current.Actions.Logout();
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
开发者ID:IbespwnAC,项目名称:MagTools,代码行数:11,代码来源:LogOutOnDeath.cs

示例8: CoreManager_ChatBoxMessage

 void CoreManager_ChatBoxMessage(object sender, Decal.Adapter.ChatTextInterceptEventArgs e)
 {
     REPlugin.Instance.InvokeOperationSafely(() =>
     {
         ChatEvent chatEvent;
         if (ChatEvent.TryParse(e.Text, out chatEvent))
         {
             this.HandleChatEvent(chatEvent);
         }
     });
 }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:11,代码来源:GameEventResponseDispatcher.cs

示例9: GenerateUV

	private void GenerateUV(Decal d)
	{
		if(d.GetComponent<MeshFilter>() == null) return;
		
		Mesh m = d.GetComponent<MeshFilter>().sharedMesh;
		
		Vector2[] uv = Unwrapping.GeneratePerTriangleUV(m);
			
        MeshUtility.SetPerTriangleUV2(m, uv);

        Unwrapping.GenerateSecondaryUVSet(m);
	}
开发者ID:EvilAbyss,项目名称:Wulfram,代码行数:12,代码来源:DecalEditor.cs

示例10: IsPresent

        ///////////////////////////////System presence detection///////////////////////////////

        public static bool IsPresent(Decal.Adapter.Wrappers.PluginHost pHost, eViewSystem VSystem)
        {
            switch (VSystem)
            {
                case eViewSystem.DecalInject:
                    return true;
                case eViewSystem.VirindiViewService:
                    return VirindiViewsPresent(pHost);
                default:
                    return false;
            }
        }
开发者ID:Kkarinisme,项目名称:Handyman,代码行数:14,代码来源:ViewSystemSelector.cs

示例11: ChangePortalModeCorpses

        private void ChangePortalModeCorpses(object sender, Decal.Adapter.Wrappers.ChangePortalModeEventArgs e)
        {
            try
            {
                CorpseTrackingList.Clear();
                foreach(WorldObject wo in Core.WorldFilter.GetByObjectClass(ObjectClass.Corpse))
                {
                    if(!CorpseTrackingList.Any(x => x.Id == wo.Id)){CheckCorpse(new LandscapeObject(wo));}
                }
             		UpdateCorpseHud();

            }catch(Exception ex){LogError(ex);}
        }
开发者ID:Kkarinisme,项目名称:GearTemp,代码行数:13,代码来源:CorpseTracker.cs

示例12: _decalEventsProxy_ChatBoxMessage

 void _decalEventsProxy_ChatBoxMessage(object sender, Decal.Adapter.ChatTextInterceptEventArgs e)
 {
     ICommand command;
     if (CommandHelpers.TryParse(e, out command))
     {
         switch (command.CommandType)
         {
             case CommandType.Foreign:
                 // Never eat ...Then I can't see the /f messages i'm causing...while others still can
                 Handlers.ForeignHandler.HandleCommand(command);
                 break;
         }
     }
 }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:14,代码来源:CommandListener.cs

示例13: _decalEventsProxy_CommandLineText

 void _decalEventsProxy_CommandLineText(object sender, Decal.Adapter.ChatParserInterceptEventArgs e)
 {
     ICommand command;
     if (CommandHelpers.TryParse(e, out command))
     {
         switch (command.CommandType)
         {
             case CommandType.RedoxExtension:
                 e.Eat = Handlers.RedoxExtensionsHandler.HandleCommand(command);
                 break;
             case CommandType.RedoxFellow:
                 e.Eat = Handlers.RedoxFellowHandler.HandleCommand(command);
                 break;
         }
     }
 }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:16,代码来源:CommandListener.cs

示例14: CharacterFilter_Login

		void CharacterFilter_Login(object sender, Decal.Adapter.Wrappers.LoginEventArgs e)
		{
			try
			{
				WindowPosition windowPosition;

				if (GetWindowPositionForThisClient(out windowPosition))
				{
					User32.RECT rect = new User32.RECT();

					User32.GetWindowRect(CoreManager.Current.Decal.Hwnd, ref rect);

					User32.MoveWindow(CoreManager.Current.Decal.Hwnd, windowPosition.X, windowPosition.Y, rect.Right - rect.Left, rect.Bottom - rect.Top, true);
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
开发者ID:IbespwnAC,项目名称:MagTools,代码行数:17,代码来源:WindowMover.cs

示例15: DecalCore_CommandLineText

        private void DecalCore_CommandLineText(object sender, Decal.Adapter.ChatParserInterceptEventArgs e)
        {
            REWrapperPlugin.Instance.InvokeOperationSafely(() =>
            {
                if (e.Text.StartsWith(CommandPrefix_Legacy))
                {
                    var command = e.Text.Substring(CommandPrefix_Legacy.Length + 1).Trim();

                    e.Eat = this.HandleNormalCommand(command, true);
                }
                else if (e.Text.StartsWith(CommandPrefix))
                {
                    var command = e.Text.Substring(CommandPrefix.Length + 1).Trim();

                    e.Eat = this.HandleNormalCommand(command, false);
                }
            });
        }
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:18,代码来源:WrapperCommandListener.cs


注:本文中的Decal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。