コード例 #1
0
    protected override void ApplyData()
    {
        base.ApplyData();

        Mesh mesh = ProceduralMeshBox.GetMesh(new Vector3(_data.width, _data.height, _data.depth),
                                              new Vector3(-_data.width, _data.height, _data.depth),
                                              new Vector3(_data.width, -_data.height, _data.depth),
                                              new Vector3(-_data.width, -_data.height, _data.depth),
                                              new Vector3(_data.width, _data.height, -_data.depth),
                                              new Vector3(-_data.width, _data.height, -_data.depth),
                                              new Vector3(_data.width, -_data.height, -_data.depth),
                                              new Vector3(-_data.width, -_data.height, -_data.depth));


        _components.meshRenderer.sharedMaterial = MaterialHead.instance.GetMaterial(_data.color.color, MaterialType.basic);

        _components.meshFilter.sharedMesh = mesh;

        _components.meshCollider.sharedMesh = mesh;
    }
コード例 #2
0
 private void OnDrawGizmos()
 {
     _components.meshFilter.mesh = ProceduralMeshBox.GetMesh(trf, tlf, brf, blf, trb, tlb, brb, blb);
 }