Unity
前提 アニメーションの再生はPlayable APIを使用 アニメーション再生前に位置・回転をリセットしている しかしアニメーションを連打すると地面にめり込んでいったりする 「位置・回転のリセットが効かない!」という状況 アニメーション再生コード public vo…
Aボタンを押したらパンチ Bボタンを押したらキック ブレンドなしに最初から再生 そういう単純な状況を想定しています キャラに以下の PlayableAnimation.cs を付け、Animation Clipを2つ設定します using System.Collections; using System.Collections.Gene…
FaceTracker.cs に追記する public bool enableDebugLine = true; ... public void draw(Mat im, Scalar pts_color, Scalar con_color) { int[] smodel_C_int = new int[smodel.C.total()]; Utils.copyFromMat<int>(smodel.C, smodel_C_int); ScaleFaceParts(); C</int>…
Visual Studio 2015の時、なぜかコード補完が効かなかった 2017に変えると、補完が効いた フォントがMSゴシックだったのでメイリオに変更 早く変えておけばよかった Unity ちなみにUnityも最新にしている Inspectorで値を入力した後にTabを押して次に行った…
別のアセットでAndroid Galleryの画像パスまでは取れる状態になっていた 後はパスから画像を呼んでExifを引き出せればいい こちらのAssetを使った。最初からGalleryにはこれを使っても良さそう。無料 assetstore.unity.com orientationを取って使っている部…
I want to use Stan's Asset for android gallery I put uGUI button and attach OnClick public void OnClickOpenGallery() { AN_MediaPicker picker = new AN_MediaPicker(AN_MediaType.Image); /// Defines if multiple images picker is allowed. /// Th…
I wanted to use android photo gallery by Stan's Asset I wrote code, and build, then "ClassNotFoundException" I noticed the view I gallery ON, and build, then "ClassNotFoundException" disappeared and I can select image from gallery Version …
I wanted to copy eyeblow region, but copied unexpected region I noticed that cropped region is mirrored by green line I checked docs submat(int rowStart, int rowEnd, int colStart, int colEnd) Extracts a rectangular submatrix. parameter ord…
im is bigger image (for example face) sub is cropped smaller image (for example face's eyeblow) Mat sub = new Mat(); int xStart = 500; int xEnd = 800; int yStart = 500; int yEnd = 800; im.submat(yStart, yEnd, xStart, xEnd).copyTo(sub); Deb…
サンプルシーン、サンプルコードはAssetに含まれていない 下記のように書いた using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.UI; using NatShareU; public class NatShareSample : M…
I rewrite FaceTracker.cs for inpaint eyebrow Checklist img & mask is same size? (width & height) mask is CvType.CV_8UC1 img is CvType.CV_8UC3 Pitfall FaceTrackerExample.cs //Mat imgMat = new Mat(imgTexture.height, imgTexture.width, CvType.…
2カラムのエディタの左にmarkdownで書いて、右でプレビューできるのははてなBlogより書きやすい ただ、アフィリやSEO的にQiitaに捧げているだけとも言える やはり自分のBlogに書いたほうが積み重なる そういえば技術Blogも作ってた(コレ) 次からはここに書…
If you want to use AddListener and void function, you should not write like ``` button.onClick.AddListener (someFunction(id)); ``` but ``` button.onClick.AddListener (() => someFunction(id)); ```
Refer to doc. https://docs.unity3d.com/jp/current/ScriptReference/Events.UnityEventBase.RemoveAllListeners.html It says that RemoveAllListeners can only remove listeners attached at runtime.