예제 #1
0
    // Use this for initialization
	public void Start () 
    {
        _cameraZoom = Camera.main.GetComponent<CameraShifter>();
        if (_cameraZoom == null)
        {
            Debug.LogWarning("No CameraShifter attached to the Main Camera, please attach it!");
        }

        defaultStyle = new GUIStyle();
        defaultStyle.margin = new RectOffset(5, 3, 3, 3);
        
        
        snapshotStyle = new GUIStyle(defaultStyle);
        snapshotStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "capture_normal");
        snapshotStyle.hover.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "capture_hover");
        snapshotStyle.active.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "capture_normal");

        snapshotDisabledStyle = new GUIStyle();
        snapshotDisabledStyle.normal.background = ResourceManager.Instance.LoadTexture2D("GUI/HUD/snapshot_disabled");

        dollyHeadStyle = new GUIStyle(defaultStyle);
        dollyHeadStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_head_normal");
        dollyHeadStyle.hover.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_head_hover");
        dollyHeadStyle.active.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_head_active");

        dollyBodyStyle = new GUIStyle(defaultStyle);
        dollyBodyStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_body_normal");
        dollyBodyStyle.hover.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_body_hover");
        dollyBodyStyle.active.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_body_active");

        dollyResetStyle = new GUIStyle(defaultStyle);
        dollyResetStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_reset_normal");
        dollyResetStyle.hover.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_reset_hover");
        dollyResetStyle.active.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_reset_active");

        dollyFootStyle = new GUIStyle(defaultStyle);
        dollyFootStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_foot_normal");
        dollyFootStyle.hover.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_foot_hover");
        dollyFootStyle.active.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "dolly_foot_active");

        toolBarStyle = new GUIStyle();
        toolBarStyle.normal.background = ResourceManager.Instance.LoadTexture2D(HUD_DOLLY_PATH + "bg");

        _tooltipStyle = new GUIStyle();
        _tooltipStyle.fontSize = 13;
        _tooltipStyle.font = ResourceManager.Instance.LoadFont("GUI/Fonts/DroidSans");
        _tooltipStyle.normal.background = ResourceManager.Instance.LoadTexture2D("GUI/HUD/hintBox");
        _tooltipStyle.normal.textColor = Color.white;
        _tooltipStyle.padding = new RectOffset(3, 3, 3, 3);
	}
예제 #2
0
    protected void Start()
    {
        if (dollyBody != null && dollyFeet != null && dollyHead != null &&
            dollyReset != null && capture != null)
        {
            isReady = true;
        }
        else
        {
            Debug.LogWarning("Dolly Buttons is net set on DollyController");
        }

        cameraZoom = Camera.main.GetComponent<CameraShifter>();
        if (cameraZoom == null)
        {
            Debug.LogWarning("No CameraShifter attached to the Main Camera, please attach it!");
        }
    }
예제 #3
0
 public static void CameraDolly(CameraShifter.ZoomTargetArea target)
 {
     if (dressRoom != null)
     {
         dressRoom._mouseY = 0;
         dressRoom._cameraZoom.ZoomTo(target);
     }
 }
