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


C# UnityEngine.Contains方法代码示例

本文整理汇总了C#中UnityEngine.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# UnityEngine.Contains方法的具体用法?C# UnityEngine.Contains怎么用?C# UnityEngine.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine的用法示例。


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

示例1: CheckChild

		static private bool CheckChild(SerializedProperty property)
		{
			var types = new [] {
				SerializedPropertyType.String,
				SerializedPropertyType.Color,
				SerializedPropertyType.Vector2,
				SerializedPropertyType.Vector3,
				SerializedPropertyType.Quaternion,
				SerializedPropertyType.ObjectReference,
			};
			return !types.Contains(property.propertyType);
		}
开发者ID:hubatish,项目名称:barVR,代码行数:12,代码来源:PEModificationsExt.cs

示例2: DrawPreview

	public bool DrawPreview(UnityEngine.Rect position) {
		UnityEngine.Texture texture = GetTexture();
		if(texture != null) UnityEngine.GUI.DrawTextureWithTexCoords(position, texture, GetPreviewFace());
		return UnityEngine.Event.current.type == UnityEngine.EventType.MouseDown && position.Contains(UnityEngine.Event.current.mousePosition);
	}
开发者ID:ngeiswei,项目名称:unity3d-opencog-game,代码行数:5,代码来源:OCBlock.cs

示例3: ButtonBase

        private static bool ButtonBase(UnityEngine.Rect bounds, GUIContent content, bool on, GUIStyle style, bool forceOnTop)
        {
            Contract.ArgumentNotNull("style", style);

            int controlID = GUIUtility.GetControlID(content, FocusType.Passive);
            bool isMouseOver = bounds.Contains(Event.current.mousePosition);
            int depth = (1000 - GUI.depth) * 1000 + (forceOnTop ? 10000 : controlID);
            if (isMouseOver && depth > highestDepthID)
            {
                highestDepthID = depth;
            }
    
            bool isTopmostMouseOver = (highestDepthID == depth);
    
    #if (UNITY_IPHONE || UNITY_ANDROID)  && !UNITY_EDITOR
            bool paintMouseOver = isTopmostMouseOver && (Input.touchCount > 0);
    #else
            bool paintMouseOver = isTopmostMouseOver;
    
    #endif
    
            if ( Event.current.type == EventType.Layout && lastEventType != EventType.Layout )
            {
                highestDepthID = 0;
                frame++;
            }
    
            lastEventType = Event.current.type;
            if (Event.current.type == EventType.Repaint)
            {
                bool isDown = (GUIUtility.hotControl == controlID);
                style.Draw(bounds, content, paintMouseOver, isDown, on, false);
            }

    #if (UNITY_IPHONE || UNITY_ANDROID)  && !UNITY_EDITOR
            if ( Input.touchCount > 0 )
            {
                Touch touch = Input.GetTouch(0);
                if ( touch.phase == TouchPhase.Began )
                {
                    touchBeganPosition = touch.position;
                    wasDragging = true;
                }
                else if ( touch.phase == TouchPhase.Ended
                        && ((Mathf.Abs(touch.position.x - touchBeganPosition.x) > 15)
                            || (Mathf.Abs(touch.position.y - touchBeganPosition.y) > 15)))
                {
                    wasDragging = true;
                }
                else
                {
                    wasDragging = false;
                }
            }
            else if ( Event.current.type == EventType.Repaint )
            {
                wasDragging = false;
            }
    #endif
    
            // Workaround:
            // ignore duplicate mouseUp events. These can occur when running
            // unity editor with unity remote on iOS ... (anybody knows WHY?)
            if ( frame <= (1+lastEventFrame) )
            {
                return false;
            }

            if (isMouseOver)
            {
                switch (Event.current.GetTypeForControl(controlID))
                {
                    case EventType.mouseDown:
                    {
                        //DebugLog.Info("UnityButton: Mouse DOWN over controlID={0} isTopmostMouseOver={1} depth={2} highest depth={3} wasDragging={4} content={5}",
                        //controlID, isTopmostMouseOver, depth, highestDepthID, wasDragging, content.text);
                        if (isTopmostMouseOver && !wasDragging)
                        {
                            GUIUtility.hotControl = controlID;
                            Event.current.Use();
                        }
                        break;
                    }
    
                    case EventType.mouseUp:
                    {
                        //DebugLog.Info("UnityButton: Mouse UP over controlID={0} isTopmostMouseOver={1} depth={2} highest depth={3} wasDragging={4} content={5}",
                        //controlID, isTopmostMouseOver, depth, highestDepthID, wasDragging, content.text);
                        if (isTopmostMouseOver && !wasDragging)
                        {
                            GUIUtility.hotControl = 0;
                            lastEventFrame = frame;
                            Event.current.Use();
                            return true;
                        }
                        break;
                    }
                }
            }

//.........这里部分代码省略.........
开发者ID:rtaylornc,项目名称:IntelliMediaCore,代码行数:101,代码来源:UnityButton.cs


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