Unity

アニメーションを連続再生すると位置が変わっていきリセットも効かない場合の対処方法; How to reset position and rotation before animation? Change clip settings!

前提 アニメーションの再生はPlayable APIを使用 アニメーション再生前に位置・回転をリセットしている しかしアニメーションを連打すると地面にめり込んでいったりする 「位置・回転のリセットが効かない!」という状況 アニメーション再生コード public vo…

AnimationControllerをGUIで作りたくない時はPlayableAnimationを使おう

Aボタンを押したらパンチ Bボタンを押したらキック ブレンドなしに最初から再生 そういう単純な状況を想定しています キャラに以下の PlayableAnimation.cs を付け、Animation Clipを2つ設定します using System.Collections; using System.Collections.Gene…

How to visualize FaceTracker.cs? 分析された顔情報の可視化

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>…

UnityのエディタをVisual Studio 2015から2017に変更した

Visual Studio 2015の時、なぜかコード補完が効かなかった 2017に変えると、補完が効いた フォントがMSゴシックだったのでメイリオに変更 早く変えておけばよかった Unity ちなみにUnityも最新にしている Inspectorで値を入力した後にTabを押して次に行った…

How to extract JPG's Exif rotaion info?; Unityで画像のExif情報を得る方法; Resolved!

別のアセットでAndroid Galleryの画像パスまでは取れる状態になっていた 後はパスから画像を呼んでExifを引き出せればいい こちらのAssetを使った。最初からGalleryにはこれを使っても良さそう。無料 assetstore.unity.com orientationを取って使っている部…

There is difference between "Delegate?" and "uGUI OnClick"

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…

Stan's Asset ClassNotFoundException... Resolved!

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 …

Why mat.submat copy unexpected region? Resolved!

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…

How to crop rect (rectangular) image from other image? Resolved!

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…

Unity用無料アセット「NatShare - Mobile Sharing API」でスクリーンショットをシェアしてみた; How to share image by free asset "NatShare - Mobile Sharing API"

サンプルシーン、サンプルコードはAssetに含まれていない 下記のように書いた using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.UI; using NatShareU; public class NatShareSample : M…

Why my inpaint doesn't work? Resolved!

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.…

Qiitaに2つ記事を書いて思った

2カラムのエディタの左にmarkdownで書いて、右でプレビューできるのははてなBlogより書きやすい ただ、アフィリやSEO的にQiitaに捧げているだけとも言える やはり自分のBlogに書いたほうが積み重なる そういえば技術Blogも作ってた(コレ) 次からはここに書…

error CS1502: The best overloaded method match for `UnityEngine.Events.UnityEvent.AddListener(UnityEngine.Events.UnityAction)' has some invalid arguments

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)); ```

RemoveAllListeners can't remove listeners

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.