顯示具有 Unity 標籤的文章。 顯示所有文章
顯示具有 Unity 標籤的文章。 顯示所有文章

星期一, 4月 13, 2015

星期二, 1月 20, 2015

Unity mobile movie texture plugin test

Vuforia ( Video Playback )
Android
StreamingAsset 資料夾:正常
Http:正常
temporaryCachePath:正常

iOS
StreamingAsset 資料夾:正常
Http:會全螢幕播放
temporaryCachePath:無法播放


Easy Movie Texture For Android (Video Texture)
Android
StreamingAsset 資料夾:未測試
Http:未測試
temporaryCachePath:未測試

iOS (尚未有正式版,Beta版)
StreamingAsset 資料夾:正常
Http:無法播放
temporaryCachePath:未測試


Mobile Movie Texture
Android
StreamingAsset 資料夾:正常播放,但尚未支援音訊
Http:無法播放
temporaryCachePath:未測試

iOS
StreamingAsset 資料夾:正常播放,但尚未支援音訊
Http:無法播放
temporaryCachePath:未測試


Video Texture Pro 2.0
Android:未支援

iOS
StreamingAsset 資料夾:正常
Http:正常
temporaryCachePath:正常



作業系統 : OS X 10.10.1

Unity版本 : 4.6.1 pro , Android pro , iOS pro

Xcode : 6.1.1 ( SDK 8.1 )

視訊 : mp4 ( H.264,AAC )

測試設備:iPad 2(iOS 7.1.1)、iPad 4(iOS 8.1)

以上測試環境會出現同一問題

在iPad 2上,影片會正常播放,但是無聲音

在iPad 4上,影片、聲音正常播放

尚未研究為何

星期四, 4月 17, 2014

在Unity 用Gmail帳號寄信 C#

using UnityEngine;//純Log用
using System;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

public class Mail {
public void SendMail() {
     MailMessage mail = new MailMessage();
     mail.From = new MailAddress("寄件者信箱");
     mail.To.Add("收件者信箱");
     mail.Subject = "主旨";

     try{
          //內文附圖
          AlternateView plainView = AlternateView.CreateAlternateViewFromString("<p>",null, "text/plain");
          mail.AlternateViews.Add(plainView);
          AlternateView htmlView = CreateAlternateView("Floor0001");
          mail.AlternateViews.Add(htmlView);

          
          //附件
          FileStream imageFileStream = new FileStream(Application.streamingAssetsPath+"/Floor0001.jpg",FileMode.Open);
          Attachment attachment = new Attachment(imageFileStream,"Floor0001.jpg");
          mail.Attachments.Add(attachment);
          
          Debug.Log("Success");
     }catch{
          Debug.Log("Fail");
     }

     SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
     smtpServer.Port = 587;
     smtpServer.Credentials = new System.Net.NetworkCredential("寄件者信箱", "寄件者密碼") as ICredentialsByHost;
     smtpServer.EnableSsl = true;
     ServicePointManager.ServerCertificateValidationCallback = 
          delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {  return true; };
     smtpServer.Send(mail);
     }

     private AlternateView CreateAlternateView(string pictureName) {
          string htmlBody = "<html><body><img src=cid:"+pictureName+"A></img><p>" +
                    "<img src=cid:"+pictureName+"B></img><p>" +
                    "Send by unity3d!</body></html>";
          AlternateView alternateView = AlternateView.CreateAlternateViewFromString(
                    htmlBody,
                    null, "text/html");

          LinkedResource imageA = new LinkedResource(Application.streamingAssetsPath+"/"+pictureName+"A.jpg" );
          imageA.ContentId = pictureName+"A";
          LinkedResource imageB = new LinkedResource(Application.streamingAssetsPath+"/"+pictureName+"B.jpg" );
          imageB.ContentId = pictureName+"B";
          alternateView.LinkedResources.Add(imageA);
          alternateView.LinkedResources.Add(imageB);
          return alternateView;
     }

}

星期四, 3月 27, 2014

在Mac顯示Android上Unity App的Log

1.開啟終端機

2.將adb拖入終端機會自動顯示路徑

3.出現路徑後加上" logcat -s Unity"

4.按下return

adb在SDK資料夾中

/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb