/// <summary>
    /// Loads the default material for a plane, given its plane type.
    /// Blue wireframe for floor planes and pink wireframe for hit planes.
    /// </summary>
    /// <param name="type">Type of plane based on its orientation and if it's the scene's floor plane.</param>
    /// <returns></returns>
    private Material GetDefaultMaterial(PLANE_TYPE type)
    {
        //Find the default material for the plane type
        Material defaultmaterial = new Material(Resources.Load("Materials/PlaneDetection/Mat_ZED_Geometry_WirePlane") as Material);

        switch (type)
        {
        case PLANE_TYPE.FLOOR:
            //Floor planes are blue
            defaultmaterial.SetColor("_WireColor", new Color(44.0f / 255.0f, 157.0f / 255.0f, 222.0f / 255.0f, 174.0f / 255.0f));
            break;

        case PLANE_TYPE.HIT_HORIZONTAL:
        case PLANE_TYPE.HIT_VERTICAL:
        case PLANE_TYPE.HIT_UNKNOWN:
            // Hit planes are pink
            defaultmaterial.SetColor("_WireColor", new Color(221.0f / 255.0f, 20.0f / 255.0f, 149.0f / 255.0f, 174.0f / 255.0f));
            break;

        default:
            //Misc. planes are white
            defaultmaterial.SetColor("_WireColor", new Color(1, 1, 1, 174.0f / 255.0f));
            break;
        }

        return(defaultmaterial);
    }
Beispiel #2
0
        public MeshObject()
        {
            vaoID_     = 0;
            vboID_     = new uint[3];
            currentFC  = 0;
            needUpdate = false;

            type   = PLANE_TYPE.FLOOR;
            shader = new ShaderData();
        }
Beispiel #3
0
    IEnumerator PlanePurchaseCoroutine(PLANE_TYPE planeType, PURCHASE_TYPE purchaseType, string receiptId, GameObject callback)
    {
        string url = CSocialNetworkManager.baseUrl + "/user_plane_purchase.php";

        WWWForm wwwForm = new WWWForm();

        wwwForm.AddField("user_id", _userInfo._userId.Trim());  // 유저 아이디
        wwwForm.AddField("purchase_type", (int)purchaseType);   // 거래 타입 ( 캐쉬, 포인트)
        wwwForm.AddField("plane_type", (int)planeType);         // 비행기 타입
        wwwForm.AddField("receipt_id", receiptId);              // 영수증 번호

        WWW www = new WWW(url, wwwForm);

        yield return(www);

        if (www.error == null)
        {
            Dictionary <string, object> responseData = MiniJSON.jsonDecode(www.text) as Dictionary <string, object>;

            string result = responseData["result_code"].ToString().Trim();

            if (result == "PURCHASE_SUCCESS")
            {
                Debug.Log("비행기 구매 성공");
                // 유저 정보에 해당 비행기의 구매 상태를 변경함
                _userInfo._planeInfos[(int)planeType]._isPurchase = 1;

                // 만약 포인트 구매일 경우
                if (purchaseType == PURCHASE_TYPE.POINT)
                {
                    // 유저 정보의 종합 별점(포인트) 점수를 감소함
                    _userInfo._totalStarCount -= 1000;
                }
                callback.SendMessage("PlanePurchaseComplete", "비행기 구매 완료");
            }
            else
            {
                Debug.Log("비행기 구매 실패");
                callback.SendMessage("PlanePurchaseComplete", "비행기 구매 실패");
            }
        }
    }
Beispiel #4
0
        public float3 getPlaneColor(PLANE_TYPE type)
        {
            float3 clr = new float3();

            switch (type)
            {
            case PLANE_TYPE.HIT_HORIZONTAL:
                clr = new float3(0.65f, 0.95f, 0.35f);
                break;

            case PLANE_TYPE.HIT_VERTICAL:
                clr = new float3(0.95f, 0.35f, 0.65f);
                break;

            case PLANE_TYPE.HIT_UNKNOWN:
                clr = new float3(0.35f, 0.65f, 0.95f);
                break;

            default:
                clr = new float3(0.65f, 0.95f, 0.35f);
                break;
            }
            return(clr);
        }
Beispiel #5
0
 public void PlanePurchase(PLANE_TYPE planeType, PURCHASE_TYPE purchaseType, string receiptId, GameObject callback)
 {
     StartCoroutine(PlanePurchaseCoroutine(planeType, purchaseType, receiptId, callback));
 }
Beispiel #6
0
 public void updateMesh(Vector3[] vertices, int[] triangles, int nbVertices, int nbTriangles, PLANE_TYPE type, Vector3[] bounds, UserAction userAction)
 {
     meshObject.updateMesh(vertices, triangles, nbVertices, nbTriangles, bounds);
     meshObject.type = type;
     this.userAction = userAction;
 }