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


C# Transform.Equals方法代码示例

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


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

示例1: inHits

 bool inHits(Transform t)
 {
     foreach (RaycastHit hit in hits) {
         if (t.Equals(hit.transform)) {
             return true;
         }
     }
     return false;
 }
开发者ID:PaulMilla,项目名称:2Dcapstone,代码行数:9,代码来源:HideObjects.cs

示例2: DisplayInstanceMesh

        /// <summary>
        /// Creates an instance of a DisplayMesh with a new transform.
        /// </summary>
        public DisplayInstanceMesh(DisplayMesh mesh, Transform xform)
        {
            Mesh = mesh;
            IsVisible = mesh.IsVisible;
            LayerIndex = mesh.LayerIndex;
            m_xform = xform;

            Transform zeroXForm = CreateZeroTransform ();

            if (m_xform.Equals(zeroXForm))
                m_xform = Transform.Identity;
        }
开发者ID:HovAvet,项目名称:RhinoMobile,代码行数:15,代码来源:DisplayInstanceMesh.cs

示例3: ExplodeIntoArray

        /// <summary>
        /// Explodes a list of DisplayObjects into DisplayMeshes
        /// </summary>
        public new void ExplodeIntoArray(RMModel model, List<DisplayObject> array, Transform xform)
        {
            bool isIdentityXform = xform.Equals (Transform.Identity);

            if (DisplayMeshes == null)
                return;

            foreach (DisplayMesh mesh in DisplayMeshes) {
                if (isIdentityXform) {
                    mesh.IsVisible = Visible;
                    mesh.LayerIndex = LayerIndex;
                    array.Add (mesh);
                } else {
                    DisplayInstanceMesh instanceMesh = new DisplayInstanceMesh (mesh, xform);
                    instanceMesh.IsVisible = Visible;
                    instanceMesh.LayerIndex = LayerIndex;
                    array.Add (instanceMesh);
                }
            }
        }
开发者ID:HovAvet,项目名称:RhinoMobile,代码行数:23,代码来源:ModelMesh.cs

示例4: BuildObjectOnSide

    /*
    //creates a square and puts it on the correct side (as determined by vector from the center of the cube)
    GameObject BuildObjectOnSide(Transform localObject, Vector3 vector){
        GameObject square =  Instantiate(cubePrefab, localObject.transform.position, localObject.transform.rotation) as GameObject;
        square.transform.parent = this.transform;
        square.transform.localScale = localObject.localScale;
        //moved the created object to the correct side
        square = moveObjectToSide (localObject, vector, square);

        return square;
        }*/
    // Update is called once per frame
    void Update()
    {
        //send a ray from the center of the screen to the object
        Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));
        RaycastHit hit = new RaycastHit();
        //if the ray hits the object, then do stuff
        if (Physics.Raycast(ray, out hit, maxPickingDistance))
        {
            //retrieve the object that was hit
            pickedObject = hit.transform;
            Vector3 pos = hit.point;

            //place the cubeFinger at the correct location (or remove it if it shouldn t be seen)
            if(pickedObject.Equals(cubeFinger.transform)){
                //if the objects hits the cubeFinger, it is in the right place already.
                //so don t do anything
            }
            else{
                //if it hits a new block, move the blockfinger there
                cubeFinger.SetActive(true);
                moveObjectToSide(pickedObject, pos, cubeFinger);
            }

            //if a build action is given, place the block at the cubefinger location
            if (Input.GetMouseButtonDown (0) && cubeFinger.activeInHierarchy) {
                placeSquareAtFinger();
                //disable cubefinger, so it is placed in it s shiny new good position on next update
                cubeFinger.SetActive(false);
            }

        }
        else
        {
            //if the trace did not hit anything, there is no sense in having a cubefinger enabled
            cubeFinger.SetActive(false);
            pickedObject = null;
        }
    }
开发者ID:jdacamara,项目名称:game1,代码行数:50,代码来源:TouchBehaviour.cs

示例5: findRandomTarget

    public static Transform findRandomTarget(Transform myTeam)
    {
        Transform team = myTeam.Equals(teamEins) ? teamZwei : teamEins;

        return team.GetChild(Random.Range(0, team.childCount));
    }
开发者ID:Failender,项目名称:Spaceship,代码行数:6,代码来源:Helper.cs


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