예제 #4
0
    private void Start()
    {
        _cameraZoom = Camera.main.GetComponent<CameraShifter>();
        if (_cameraZoom == null)
        {
            Debug.LogWarning("No CameraShifter attached to the Main Camera, please attach it!");
        }

        AssetsManager.Initialize();

        generator = new CharacterGenerator();

        _updateAvatar = false;
        _changeNewCharacter = false;

        #region TEST_CODES
        /*
        string gender = "male_base";

        string hair = "male_hair_1_top";
        string hairMat = "male_hair_1";

        string hairBottom = "male_hair_1_bottom";
        string hairBottomMat = "male_hair_1";

        string head = "male_head";

        string eyeBrows = "";
        string eyes = "";
        string lip = "";

        string body = "male_body_medium";
        string bodyMat = "";// "male_body";

        string hand = "male_body_hand";
        string handMat = "male_body";

        string pants = "male_pants_medium";
        string pantsMat = "male_pants";

        string shoes = "male_shoes_01";
        string shoesMat = "male_shoes_01";
        *
        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor)
        {
            string gender = "male_base";

            string hair = "male_hair_1_top";
            string hairMat = "male_hair_1";

            string hairBottom = "male_hair_1_bottom";
            string hairBottomMat = "male_hair_1";

            string head = "male_head";

            string eyeBrows = "";
            string eyes = "";
            string lip = "";

            string body = "male_body_medium";
            string bodyMat = "male_body";// "male_body";

            string hand = "male_body_hand";
            string handMat = "male_body";

            string pants = "male_pants_medium";
            string pantsMat = "male_pants";

            string shoes = "male_shoes_01";
            string shoesMat = "male_shoes_01";

            ChangeCharacterEvent("[{'tipe':'gender','element':'" + gender + "'},{'tipe':'face','element':'" + head + "','eye_brows':'" + eyeBrows + "','eyes':'" + eyes + "','lip':'" + lip + "'},{'tipe':'hair','element':'" + hair + "','material':'" + hairMat + "','element2':'" + hairBottom + "','material2':'" + hairBottomMat + "'},{'tipe':'body','element':'" + body + "','material':'" + bodyMat + "'},{'tipe':'pants','element':'" + pants + "','material':'" + pantsMat + "'},{'tipe':'shoes','element':'" + shoes + "','material':'" + shoesMat + "'},{'tipe':'Hand','element':'" + hand + "','material':'" + handMat + "'}]");
        }
        //ChangeCharacterEvent("[{'tipe':'gender','element':'male_base'},{'tipe':'Face','element':'male_head','material':'','eye_brows':'','eyes':'','lip':''},{'tipe':'Hair','element':'male_hair_1_top','material':'','element2':'male_hair_1_bottom','material2':''},{'tipe':'Body','element':'male_body_medium','material':''},{'tipe':'Pants','element':'male_pants_medium','material':''},{'tipe':'Shoes','element':'male_shoes_01','material':''},{'tipe':'Hand','element':'male_body_hand','material':''}]");
        
        else
        {*/
        #endregion

//#if UNITY_ANDROID
//#else
        if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor)
        {
           // ChangePlayerId("4e2fe1e4c1b4ba4444000014");
        }
//#endif
        //}
    }
    IEnumerator Start()
    {
        // 設定ファイルより入力タイプを取得
        if (!ApplicationSetting.Instance.GetBool("UseMouse"))
        {
            winTouch = true;
        }

        Vector3    temp_pos   = this.gameObject.transform.position;
        Quaternion temp_rot   = this.gameObject.transform.rotation;
        Vector3    temp_scale = this.gameObject.transform.localScale;

        yield return(new WaitForEndOfFrame());

        // カメラコンポーネントの取得
        flyThroughCamera = this.gameObject.GetComponent <FlyThroughCamera>();
        orbitCamera      = this.gameObject.GetComponent <OrbitCamera>();

        // ズーム位置のルートを設定する
        pinchZoomRoot = new GameObject(this.gameObject.name + " PinchZoom Root");
        pinchZoomRoot.transform.SetParent(this.gameObject.transform.parent, true);
        pinchZoomRoot.transform.position   = temp_pos;
        pinchZoomRoot.transform.rotation   = temp_rot;
        pinchZoomRoot.transform.localScale = temp_scale;
        this.gameObject.transform.SetParent(pinchZoomRoot.transform, true);
        this.gameObject.transform.localPosition = Vector3.zero;
        this.gameObject.transform.localRotation = Quaternion.identity;
        this.gameObject.transform.localScale    = Vector3.one;

        // 初期値を保存
        switch (zoomType)
        {
        case PINCH_ZOOM_TYPE.POSITION_Z: defaultZoom = this.gameObject.transform.localPosition.z; break;

        case PINCH_ZOOM_TYPE.FOV: defaultZoom = this.gameObject.GetComponent <Camera>().fieldOfView; break;

        case PINCH_ZOOM_TYPE.ORTHOSIZE: defaultZoom = this.gameObject.GetComponent <Camera>().orthographicSize; break;

        default: break;
        }

        // ピンチセンターへのズーム設定
        if (zoomToPinchCenterFor2D)
        {
            if (zoomType != PINCH_ZOOM_TYPE.POSITION_Z)
            {
                Debug.LogWarning("PinchZoomCamera :: [zoomToPinchCenter] only works for [PINCH_ZOOM_TYPE.POSITION_Z]");
            }

            Camera[] cameras = this.gameObject.GetComponent <Camera>().GetComponentsInChildren <Camera>();
            foreach (Camera cam in cameras)
            {
                CameraShifter cameraShifter = cam.gameObject.GetComponent <CameraShifter>();
                if (cameraShifter == null)
                {
                    cameraShifter = cam.gameObject.AddComponent <CameraShifter>();
                }
                cameraShifter.calcAlways = true;

                cameraShifterListForZtoPC.Add(cameraShifter);
            }
        }

        ResetInput();
    }