Merge commit '8fe090a3af7c861179ea9607d3f950a810469810' as 'popcorn/Assets/USAYAUnityLib'
This commit is contained in:
commit
37abf930be
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5ef5cb85bff006b48b311c18b5b66ec9
|
||||
folderAsset: yes
|
||||
timeCreated: 1524593791
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9117919f6e527984394914b0933e1c09
|
||||
folderAsset: yes
|
||||
timeCreated: 1524310466
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,279 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine;
|
||||
|
||||
namespace StaTech.AnimationValidator {
|
||||
public static class AnimationValidator {
|
||||
private static Animator _animator;
|
||||
|
||||
private static readonly string[] CurveNames = {
|
||||
"m_PositionCurves",
|
||||
"m_ScaleCurves",
|
||||
"m_FloatCurves",
|
||||
"m_PPtrCurves",
|
||||
"m_EditorCurves",
|
||||
"m_EulerEditorCurves"
|
||||
};
|
||||
|
||||
private static readonly string PathPropName = "path";
|
||||
private static readonly string AttributePropName = "attribute";
|
||||
|
||||
private static List<ClipValidationContainer> _clipValidations;
|
||||
|
||||
public static List<ClipValidationContainer> ValidateAnimation(){
|
||||
if(Selection.activeGameObject == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
var selectedTransform = Selection.activeGameObject.transform;
|
||||
// アニメーションクリップを取り出すAnimator
|
||||
_animator = selectedTransform.GetComponent<Animator>();
|
||||
|
||||
if(_animator == null){
|
||||
// 警告window出す
|
||||
EditorUtility.DisplayDialog("エラー", "選択したオブジェクトにAnimatorがついていません", "閉じる");
|
||||
return null;
|
||||
}
|
||||
|
||||
var runTimeAnimatorController = _animator.runtimeAnimatorController;
|
||||
var animationController = runTimeAnimatorController as AnimatorController;
|
||||
|
||||
if(animationController == null){
|
||||
// 警告window出す
|
||||
EditorUtility.DisplayDialog("エラー", "AnimatorにAnimationControllerが設定されていません", "閉じる");
|
||||
return null;
|
||||
}
|
||||
|
||||
if(_clipValidations == null){
|
||||
_clipValidations = new List<ClipValidationContainer>();
|
||||
}else{
|
||||
_clipValidations.Clear();
|
||||
}
|
||||
|
||||
// 全てのレイヤーを取り出す
|
||||
for(var i = 0; i < animationController.layers.Length; ++i){
|
||||
var layer = animationController.layers[i];
|
||||
var stateMachine = layer.stateMachine;
|
||||
// 全てのステートを取り出す
|
||||
for(var j = 0; j < stateMachine.states.Length; ++j){
|
||||
var state = stateMachine.states[j];
|
||||
var clip = state.state.motion as AnimationClip;
|
||||
if(clip){
|
||||
var validationData = FindLostAnimations(clip, selectedTransform);
|
||||
_clipValidations.Add(validationData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _clipValidations;
|
||||
}
|
||||
|
||||
public static void ExecuteUnitRecovery(GameObject selected, ClipValidationContainer container, Action<string, float> onProgressChanged){
|
||||
var childObjectsNames = GetChildObjectNames(selected);
|
||||
Recovery(container, ref childObjectsNames, onProgressChanged);
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
|
||||
public static void ExecuteAllRecovery(GameObject selected, List<ClipValidationContainer> containers, Action<string, float> onProgressChanged){
|
||||
var childObjectsNames = GetChildObjectNames(selected);
|
||||
var targetCount = containers.Count;
|
||||
for(var i = 0; i < containers.Count; ++i){
|
||||
var container = containers[i];
|
||||
Recovery(container, ref childObjectsNames);
|
||||
if(onProgressChanged != null){
|
||||
onProgressChanged.Invoke(container.ClipName, (float)i / targetCount);
|
||||
}
|
||||
}
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
|
||||
private static ClipValidationContainer FindLostAnimations(AnimationClip clip, Transform root){
|
||||
var lostAnimations = new List<LostProperty>();
|
||||
var serializedClip = new SerializedObject(clip);
|
||||
// clipはいくつかのカーブをもっている
|
||||
foreach(var curveName in CurveNames){
|
||||
var curves = serializedClip.FindProperty(curveName);
|
||||
var curveCount = curves.arraySize;
|
||||
for(var i = 0; i < curveCount; ++i){
|
||||
var curve = curves.GetArrayElementAtIndex(i);
|
||||
var pathProperty = curve.FindPropertyRelative(PathPropName);
|
||||
var attributeProperty = curve.FindPropertyRelative(AttributePropName);
|
||||
var attribute = attributeProperty != null ? attributeProperty.stringValue : "Position";
|
||||
// ルートの直下からの相対パスが入ってる
|
||||
var path = pathProperty.stringValue;
|
||||
var result = root.Find(path);
|
||||
if(result == null){
|
||||
var lost = new LostProperty {
|
||||
ObjectName = GetObjectName(path),
|
||||
PropPath = path,
|
||||
AttributeName = attribute,
|
||||
SerializedProperty = pathProperty,
|
||||
SerializedClip = serializedClip,
|
||||
State = FixState.Lost
|
||||
};
|
||||
lostAnimations.Add(lost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var clipLost = new ClipValidationContainer(lostAnimations, clip);
|
||||
return clipLost;
|
||||
}
|
||||
|
||||
private static void Recovery(ClipValidationContainer validationContainer, ref List<PathModel> paths, Action<string, float> onUnitProgressChanged = null){
|
||||
for(var i = 0; i < validationContainer.LostProperties.Count; ++i){
|
||||
var anim = validationContainer.LostProperties[i];
|
||||
var pathInHierarchy = paths.Where(path => path.ObjectName == anim.ObjectName).ToList();
|
||||
var hierarchyCount = pathInHierarchy.Count;
|
||||
|
||||
if(onUnitProgressChanged != null){
|
||||
onUnitProgressChanged.Invoke(anim.ObjectName, (float)i / validationContainer.LostProperties.Count);
|
||||
}
|
||||
|
||||
if(hierarchyCount == 0){
|
||||
//同名のobjectNameが存在しない
|
||||
anim.State = FixState.ErrorNoSameName;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(hierarchyCount >= 2){
|
||||
// 複数のobjectが存在するから修正出来ない
|
||||
anim.State = FixState.ErrorDuplicate;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// 修復処理
|
||||
var correctPath = pathInHierarchy.First().RelativePath;
|
||||
Debug.Log(anim.PropPath + "を" + correctPath + "に修正");
|
||||
anim.State = FixState.Fixed;
|
||||
anim.SerializedProperty.stringValue = correctPath;
|
||||
anim.SerializedClip.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetObjectName(string path){
|
||||
if(string.IsNullOrEmpty(path)){
|
||||
return "";
|
||||
}
|
||||
|
||||
var separated = path.Split('/');
|
||||
return separated[separated.Length - 1];
|
||||
}
|
||||
|
||||
private static List<PathModel> GetChildObjectNames(GameObject root){
|
||||
var children = GetAllObjects(root);
|
||||
|
||||
return children.Select(obj => {
|
||||
// なんか進捗とか出す
|
||||
return new PathModel(obj, root.name);
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public static List<GameObject> GetAllObjects(GameObject obj){
|
||||
var allChildren = new List<GameObject>();
|
||||
GetChildren(obj, ref allChildren);
|
||||
return allChildren;
|
||||
}
|
||||
|
||||
public static void GetChildren(GameObject obj, ref List<GameObject> allChildren){
|
||||
var children = obj.GetComponentInChildren <Transform>();
|
||||
// 子要素がいなければ終了
|
||||
if(children.childCount == 0){
|
||||
return;
|
||||
}
|
||||
foreach(Transform ob in children){
|
||||
allChildren.Add(ob.gameObject);
|
||||
GetChildren(ob.gameObject, ref allChildren);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ParentRelativePath(Transform t, string path, string rootName){
|
||||
var parent = t.parent;
|
||||
if(parent == null){
|
||||
if(t.name != rootName){
|
||||
Debug.LogError("不正な階層指定してます" + rootName);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
if(parent.name == rootName){
|
||||
return path;
|
||||
}
|
||||
path = parent.name + "/" + path;
|
||||
|
||||
return ParentRelativePath(parent, path, rootName);
|
||||
}
|
||||
|
||||
private class PathModel {
|
||||
public readonly string ObjectName;
|
||||
public readonly string RelativePath;
|
||||
|
||||
public PathModel(GameObject go, string rootName){
|
||||
ObjectName = go.name;
|
||||
RelativePath = ParentRelativePath(go.transform, ObjectName, rootName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ClipValidationContainer{
|
||||
public ClipValidationContainer(List<LostProperty> lostAnims, AnimationClip clip){
|
||||
LostProperties = lostAnims;
|
||||
ClipName = clip.name;
|
||||
}
|
||||
|
||||
public string ClipName {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool HasNoError {
|
||||
get{
|
||||
return LostProperties.Count == 0 || LostProperties.All(p => p.State == FixState.Fixed);
|
||||
}
|
||||
}
|
||||
|
||||
public List<LostProperty> LostProperties {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
}
|
||||
|
||||
public class LostProperty {
|
||||
public string AttributeName;
|
||||
|
||||
/// <summary>
|
||||
/// オブジェクトの名前
|
||||
/// 一意である必要がある
|
||||
/// </summary>
|
||||
public string ObjectName;
|
||||
|
||||
/// <summary>
|
||||
/// アニメーション内のプロパティのパス
|
||||
/// </summary>
|
||||
public string PropPath;
|
||||
|
||||
public SerializedObject SerializedClip;
|
||||
|
||||
public SerializedProperty SerializedProperty;
|
||||
|
||||
/// <summary>
|
||||
/// 修復済みフラグ
|
||||
/// </summary>
|
||||
public FixState State;
|
||||
}
|
||||
|
||||
public enum FixState {
|
||||
None,
|
||||
Lost,
|
||||
ErrorNoSameName,
|
||||
ErrorDuplicate,
|
||||
Fixed
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d44c737829d86874d922d82403ef21c2
|
||||
timeCreated: 1523983104
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
204
popcorn/Assets/USAYAUnityLib/AnimationValidator/Editor/AnimationValidatorView.cs
Executable file
204
popcorn/Assets/USAYAUnityLib/AnimationValidator/Editor/AnimationValidatorView.cs
Executable file
|
|
@ -0,0 +1,204 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace StaTech.AnimationValidator {
|
||||
public class AnimationValidatorView : EditorWindow {
|
||||
private Texture2D _successIcon;
|
||||
private Texture2D SuccessIcon {
|
||||
get{
|
||||
if(_successIcon == null){
|
||||
_successIcon = GetBuiltInIcon("testpassed.png");
|
||||
}
|
||||
return _successIcon;
|
||||
}
|
||||
}
|
||||
|
||||
private Texture2D _errorIcon;
|
||||
private Texture2D ErrorIcon {
|
||||
get{
|
||||
if(_errorIcon == null){
|
||||
_errorIcon = GetBuiltInIcon("testfailed.png");
|
||||
}
|
||||
return _errorIcon;
|
||||
}
|
||||
}
|
||||
|
||||
private const float DetailSpace = 30f;
|
||||
private const float RightPadding = 30f;
|
||||
|
||||
private static List <ClipValidationContainer> _clipValidations;
|
||||
private static GameObject _selectedObject;
|
||||
private static AnimationValidatorView _window;
|
||||
private static Vector2 _scrollPos;
|
||||
|
||||
[MenuItem("GameObject/アニメーションクリップ修正", false, -1)]
|
||||
public static void Open(){
|
||||
_clipValidations = AnimationValidator.ValidateAnimation();
|
||||
if(_clipValidations == null){
|
||||
return;
|
||||
}
|
||||
_window = GetWindow <AnimationValidatorView>();
|
||||
_window.titleContent = new GUIContent("anim修正");
|
||||
_selectedObject = Selection.activeGameObject;
|
||||
}
|
||||
|
||||
private void OnGUI(){
|
||||
if(_clipValidations == null || _clipValidations.Count == 0){
|
||||
GUILayout.Label("AnimationClipがありません");
|
||||
return;
|
||||
}
|
||||
|
||||
_scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, true, true);
|
||||
GUILayout.Label("=====================================");
|
||||
GUILayout.Label("Animationでmissingになっているものを表示します");
|
||||
GUILayout.Label("オブジェクトの名前が他と被っていなれば自動で修正します");
|
||||
GUILayout.Label("=====================================");
|
||||
|
||||
if(_clipValidations.Count > 1){
|
||||
foreach(var result in _clipValidations){
|
||||
if(!result.HasNoError){
|
||||
DrawButton("全部まとめて修正", () => {
|
||||
AnimationValidator.ExecuteAllRecovery(_selectedObject, _clipValidations, ShowProgress);
|
||||
_window.Repaint();
|
||||
EditorApplication.RepaintAnimationWindow();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var result in _clipValidations){
|
||||
DrawResult(result);
|
||||
}
|
||||
DrawButton("閉じる", () => _window.Close());
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawResult(ClipValidationContainer result){
|
||||
if(result.HasNoError){
|
||||
using(new EditorGUILayout.VerticalScope("box", GUILayout.Width(position.width - RightPadding))){
|
||||
DrawOnSuccess(result);
|
||||
}
|
||||
}else{
|
||||
using(new EditorGUILayout.VerticalScope("box", GUILayout.Width(position.width - RightPadding))){
|
||||
DrawOnError(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawOnSuccess(ClipValidationContainer result){
|
||||
DrawIconAndLabel(SuccessIcon, result.ClipName, "→正常です");
|
||||
DrawDetail(result.LostProperties);
|
||||
}
|
||||
|
||||
private void DrawOnError(ClipValidationContainer result){
|
||||
DrawIconAndLabel(ErrorIcon, result.ClipName);
|
||||
DrawDetail(result.LostProperties);
|
||||
DrawButton("自動修正", () => {
|
||||
AnimationValidator.ExecuteUnitRecovery(_selectedObject, result, ShowProgress);
|
||||
_window.Repaint();
|
||||
EditorApplication.RepaintAnimationWindow();
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowProgress(string content, float progress){
|
||||
EditorUtility.DisplayProgressBar("実行中", content, progress);
|
||||
}
|
||||
|
||||
private void DrawDetail(List <LostProperty> Props){
|
||||
using(new GUILayout.VerticalScope()){
|
||||
foreach(var prop in Props){
|
||||
var icon = prop.State == FixState.Fixed ? SuccessIcon : ErrorIcon;
|
||||
DrawSpaceAndText(DetailSpace, prop.PropPath + " : " + prop.AttributeName, icon, prop.State);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawIconAndLabel(Texture image, string content, string detail = ""){
|
||||
using(new GUILayout.HorizontalScope()){
|
||||
GUILayout.Label(image, GUILayout.Height(18f), GUILayout.Width(20f));
|
||||
GUILayout.Label(content);
|
||||
if(!string.IsNullOrEmpty(detail)){
|
||||
GUIStyle s = new GUIStyle(EditorStyles.label){
|
||||
normal = { textColor = Color.green }
|
||||
};
|
||||
GUILayout.Label(detail, s);
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSpaceAndText(float space, string content, Texture headIcon, FixState state = FixState.None){
|
||||
using(new GUILayout.HorizontalScope()){
|
||||
GUILayout.Space(space);
|
||||
if(headIcon){
|
||||
GUILayout.Label(headIcon, GUILayout.Height(18f), GUILayout.Width(20f));
|
||||
}
|
||||
GUILayout.Label(content);
|
||||
var detail = GetDetail(state);
|
||||
if(!string.IsNullOrEmpty(detail)){
|
||||
// 黄色文字で足す
|
||||
var color = GetColor(state);
|
||||
if(color != Color.white){
|
||||
GUIStyle s = new GUIStyle(EditorStyles.label){
|
||||
normal = { textColor = color }
|
||||
};
|
||||
GUILayout.Label(detail, s);
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Color GetColor(FixState state){
|
||||
switch(state){
|
||||
case FixState.ErrorDuplicate:
|
||||
case FixState.ErrorNoSameName:
|
||||
return Color.yellow;
|
||||
case FixState.Fixed:
|
||||
return Color.green;
|
||||
default:
|
||||
return Color.white;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetDetail(FixState state){
|
||||
switch(state){
|
||||
case FixState.ErrorDuplicate:
|
||||
return "→同じ名前のオブジェクトが子階層上に複数あります";
|
||||
case FixState.ErrorNoSameName:
|
||||
return "→同じ名前のオブジェクトが見つかりませんでした";
|
||||
case FixState.Lost:
|
||||
return " ";
|
||||
case FixState.Fixed:
|
||||
return "→Animationのパスを変更しました";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButton(string buttonName, System.Action callback = null){
|
||||
if(GUILayout.Button(buttonName, GUILayout.Width(200f))){
|
||||
if(callback != null){
|
||||
callback.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy(){
|
||||
if(_clipValidations != null){
|
||||
_clipValidations.Clear();
|
||||
_clipValidations = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Texture2D GetBuiltInIcon(string name){
|
||||
System.Reflection.MethodInfo mi = typeof(EditorGUIUtility).GetMethod("IconContent", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public, null, new System.Type[] { typeof(string) }, null);
|
||||
if(mi == null){
|
||||
mi = typeof(EditorGUIUtility).GetMethod("IconContent", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new System.Type[] { typeof(string) }, null);
|
||||
}
|
||||
return (Texture2D)((GUIContent) mi.Invoke(null, new object[] { name })).image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f37417dd83a19b64ba497a3247d7d0b7
|
||||
timeCreated: 1524310971
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6507f0123e30443a3a79145e5f979d8d
|
||||
folderAsset: yes
|
||||
timeCreated: 1469076906
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 819b5f6b5a15345c8a3ce047055b1c02
|
||||
folderAsset: yes
|
||||
timeCreated: 1475126980
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomPropertyDrawer(typeof(PrefabFieldAttribute))]
|
||||
public class PrefabFieldDrawer : PropertyDrawer {
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){
|
||||
if(property.objectReferenceValue != null){
|
||||
var prefabAssetType = PrefabUtility.GetPrefabAssetType(property.objectReferenceValue);
|
||||
switch(prefabAssetType){
|
||||
case PrefabAssetType.Regular:
|
||||
case PrefabAssetType.Model:
|
||||
case PrefabAssetType.Variant:
|
||||
break;
|
||||
default:
|
||||
// Prefab以外がアタッチされた場合アタッチを外す
|
||||
property.objectReferenceValue = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
label.text += " (Prefab Only)";
|
||||
EditorGUI.PropertyField(position, property, label);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0ff00e08698044c2db627525064d0472
|
||||
timeCreated: 1475127005
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
|
||||
public class ReadOnlyDrawer : PropertyDrawer {
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label){
|
||||
return EditorGUI.GetPropertyHeight(property, label, true);
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 65b425c14c5094e27a20e2a2ee78db06
|
||||
timeCreated: 1475126989
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class PrefabFieldAttribute : PropertyAttribute {}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 05d68fb980e084628ac781ed8182d48a
|
||||
timeCreated: 1470027454
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class ReadOnlyAttribute : PropertyAttribute {}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c47b0faab6f8c405abdb31811ce5f733
|
||||
timeCreated: 1469076924
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b821feb572d0d4ddca587a8dbc61ba4e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1baf84e9b399949f98fce3fcf8577d42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Hidden/USAYALib/Outline/Blur" {
|
||||
Properties {
|
||||
_MainTex ("Main", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
ZTest Always Cull Off ZWrite Off Blend Off
|
||||
Fog { Mode off }
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 uv01 : TEXCOORD1;
|
||||
float4 uv23 : TEXCOORD2;
|
||||
float4 uv45 : TEXCOORD3;
|
||||
float4 uv67 : TEXCOORD4;
|
||||
float4 uv89 : TEXCOORD5;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float2 _Offsets;
|
||||
|
||||
v2f vert(appdata_img v){
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv.xy = v.texcoord.xy;
|
||||
o.uv01 = v.texcoord.xyxy + _Offsets.xyxy * float4(1,1, -1,-1) * (1 / _ScreenParams.xyxy);
|
||||
o.uv23 = v.texcoord.xyxy + _Offsets.xyxy * float4(2,2, -2,-2) * (1 / _ScreenParams.xyxy);
|
||||
o.uv45 = v.texcoord.xyxy + _Offsets.xyxy * float4(3,3, -3,-3) * (1 / _ScreenParams.xyxy);
|
||||
o.uv67 = v.texcoord.xyxy + _Offsets.xyxy * float4(4,4, -4,-4) * (1 / _ScreenParams.xyxy);
|
||||
o.uv89 = v.texcoord.xyxy + _Offsets.xyxy * float4(5,5, -5,-5) * (1 / _ScreenParams.xyxy);
|
||||
return o;
|
||||
}
|
||||
float4 frag(v2f i) : SV_Target {
|
||||
float4 sum = float4(0, 0, 0, 0);
|
||||
float w = 0;
|
||||
float weights = 0;
|
||||
const float G_WEIGHTS[9] = { 1.0, 0.8, 0.65, 0.5, 0.4, 0.2, 0.1, 0.05, 0.025 };
|
||||
|
||||
float4 sampleA = tex2D(_MainTex, i.uv.xy);
|
||||
float4 sampleB = tex2D(_MainTex, i.uv01.xy);
|
||||
float4 sampleC = tex2D(_MainTex, i.uv01.zw);
|
||||
float4 sampleD = tex2D(_MainTex, i.uv23.xy);
|
||||
float4 sampleE = tex2D(_MainTex, i.uv23.zw);
|
||||
float4 sampleF = tex2D(_MainTex, i.uv45.xy);
|
||||
float4 sampleG = tex2D(_MainTex, i.uv45.zw);
|
||||
float4 sampleH = tex2D(_MainTex, i.uv67.xy);
|
||||
float4 sampleI = tex2D(_MainTex, i.uv67.zw);
|
||||
float4 sampleJ = tex2D(_MainTex, i.uv89.xy);
|
||||
float4 sampleK = tex2D(_MainTex, i.uv89.zw);
|
||||
|
||||
w = G_WEIGHTS[0]; sum += sampleA * w; weights += w;
|
||||
w = G_WEIGHTS[1]; sum += sampleB * w; weights += w;
|
||||
w = G_WEIGHTS[1]; sum += sampleC * w; weights += w;
|
||||
w = G_WEIGHTS[2]; sum += sampleD * w; weights += w;
|
||||
w = G_WEIGHTS[2]; sum += sampleE * w; weights += w;
|
||||
w = G_WEIGHTS[3]; sum += sampleF * w; weights += w;
|
||||
w = G_WEIGHTS[3]; sum += sampleG * w; weights += w;
|
||||
w = G_WEIGHTS[4]; sum += sampleH * w; weights += w;
|
||||
w = G_WEIGHTS[4]; sum += sampleI * w; weights += w;
|
||||
w = G_WEIGHTS[5]; sum += sampleJ * w; weights += w;
|
||||
w = G_WEIGHTS[5]; sum += sampleK * w; weights += w;
|
||||
|
||||
sum /= weights + 1e-4f;
|
||||
return sum;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
Fallback Off
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: db183b7cc1b7049d4bc355d6958bbe9b
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Hidden/USAYALib/Outline/FlatColor" {
|
||||
Properties {
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
Blend One One
|
||||
Cull Off
|
||||
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata {
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata v){
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
}
|
||||
float4 frag(v2f i) : SV_TARGET {
|
||||
return step(0.5, (tex2D(_MainTex, i.uv)).a);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 60851fe30c623421b8015141412be220
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
Shader "Hidden/USAYALib/Outline/Halo" {
|
||||
Properties {
|
||||
_MainTex ("Main", 2D) = "black" {}
|
||||
_GlowTex ("Glow Object", 2D) = "black" {}
|
||||
_GlowColor ("Glow Color", Color) = (0, 1, 1, 1)
|
||||
_CutOut ("Cut Out", Float) = 0.5
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_img
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
sampler2D _MainTex, _GlowTex;
|
||||
float4 _GlowColor;
|
||||
float _CutOut;
|
||||
|
||||
float4 frag(v2f_img i) : SV_Target {
|
||||
float r = tex2D(_GlowTex, i.uv).r;
|
||||
clip(-r);
|
||||
float4 result = _GlowColor;
|
||||
// result.a *= (r < 1.0 && tex2D(_MainTex, i.uv).r > _CutOut) ? 1.0 : 0.0;
|
||||
result.a *= (1.0 - step(1.0, r)) * (1.0 - step(tex2D(_MainTex, i.uv).r, _CutOut));
|
||||
return result;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 22146d67b54ae4183a260c05b86f647f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
[RequireComponent(typeof(Camera))]
|
||||
public sealed class OutlineFilter : MonoBehaviour {
|
||||
[SerializeField]
|
||||
private Color color = Color.white;
|
||||
[SerializeField, Range(0.1f, 10.0f)]
|
||||
private float width = 1.0f;
|
||||
[SerializeField, Range(0f, 1f)]
|
||||
private float cutOut = 0f;
|
||||
[SerializeField]
|
||||
private LayerMask outlineLayer = default;
|
||||
|
||||
private Shader flatColorShader;
|
||||
private Material haloMaterial;
|
||||
private Material blurMaterial;
|
||||
private Camera _camera;
|
||||
private Camera renderTextureCamera;
|
||||
private int idOffsets = 0;
|
||||
private int idGlowTex = 0;
|
||||
private int idGlowColor = 0;
|
||||
private int idCutOut = 0;
|
||||
|
||||
void Awake(){
|
||||
_camera = GetComponent<Camera>();
|
||||
flatColorShader = Shader.Find("Hidden/USAYALib/Outline/FlatColor");
|
||||
blurMaterial = Shader.Find("Hidden/USAYALib/Outline/Blur").CreateHiddenMaterial();
|
||||
haloMaterial = Shader.Find("Hidden/USAYALib/Outline/Halo").CreateHiddenMaterial();
|
||||
|
||||
renderTextureCamera = new GameObject("OutlineRendererTextureCamera").AddComponent<Camera>();
|
||||
renderTextureCamera.transform.parent = _camera.gameObject.transform;
|
||||
renderTextureCamera.enabled = false;
|
||||
|
||||
idOffsets = Shader.PropertyToID("_Offsets");
|
||||
idGlowTex = Shader.PropertyToID("_GlowTex");
|
||||
idGlowColor = Shader.PropertyToID("_GlowColor");
|
||||
idCutOut = Shader.PropertyToID("_CutOut");
|
||||
}
|
||||
|
||||
void OnRenderImage(RenderTexture src, RenderTexture dst){
|
||||
Graphics.Blit(src, dst); // prepare main back framebuffer
|
||||
|
||||
renderTextureCamera.CopyFrom(_camera);
|
||||
renderTextureCamera.clearFlags = CameraClearFlags.Color;
|
||||
renderTextureCamera.backgroundColor = Color.black; // r as mask, should be black here
|
||||
|
||||
var renderTexture1 = RenderTexture.GetTemporary(src.width, src.height, 16, RenderTextureFormat.R8);
|
||||
renderTextureCamera.targetTexture = renderTexture1;
|
||||
|
||||
renderTextureCamera.cullingMask = outlineLayer;
|
||||
renderTextureCamera.RenderWithShader(flatColorShader, "");
|
||||
|
||||
// blur pass
|
||||
int shrink = 1; // shrink == 1 for best quality, try 2 or 4 for low quality but better performance
|
||||
var renderTexture2 = RenderTexture.GetTemporary(Screen.width / shrink, Screen.height / shrink, 0);
|
||||
var renderTexture3 = RenderTexture.GetTemporary(Screen.width / shrink, Screen.height / shrink, 0);
|
||||
DoBlurPass(renderTexture1, renderTexture2, Vector2.up);
|
||||
DoBlurPass(renderTexture2, renderTexture3, Vector2.right);
|
||||
|
||||
// copy the temporary RT to the final image
|
||||
haloMaterial.SetTexture(idGlowTex, renderTexture1);
|
||||
haloMaterial.SetColor(idGlowColor, color);
|
||||
haloMaterial.SetFloat(idCutOut, cutOut);
|
||||
Graphics.Blit(renderTexture3, dst, haloMaterial);
|
||||
|
||||
RenderTexture.ReleaseTemporary(renderTexture1);
|
||||
RenderTexture.ReleaseTemporary(renderTexture2);
|
||||
RenderTexture.ReleaseTemporary(renderTexture3);
|
||||
}
|
||||
private void DoBlurPass(RenderTexture input, RenderTexture output, Vector2 direction){
|
||||
var blurPixelOffset = width * input.height / 1920.0f;
|
||||
blurMaterial.SetVector(idOffsets, direction * blurPixelOffset);
|
||||
Graphics.Blit(input, output, blurMaterial);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7023f26e2ff004e119537b8c822726e1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 13829856eb3944aeebcb498ec23022d3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0bc2c9b816cc0431ea5ae4363cd040ac
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4621217213727453643
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1687065005769937004}
|
||||
- component: {fileID: 7161669052425278145}
|
||||
- component: {fileID: 5062447477614030396}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1687065005769937004
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4621217213727453643}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4063882079711355622}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -10, y: -10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7161669052425278145
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4621217213727453643}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &5062447477614030396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4621217213727453643}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6A5F\u80FD\u540D"
|
||||
--- !u!1 &5850834825256791800
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4063882079711355622}
|
||||
- component: {fileID: 1841557246581323496}
|
||||
- component: {fileID: 1877055874433787818}
|
||||
- component: {fileID: 502413859327355263}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4063882079711355622
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5850834825256791800}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1687065005769937004}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1841557246581323496
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5850834825256791800}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &1877055874433787818
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5850834825256791800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &502413859327355263
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5850834825256791800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1877055874433787818}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f19992fe2069b4e16b2f83277fb189cb
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,801 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2541661407703704363
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661407703704362}
|
||||
- component: {fileID: 2541661407703704364}
|
||||
- component: {fileID: 2541661407703704365}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661407703704362
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661407703704363}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2541661408982824309}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2541661407703704364
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661407703704363}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2541661407703704365
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661407703704363}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u623B\u308B"
|
||||
--- !u!1 &2541661408295226766
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661408295226753}
|
||||
- component: {fileID: 2541661408295226755}
|
||||
- component: {fileID: 2541661408295226752}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661408295226753
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408295226766}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2541661408536301877}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2541661408295226755
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408295226766}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2541661408295226752
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408295226766}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u5371\u967A"
|
||||
--- !u!1 &2541661408357901930
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661408357901934}
|
||||
- component: {fileID: 2541661408357901935}
|
||||
- component: {fileID: 2541661408357901932}
|
||||
- component: {fileID: 2541661408357901933}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661408357901934
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408357901930}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 2541661408570683701}
|
||||
- {fileID: 2541661409141469743}
|
||||
- {fileID: 2541661408982824309}
|
||||
- {fileID: 2541661408536301877}
|
||||
- {fileID: 2541661409648867662}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!223 &2541661408357901935
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408357901930}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &2541661408357901932
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408357901930}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 750, y: 1334}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 1
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
--- !u!114 &2541661408357901933
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408357901930}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!1 &2541661408536301873
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661408536301877}
|
||||
- component: {fileID: 2541661408536301874}
|
||||
- component: {fileID: 2541661408536301875}
|
||||
- component: {fileID: 2541661408536301872}
|
||||
m_Layer: 5
|
||||
m_Name: ResetButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661408536301877
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408536301873}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 2541661408295226753}
|
||||
m_Father: {fileID: 2541661408357901934}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 250, y: -500}
|
||||
m_SizeDelta: {x: 100, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2541661408536301874
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408536301873}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2541661408536301875
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408536301873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.45882353, b: 0.5058824, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &2541661408536301872
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408536301873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2541661408536301875}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &2541661408982824306
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661408982824309}
|
||||
- component: {fileID: 2541661408982824311}
|
||||
- component: {fileID: 2541661408982824308}
|
||||
- component: {fileID: 2541661408982824310}
|
||||
m_Layer: 5
|
||||
m_Name: BackButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661408982824309
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408982824306}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 2541661407703704362}
|
||||
m_Father: {fileID: 2541661408357901934}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -500}
|
||||
m_SizeDelta: {x: 160, y: 90}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2541661408982824311
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408982824306}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2541661408982824308
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408982824306}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &2541661408982824310
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661408982824306}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2541661408982824308}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &2541661409141469740
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661409141469743}
|
||||
- component: {fileID: 2541661409141469742}
|
||||
m_Layer: 5
|
||||
m_Name: Buttons
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661409141469743
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409141469740}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2541661408357901934}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -100, y: 400}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2541661409141469742
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409141469740}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -2095666955, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_StartCorner: 0
|
||||
m_StartAxis: 0
|
||||
m_CellSize: {x: 100, y: 100}
|
||||
m_Spacing: {x: 0, y: 0}
|
||||
m_Constraint: 0
|
||||
m_ConstraintCount: 2
|
||||
--- !u!1 &2541661409648867663
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2541661409648867662}
|
||||
- component: {fileID: 2541661409648867651}
|
||||
- component: {fileID: 2541661409648867648}
|
||||
- component: {fileID: 2541661409648867649}
|
||||
m_Layer: 5
|
||||
m_Name: CoverButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2541661409648867662
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409648867663}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2541661408357901934}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 250, y: -500}
|
||||
m_SizeDelta: {x: 100, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2541661409648867651
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409648867663}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2541661409648867648
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409648867663}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19215688, g: 0.19215688, b: 0.19215688, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 316fe626d2dfa490ca675da5c1c648b4, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &2541661409648867649
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2541661409648867663}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2541661409648867648}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2541661409648867663}
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1001 &9095851792703994660
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 2541661408357901934}
|
||||
m_Modifications:
|
||||
- target: {fileID: 6737172384967821846, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: StageInputField
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: -170
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 550
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 120
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384039791724, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Text
|
||||
value: "\u30B9\u30C6\u30FC\u30B8"
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 485257dfeb2144672bcc21b704b6ca0f, type: 3}
|
||||
--- !u!224 &2541661408570683701 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 9095851792703994660}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 32f8e8f0ced494daeb0f218e6be9d9db
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6737172384039791730
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6737172384039791725}
|
||||
- component: {fileID: 6737172384039791727}
|
||||
- component: {fileID: 6737172384039791724}
|
||||
m_Layer: 5
|
||||
m_Name: NameText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6737172384039791725
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384039791730}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6737172384967821841}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 0}
|
||||
m_Pivot: {x: 1, y: 0.5}
|
||||
--- !u!222 &6737172384039791727
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384039791730}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6737172384039791724
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384039791730}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 32
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 32
|
||||
m_Alignment: 5
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u540D\u524D"
|
||||
--- !u!1 &6737172384848310723
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6737172384848310722}
|
||||
- component: {fileID: 6737172384848310780}
|
||||
- component: {fileID: 6737172384848310781}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6737172384848310722
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384848310723}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6737172384967821841}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6737172384848310780
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384848310723}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6737172384848310781
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384848310723}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 32
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 0
|
||||
--- !u!1 &6737172384967821846
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6737172384967821841}
|
||||
- component: {fileID: 6737172384967821843}
|
||||
- component: {fileID: 6737172384967821840}
|
||||
- component: {fileID: 6737172384967821842}
|
||||
m_Layer: 5
|
||||
m_Name: IntInputField
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6737172384967821841
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384967821846}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 6737172384039791725}
|
||||
- {fileID: 6737172384848310722}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -170, y: 550}
|
||||
m_SizeDelta: {x: 120, y: 80}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6737172384967821843
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384967821846}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6737172384967821840
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384967821846}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &6737172384967821842
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6737172384967821846}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 6737172384967821840}
|
||||
m_TextComponent: {fileID: 6737172384848310781}
|
||||
m_Placeholder: {fileID: 0}
|
||||
m_ContentType: 2
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 4
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 1
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_CustomCaretColor: 0
|
||||
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
|
||||
m_Text: 0
|
||||
m_CaretBlinkRate: 0.85
|
||||
m_CaretWidth: 1
|
||||
m_ReadOnly: 0
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 485257dfeb2144672bcc21b704b6ca0f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1418391247242195742
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1418391247242195739}
|
||||
- component: {fileID: 1418391247242195736}
|
||||
m_Layer: 0
|
||||
m_Name: MainCamera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1418391247242195739
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1418391247242195742}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!20 &1418391247242195736
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1418391247242195742}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.19215687, b: 0.19215687, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8dee1e67eb6fa45268e20133acc68259
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &6962151599299144406
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 6737172384848310781, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Text
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384848310781, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_FontData.m_BestFit
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384848310781, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_FontData.m_HorizontalOverflow
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 120
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: -170
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 550
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821841, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821842, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Text
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821842, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_LineType
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821842, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_ContentType
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821842, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_KeyboardType
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821842, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_CharacterValidation
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6737172384967821846, guid: 485257dfeb2144672bcc21b704b6ca0f,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: StringInputField
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 485257dfeb2144672bcc21b704b6ca0f, type: 3}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 81de4ed12e3874110b42569fd8f3c162
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,306 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1907863346325523399
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8789217124120630612}
|
||||
- component: {fileID: 8246534116929882156}
|
||||
m_Layer: 5
|
||||
m_Name: Toggle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8789217124120630612
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1907863346325523399}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 937410549135013519}
|
||||
- {fileID: 4969098926396769855}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -170, y: 390}
|
||||
m_SizeDelta: {x: 80, y: 80}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8246534116929882156
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1907863346325523399}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 2109663825, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 5530625025939557361}
|
||||
toggleTransition: 1
|
||||
graphic: {fileID: 9069741319519684883}
|
||||
m_Group: {fileID: 0}
|
||||
onValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_IsOn: 1
|
||||
--- !u!1 &4732693032646562594
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 937410549135013519}
|
||||
- component: {fileID: 3161523647402802971}
|
||||
- component: {fileID: 6855072136971505580}
|
||||
m_Layer: 5
|
||||
m_Name: NameText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &937410549135013519
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4732693032646562594}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8789217124120630612}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: -20, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 0}
|
||||
m_Pivot: {x: 1, y: 0.5}
|
||||
--- !u!222 &3161523647402802971
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4732693032646562594}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6855072136971505580
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4732693032646562594}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 32
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 32
|
||||
m_Alignment: 5
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u540D\u524D"
|
||||
--- !u!1 &7953774624198755404
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4969098926396769855}
|
||||
- component: {fileID: 935700448316683054}
|
||||
- component: {fileID: 5530625025939557361}
|
||||
m_Layer: 5
|
||||
m_Name: Background
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4969098926396769855
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7953774624198755404}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 3450878312509628740}
|
||||
m_Father: {fileID: 8789217124120630612}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -20, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &935700448316683054
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7953774624198755404}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &5530625025939557361
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7953774624198755404}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &8621330901285670047
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3450878312509628740}
|
||||
- component: {fileID: 8336172991856618550}
|
||||
- component: {fileID: 9069741319519684883}
|
||||
m_Layer: 5
|
||||
m_Name: Checkmark
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3450878312509628740
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8621330901285670047}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4969098926396769855}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -20, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8336172991856618550
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8621330901285670047}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &9069741319519684883
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8621330901285670047}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bc0b42d29ba9f4568aa0b803c18574c5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9eeda945de99842c98da2bfc3b32d5c3
|
||||
folderAsset: yes
|
||||
timeCreated: 1464664292
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
#if UNITY_EDITOR
|
||||
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
public static class BitmapFontGenerater
|
||||
{
|
||||
static string DEFAULT_SHADER = "Unlit/Transparent";
|
||||
|
||||
[MenuItem("Assets/Create/Bitmap Font")]
|
||||
public static void GenerateBitmapFont()
|
||||
{
|
||||
Object[] textAssets = Selection.GetFiltered(typeof(TextAsset), SelectionMode.DeepAssets);
|
||||
Object[] textures = Selection.GetFiltered(typeof(Texture2D), SelectionMode.DeepAssets);
|
||||
|
||||
if(textAssets.Length < 1)
|
||||
{
|
||||
Debug.LogError("BitmapFont Create Error -- XML File is not Selected. (XMLファイルを選択してください)");
|
||||
return;
|
||||
}
|
||||
if(textures.Length < 1)
|
||||
{
|
||||
Debug.LogError("BitmapFont Create Error -- Texture File is not selected. (フォントテクスチャを選択してください)");
|
||||
return;
|
||||
}
|
||||
|
||||
Generate((TextAsset)textAssets[0] , (Texture2D)textures[0]);
|
||||
}
|
||||
|
||||
static void Generate(TextAsset textAsset , Texture2D texture)
|
||||
{
|
||||
XmlDocument xml = new XmlDocument();
|
||||
xml.LoadXml(textAsset.text);
|
||||
|
||||
XmlNode common = xml.GetElementsByTagName("common")[0];
|
||||
XmlNodeList chars = xml.GetElementsByTagName("chars")[0].ChildNodes;
|
||||
|
||||
CharacterInfo[] charInfos = new CharacterInfo[chars.Count];
|
||||
|
||||
float textureW = float.Parse(GetValue(common , "scaleW"));
|
||||
float textureH = float.Parse(GetValue(common , "scaleH"));
|
||||
|
||||
for (int i=0; i < chars.Count; i++)
|
||||
{
|
||||
XmlNode charNode = chars[i];
|
||||
if(charNode.Attributes != null)
|
||||
{
|
||||
charInfos[i].index = int.Parse(GetValue(charNode, "id"));
|
||||
|
||||
Rect vertRect = new Rect();
|
||||
vertRect.width = float.Parse(GetValue(charNode, "width"));
|
||||
vertRect.height = -(float.Parse(GetValue(charNode, "height")));
|
||||
vertRect.x = float.Parse(GetValue(charNode, "xoffset"));
|
||||
vertRect.y = -(float.Parse(GetValue(charNode, "yoffset")));
|
||||
|
||||
float charX = float.Parse(GetValue(charNode, "x")) / textureW;
|
||||
float charWidth = float.Parse(GetValue(charNode, "width")) / textureW;
|
||||
float charHeight = float.Parse(GetValue(charNode, "height"));
|
||||
float charY = (textureH - float.Parse(GetValue(charNode, "y")) - charHeight) / textureH;
|
||||
charHeight = charHeight / textureH;
|
||||
|
||||
// UnFlipped.
|
||||
charInfos[i].uvBottomLeft = new Vector2(charX, charY);
|
||||
charInfos[i].uvBottomRight = new Vector2(charX + charWidth, charY);
|
||||
charInfos[i].uvTopLeft = new Vector2(charX, charY + charHeight);
|
||||
charInfos[i].uvTopRight = new Vector2(charX + charWidth, charY + charHeight);
|
||||
|
||||
charInfos[i].minX = (int)vertRect.xMin;
|
||||
charInfos[i].maxX = (int)vertRect.xMax;
|
||||
charInfos[i].minY = (int)vertRect.yMax;
|
||||
charInfos[i].maxY = (int)vertRect.yMin;
|
||||
|
||||
charInfos[i].advance = int.Parse(GetValue(charNode, "xadvance"));
|
||||
}
|
||||
}
|
||||
|
||||
string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(textAsset));
|
||||
string exportPath = rootPath + "/" + Path.GetFileNameWithoutExtension(textAsset.name);
|
||||
|
||||
Material material = GenerateMaterial(exportPath, texture);
|
||||
Font font = GenerateFont(exportPath, textAsset.name, material);
|
||||
|
||||
font.characterInfo = charInfos;
|
||||
|
||||
// Save m_LineSpacing.
|
||||
XmlNode info = xml.GetElementsByTagName("info")[0];
|
||||
SerializedObject serializedFont = new SerializedObject(font);
|
||||
SerializedProperty serializedLineSpacing = serializedFont.FindProperty("m_LineSpacing");
|
||||
serializedLineSpacing.floatValue = Mathf.Abs(float.Parse(GetValue(info, "size")));
|
||||
serializedFont.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
static Material GenerateMaterial(string materialPath , Texture2D texture)
|
||||
{
|
||||
Shader shader = Shader.Find(DEFAULT_SHADER);
|
||||
Material material = LoadAsset<Material>(materialPath + ".mat", new Material(shader));
|
||||
material.shader = shader;
|
||||
material.mainTexture = texture;
|
||||
|
||||
SaveAsset(material, materialPath + ".mat");
|
||||
|
||||
return material;
|
||||
}
|
||||
|
||||
static Font GenerateFont(string fontPath, string fontName, Material material)
|
||||
{
|
||||
Font font = LoadAsset<Font>(fontPath + ".fontsettings", new Font(fontName));
|
||||
font.material = material;
|
||||
|
||||
SaveAsset(font, fontPath + ".fontsettings");
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
static string GetValue(XmlNode node, string name)
|
||||
{
|
||||
return node.Attributes.GetNamedItem(name).InnerText;
|
||||
}
|
||||
|
||||
static void SaveAsset(Object obj, string path)
|
||||
{
|
||||
Object existingAsset = AssetDatabase.LoadMainAssetAtPath(path);
|
||||
if(existingAsset != null)
|
||||
{
|
||||
EditorUtility.CopySerialized(obj, existingAsset);
|
||||
EditorUtility.SetDirty(existingAsset);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetDatabase.CreateAsset(obj, path);
|
||||
}
|
||||
}
|
||||
|
||||
static T LoadAsset<T>(string path , T defaultAsset) where T : Object
|
||||
{
|
||||
T existingAsset = AssetDatabase.LoadMainAssetAtPath(path) as T;
|
||||
if(existingAsset == null)
|
||||
{
|
||||
existingAsset = defaultAsset;
|
||||
}
|
||||
return existingAsset;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d9177045eec804d9198f1af54374656c
|
||||
timeCreated: 1465548788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
public class BuildCompressedPlayer : MonoBehaviour {
|
||||
|
||||
[MenuItem("Build/BuildAndroid")]
|
||||
static void BuildAndroid(){
|
||||
Build(string.Format("{0}_{1}_{2}.apk", PlayerSettings.productName, PlayerSettings.bundleVersion, PlayerSettings.Android.bundleVersionCode), BuildTarget.Android);
|
||||
}
|
||||
|
||||
[MenuItem("Build/BuildIOS")]
|
||||
static void BuildIOS(){
|
||||
Build("xcode", BuildTarget.iOS);
|
||||
}
|
||||
|
||||
static void Build(string locationPathName, BuildTarget buildTarget){
|
||||
BuildOptions opt = BuildOptions.SymlinkLibraries;
|
||||
// opt |= BuildOptions.Development;
|
||||
opt |= BuildOptions.CompressWithLz4;
|
||||
BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, locationPathName, buildTarget, opt);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 73c0cd415ede34cf0b5ab558028a71d8
|
||||
timeCreated: 1526896269
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
|
||||
/* kjems - http://answers.unity3d.com/questions/221651/yielding-with-www-in-editor.html
|
||||
|
||||
I made a ContinuationManager to handle the cases where I want to wait for a condition and then do something with an object.
|
||||
|
||||
The snippet below is an example of WWW using the ContinuationManager where the condition to trigger the continuation is www.isDone.
|
||||
The lambda closure captures the www object so it can be used when the www is done. The code is non-blocking.
|
||||
|
||||
var www = new WWW("someURL");
|
||||
ContinuationManager.Add(() => www.isDone, () => {
|
||||
if(!string.IsNullOrEmpty(www.error)){
|
||||
Debug.Log("WWW failed: " + www.error);
|
||||
}
|
||||
|
||||
Debug.Log("WWW result : " + www.text);
|
||||
});
|
||||
*/
|
||||
|
||||
internal static class ContinuationManager {
|
||||
private class Job {
|
||||
public Job(Func<bool> completed, Action continueWith){
|
||||
Completed = completed;
|
||||
ContinueWith = continueWith;
|
||||
}
|
||||
public Func<bool> Completed { get; private set; }
|
||||
public Action ContinueWith { get; private set; }
|
||||
}
|
||||
|
||||
private static readonly List<Job> jobs = new List<Job>();
|
||||
|
||||
public static void Add(Func<bool> completed, Action continueWith){
|
||||
if(!jobs.Any()){
|
||||
EditorApplication.update += Update;
|
||||
}
|
||||
jobs.Add(new Job(completed, continueWith));
|
||||
}
|
||||
|
||||
private static void Update(){
|
||||
for(int i = 0; i >= 0; --i){
|
||||
var jobIt = jobs[i];
|
||||
if(jobIt.Completed()){
|
||||
jobIt.ContinueWith();
|
||||
jobs.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
if(!jobs.Any()){
|
||||
EditorApplication.update -= Update;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 160bb54b28f45e14592818dfa8d093bf
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
|
||||
public class DevelopmentBuilder : IPreprocessBuildWithReport {
|
||||
|
||||
// 実行順
|
||||
public int callbackOrder {
|
||||
get{ return 0; }
|
||||
}
|
||||
|
||||
public void OnPreprocessBuild(BuildReport report) {
|
||||
UnityEditor.EditorUserBuildSettings.development = true;
|
||||
UnityEditor.EditorUserBuildSettings.iOSBuildConfigType = UnityEditor.iOSBuildType.Debug;
|
||||
UnityEditor.AssetDatabase.SaveAssets();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f93a50b4f5aa34178a7078755b891745
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
|
||||
public class EditorRestartUnity{
|
||||
[MenuItem("File/Restart")]
|
||||
static void RestartUnity(){
|
||||
// 別のUnityを起動したあとに自身を終了
|
||||
Process.Start(EditorApplication.applicationPath);
|
||||
EditorApplication.Exit(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9e272b580454b439996f43d8c6e7d64e
|
||||
timeCreated: 1470385604
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,349 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Experimental.SceneManagement;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
public static class EditorUtils {
|
||||
|
||||
public static void OpenAllScene(Func<float, EditorBuildSettingsScene, GameObject[], bool> editFunc){
|
||||
var currentScenePath = EditorSceneManager.GetActiveScene().path;
|
||||
var scenes = EditorBuildSettings.scenes.Where(s => s.enabled).ToArray();
|
||||
for(int i = 0; i < scenes.Length; ++i){
|
||||
var scene = scenes[i];
|
||||
EditorSceneManager.OpenScene(scene.path);
|
||||
var gameObjectArray = Resources.FindObjectsOfTypeAll<GameObject>().Where(go => string.IsNullOrEmpty(AssetDatabase.GetAssetPath(go)) && go.hideFlags == HideFlags.None).ToArray();
|
||||
var isChanged = editFunc((float)i / scenes.Length, scene, gameObjectArray);
|
||||
if(isChanged){
|
||||
EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene());
|
||||
}
|
||||
}
|
||||
EditorSceneManager.OpenScene(currentScenePath);
|
||||
}
|
||||
|
||||
public static GameObject[] GetAllAssets(){
|
||||
var pathArray = AssetDatabase.GetAllAssetPaths().Where(path => path.StartsWith("Assets/")).ToArray();
|
||||
return pathArray.Select(a => AssetDatabase.LoadAssetAtPath(a, typeof(GameObject)) as GameObject).Where(a => a != null).ToArray();
|
||||
}
|
||||
|
||||
public static void FindAllPrefabPath(string folderPath, Action<float, string> action){
|
||||
var pathArray = Directory.GetFiles(folderPath, "*.prefab");
|
||||
for(int i = 0; i < pathArray.Length; ++i){
|
||||
action((float)i / pathArray.Length, pathArray[i].Replace(Application.dataPath, "Assets"));
|
||||
}
|
||||
}
|
||||
public static void FindAllChildrensPrefabPath(string folderPath, Action<float, string> action){
|
||||
FindAllPrefabPath(folderPath, action);
|
||||
foreach(var childPath in Directory.GetDirectories(folderPath)){
|
||||
FindAllChildrensPrefabPath(childPath, action);
|
||||
}
|
||||
}
|
||||
|
||||
public static void EditPrefab(string folderPath, Func<GameObject, bool> editFunc){
|
||||
var prefab = PrefabUtility.LoadPrefabContents(folderPath);
|
||||
var isChanged = editFunc(prefab);
|
||||
if(isChanged){
|
||||
PrefabUtility.SaveAsPrefabAsset(prefab, folderPath);
|
||||
}
|
||||
PrefabUtility.UnloadPrefabContents(prefab);
|
||||
}
|
||||
|
||||
public static void FindAllChildrensPrefab(Transform transform, Action<Transform> action){
|
||||
for(int i = transform.childCount - 1; i >= 0; --i){
|
||||
Transform child = transform.GetChild(i);
|
||||
if(PrefabUtility.IsAnyPrefabInstanceRoot(child.gameObject)){
|
||||
action(child);
|
||||
}else{
|
||||
FindAllChildrensPrefab(child, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SwapPrefab(Transform target, GameObject swapPrefab){
|
||||
var to = (UnityEditor.PrefabUtility.InstantiatePrefab(swapPrefab) as GameObject).transform;
|
||||
to.parent = target.parent;
|
||||
to.localPosition = target.localPosition;
|
||||
to.localRotation = target.localRotation;
|
||||
to.localScale = target.localScale;
|
||||
GameObject.DestroyImmediate(target.gameObject);
|
||||
}
|
||||
|
||||
public static string MigratePrefabToPrefabVariant(GameObject basePrefab, GameObject migrationPrefab){
|
||||
var basePath = AssetDatabase.GetAssetPath(basePrefab);
|
||||
var path = AssetDatabase.GetAssetPath(migrationPrefab).Replace(".prefab", " Variant.prefab");
|
||||
var instance = PrefabUtility.InstantiatePrefab(basePrefab) as GameObject;
|
||||
PrefabUtility.SaveAsPrefabAsset(instance, path);
|
||||
GameObject.DestroyImmediate(instance);
|
||||
|
||||
var prefab = PrefabUtility.LoadPrefabContents(path);
|
||||
|
||||
var result = Migrate(prefab.transform, migrationPrefab.transform);
|
||||
if(!result){
|
||||
FixField(prefab.transform, migrationPrefab.transform);
|
||||
|
||||
PrefabUtility.SaveAsPrefabAsset(prefab, path);
|
||||
}
|
||||
PrefabUtility.UnloadPrefabContents(prefab);
|
||||
return path;
|
||||
}
|
||||
|
||||
private static bool Migrate(Transform targetTransform, Transform migrationTransform){
|
||||
var targetChildCount = targetTransform.childCount;
|
||||
for(int i = 0; i < migrationTransform.childCount; ++i){
|
||||
var migrationChild = migrationTransform.GetChild(i);
|
||||
Transform targetChild;
|
||||
if(i < targetChildCount){
|
||||
targetChild = targetTransform.GetChild(i);
|
||||
if(migrationChild.name != targetChild.name){
|
||||
var containsNameCount = ChildContaintsNameCount(targetTransform, migrationChild.name);
|
||||
if(containsNameCount == 0){
|
||||
targetChild = GameObject.Instantiate(migrationChild.gameObject, targetTransform).transform;
|
||||
targetChild.name = migrationChild.name;
|
||||
targetChild.SetSiblingIndex(migrationChild.GetSiblingIndex());
|
||||
++targetChildCount;
|
||||
}else if(containsNameCount == 1){
|
||||
for(int j = 0; j < targetChildCount; ++j){
|
||||
if(targetTransform.GetChild(j).name == migrationChild.name){
|
||||
targetChild = targetTransform.GetChild(j);
|
||||
targetChild.SetSiblingIndex(migrationChild.GetSiblingIndex());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Debug.LogError("同一階層に同じ名前のオブジェクトがある為中止します。");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
targetChild = GameObject.Instantiate(migrationChild.gameObject, targetTransform).transform;
|
||||
targetChild.name = migrationChild.name;
|
||||
++targetChildCount;
|
||||
}
|
||||
CopyComponents(targetChild, migrationChild);
|
||||
var result = Migrate(targetChild, migrationChild);
|
||||
if(result){
|
||||
return true;
|
||||
}
|
||||
targetChild.gameObject.SetActive(migrationChild.gameObject.activeSelf);
|
||||
}
|
||||
for(int i = 0; i < targetChildCount; ++i){
|
||||
var toChild = targetTransform.GetChild(i);
|
||||
var containsNameCount = ChildContaintsNameCount(migrationTransform, toChild.name);
|
||||
if(containsNameCount == 0){
|
||||
toChild.gameObject.SetActive(false);
|
||||
Debug.LogWarning("Change disable " + toChild.GetPath());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void FixField(Transform targetTransform, Transform migrationTransform){
|
||||
var targetChildCount = targetTransform.childCount;
|
||||
for(int i = 0; i < migrationTransform.childCount; ++i){
|
||||
var migrationChild = migrationTransform.GetChild(i);
|
||||
var targetChild = targetTransform.GetChild(i);
|
||||
if(migrationChild.name != targetChild.name){
|
||||
for(int j = 0; j < targetChildCount; ++j){
|
||||
if(targetTransform.GetChild(j).name == migrationChild.name){
|
||||
targetChild = targetTransform.GetChild(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
FixField(targetChild, migrationChild);
|
||||
ProcessReflection(migrationChild, targetChild, targetTransform);
|
||||
migrationChild.FindComponent<ParticleSystem>(fromPS => {
|
||||
if(fromPS.subEmitters.enabled){
|
||||
var fromSub = fromPS.subEmitters;
|
||||
FindChildrensByPath(targetTransform, migrationChild.GetPath(), t => {
|
||||
t.FindComponent<ParticleSystem>(toPS => {
|
||||
var toSub = toPS.subEmitters;
|
||||
for(int index = 0; index < fromSub.subEmittersCount; ++index){
|
||||
var fromTarget = fromSub.GetSubEmitterSystem(index);
|
||||
FindChildrensByPath(targetTransform, fromTarget.transform.GetPath(), toTarget => {
|
||||
toSub.SetSubEmitterSystem(index, toTarget.GetComponent<ParticleSystem>());
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
private static int ChildContaintsNameCount(Transform transform, string name){
|
||||
var counter = 0;
|
||||
foreach(Transform child in transform){
|
||||
if(child.name == name){
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
private static void CopyComponents(Transform to, Transform from){
|
||||
var components = from.gameObject.GetComponents<Component>();
|
||||
var targetComponents = to.gameObject.GetComponents<Component>();
|
||||
var currentComponentCount = new Dictionary<System.Type, int>();
|
||||
foreach(var component in components){
|
||||
var componentType = component.GetType();
|
||||
var componentCount = targetComponents.Count(c => c.GetType() == componentType);
|
||||
ComponentUtility.CopyComponent(component);
|
||||
if(componentCount == 0){
|
||||
ComponentUtility.PasteComponentAsNew(to.gameObject);
|
||||
}else if(componentCount == 1){
|
||||
var targetComponent = targetComponents.First(c => c.GetType() == componentType);
|
||||
ComponentUtility.PasteComponentValues(targetComponent);
|
||||
}else{
|
||||
if(!currentComponentCount.ContainsKey(componentType)){
|
||||
currentComponentCount.Add(componentType, 0);
|
||||
}
|
||||
var count = currentComponentCount[componentType];
|
||||
var targetComponentsWithType = targetComponents.Where(c => c.GetType() == componentType);
|
||||
if(count < targetComponentsWithType.Count()){
|
||||
var targetComponent = targetComponents.Where(c => c.GetType() == componentType).ElementAt(count);
|
||||
currentComponentCount[componentType] += 1;
|
||||
ComponentUtility.PasteComponentValues(targetComponent);
|
||||
}else{
|
||||
ComponentUtility.PasteComponentAsNew(to.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach(var component in targetComponents){
|
||||
var componentType = component.GetType();
|
||||
var componentCount = components.Count(c => c.GetType() == componentType);
|
||||
if(componentCount == 0){
|
||||
Debug.LogWarning("Deestroy component " + to.GetPath() + " " + componentType);
|
||||
GameObject.DestroyImmediate(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessReflection(Transform from, Transform to, Transform parent){
|
||||
var fromComponents = from.GetComponents<Component>();
|
||||
for(int i = 0; i < fromComponents.Length; ++i){
|
||||
var fromType = fromComponents[i].GetType();
|
||||
var toComponent = to.GetComponent(fromType);
|
||||
if(toComponent == null){
|
||||
continue;
|
||||
}
|
||||
MemberInfo[] members = fromType.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
foreach(var m in members){
|
||||
if(m.MemberType != MemberTypes.Field){
|
||||
continue;
|
||||
}
|
||||
System.Type fieldType = ((FieldInfo)m).FieldType;
|
||||
if(fieldType == typeof(Transform) || fieldType == typeof(GameObject)){
|
||||
string targetPath;
|
||||
FieldInfo field = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if(fieldType == typeof(Transform)){
|
||||
Transform t = (Transform)field.GetValue(fromComponents[i]);
|
||||
if(t == null){
|
||||
continue;
|
||||
}
|
||||
targetPath = t.GetPath();
|
||||
}else if(fieldType == typeof(GameObject)){
|
||||
GameObject obj = (GameObject)field.GetValue(fromComponents[i]);
|
||||
if(obj == null){
|
||||
continue;
|
||||
}
|
||||
targetPath = obj.transform.GetPath();
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
FindChildrensByPath(parent, targetPath, targetTransform => {
|
||||
FieldInfo setField = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if(setField == null){
|
||||
Debug.Log("setField is null " + m.Name);
|
||||
}else{
|
||||
if(fieldType == typeof(Transform)){
|
||||
setField.SetValue(toComponent, targetTransform);
|
||||
}else if(fieldType == typeof(GameObject)){
|
||||
setField.SetValue(toComponent, targetTransform.gameObject);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else if(fieldType == typeof(Transform[])){
|
||||
FieldInfo field = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
Transform[] t = (Transform[])field.GetValue(fromComponents[i]);
|
||||
if(t == null){
|
||||
continue;
|
||||
}
|
||||
var targetPathArray = new string[t.Length];
|
||||
for(int j = 0; j < t.Length; ++j){
|
||||
if(t[j] == null){
|
||||
targetPathArray[j] = null;
|
||||
}else{
|
||||
targetPathArray[j] = t[j].GetPath();
|
||||
}
|
||||
}
|
||||
var newTransformArray = new Transform[t.Length];
|
||||
for(int j = 0; j < t.Length; ++j){
|
||||
if(targetPathArray[j] == null){
|
||||
continue;
|
||||
}
|
||||
FindChildrensByPath(parent, targetPathArray[j], targetTransform => {
|
||||
newTransformArray[j] = targetTransform;
|
||||
});
|
||||
}
|
||||
FieldInfo setField = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if(setField == null){
|
||||
Debug.Log("setField is null " + m.Name);
|
||||
}else{
|
||||
setField.SetValue(toComponent, newTransformArray);
|
||||
}
|
||||
}else if(fieldType == typeof(GameObject[])){
|
||||
FieldInfo field = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
GameObject[] t = (GameObject[])field.GetValue(fromComponents[i]);
|
||||
if(t == null){
|
||||
continue;
|
||||
}
|
||||
var targetPathArray = new string[t.Length];
|
||||
for(int j = 0; j < t.Length; ++j){
|
||||
if(t[j] == null){
|
||||
targetPathArray[j] = null;
|
||||
}else{
|
||||
targetPathArray[j] = t[j].transform.GetPath();
|
||||
}
|
||||
}
|
||||
var newArray = new GameObject[t.Length];
|
||||
for(int j = 0; j < t.Length; ++j){
|
||||
if(targetPathArray[j] == null){
|
||||
continue;
|
||||
}
|
||||
FindChildrensByPath(parent, targetPathArray[j], targetTransform => {
|
||||
newArray[j] = targetTransform.gameObject;
|
||||
});
|
||||
}
|
||||
FieldInfo setField = fromType.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if(setField == null){
|
||||
Debug.Log("setField is null " + m.Name);
|
||||
}else{
|
||||
setField.SetValue(toComponent, newArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool FindChildrensByPath(Transform t, string path, Action<Transform> callback){
|
||||
for(int i = 0; i < t.childCount; ++i){
|
||||
Transform child = t.GetChild(i);
|
||||
if(child.GetPath().Replace(" Variant", "") == path){
|
||||
callback(child);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < t.childCount; ++i){
|
||||
Transform child = t.GetChild(i);
|
||||
if(FindChildrensByPath(child, path, callback)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d534ae6e5c0ae498088916e672848230
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public class EmptyFolderDestroyer {
|
||||
|
||||
static EmptyFolderDestroyer(){
|
||||
EditorApplication.playModeStateChanged += state => {
|
||||
if(state == PlayModeStateChange.EnteredEditMode){
|
||||
DirectoryInfo directory = new DirectoryInfo(Application.dataPath);
|
||||
CheckFolder(directory);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static bool CheckFolder(DirectoryInfo directory){
|
||||
DirectoryInfo[] childrens = directory.GetDirectories();
|
||||
if(childrens.Length > 0){
|
||||
bool deleted = false;
|
||||
foreach(DirectoryInfo childDirectory in childrens){
|
||||
deleted = CheckFolder(childDirectory);
|
||||
}
|
||||
return deleted ? CheckFolder(directory) : false;
|
||||
}else if(directory.GetFiles().Length <= 0){
|
||||
DeleteFolder(directory.FullName);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DeleteFolder(string path){
|
||||
Debug.Log(string.Format("空フォルダを削除 : {0}", path));
|
||||
System.IO.Directory.Delete(path, true);
|
||||
System.IO.File.Delete(string.Format("{0}.meta", path));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 14638c40afaa74329bacee043a65e015
|
||||
timeCreated: 1490339018
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
|
||||
[CustomEditor(typeof(MeshRenderer))]
|
||||
public class MeshRendererInspector : Editor {
|
||||
public override void OnInspectorGUI(){
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
// sorting order
|
||||
SerializedProperty sortOrderProperty = serializedObject.FindProperty("m_SortingOrder");
|
||||
sortOrderProperty.intValue = EditorGUILayout.IntField("Order in Layer", sortOrderProperty.intValue);
|
||||
|
||||
// sorting layer
|
||||
// SerializedProperty layerIDProperty = serializedObject.FindProperty("m_SortingLayerID");
|
||||
// var index = System.Array.FindIndex(SortingLayer.layers, layer => layer.id == layerIDProperty.intValue);
|
||||
// index = EditorGUILayout.Popup(index, (from layer in SortingLayer.layers select layer.name).ToArray());
|
||||
// layerIDProperty.intValue = SortingLayer.layers[index].id;
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7b02150d276f346c084d16910016c901
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class ObliqueProjection : MonoBehaviour {
|
||||
|
||||
[Range(-1f, 1f)]
|
||||
public float horizontal;
|
||||
[Range(-1f, 1f)]
|
||||
public float vertical;
|
||||
public float distance;
|
||||
private Vector3 orgPosition;
|
||||
|
||||
void OnEnable(){
|
||||
EditorApplication.update += EditorUpdate;
|
||||
orgPosition = transform.localPosition;
|
||||
}
|
||||
|
||||
void OnDisable(){
|
||||
EditorApplication.update -= EditorUpdate;
|
||||
}
|
||||
|
||||
void EditorUpdate(){
|
||||
var cam = GetComponent<Camera>();
|
||||
var proj = cam.projectionMatrix;
|
||||
proj.m02 = horizontal;
|
||||
proj.m12 = vertical;
|
||||
cam.projectionMatrix = proj;
|
||||
var tan = Mathf.Tan(cam.fieldOfView * 0.5f * Mathf.Deg2Rad);
|
||||
var rect = cam.pixelRect;
|
||||
var ratio = (float)rect.width / (float)rect.height;
|
||||
transform.localPosition = orgPosition + new Vector3(-horizontal * distance * tan * ratio, -vertical * distance * tan, 0f);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d0f55f0fdd4aa4d1594e6024b695b52e
|
||||
timeCreated: 1521183141
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using UnityEngine;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
|
||||
public class OverrideFile : AssetPostprocessor {
|
||||
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath){
|
||||
if(Event.current == null || Event.current.type != EventType.DragPerform) return;
|
||||
|
||||
foreach(var asset in importedAssets){
|
||||
var rootAsset = ParentFile(asset);
|
||||
if(rootAsset == null) continue;
|
||||
|
||||
if(EditorUtility.DisplayDialog("override", rootAsset + "を上書きしますか?", "上書き", "両方残す")){
|
||||
File.Copy(asset, rootAsset, true);
|
||||
AssetDatabase.DeleteAsset(asset);
|
||||
|
||||
AssetDatabase.ImportAsset(rootAsset);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static string ParentFile(string name){
|
||||
var match = Regex.Match(name, @"(?<item>.*) 1.(?<extension>.*)");
|
||||
if(!match.Success) return null;
|
||||
else return string.Format("{0}.{1}", match.Groups["item"], match.Groups["extension"]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7139f64bf261d41ed806517599cf7ed4
|
||||
timeCreated: 1461068180
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
|
||||
[InitializeOnLoad]
|
||||
class SceneReloader : AssetPostprocessor {
|
||||
|
||||
private static bool isReload = false;
|
||||
|
||||
static SceneReloader(){
|
||||
EditorApplication.update += Update;
|
||||
}
|
||||
|
||||
private static void Update(){
|
||||
if(isReload){
|
||||
isReload = false;
|
||||
EditorSceneManager.OpenScene(EditorSceneManager.GetActiveScene().path);
|
||||
}
|
||||
}
|
||||
|
||||
// 反応しない
|
||||
// static void OnPreprocessAsset(){
|
||||
// isReload = true;
|
||||
// Debug.Log("PreprocessAsset");
|
||||
// }
|
||||
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths){
|
||||
// 暫定対応
|
||||
// Assetインポート->Scene更新確認Dialog->更新になるので途中での保存には対処出来ない
|
||||
foreach(var importedAsset in importedAssets){
|
||||
if(importedAsset.Contains(".unity")){
|
||||
isReload = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3506533d15c8d4f2f9cb831c2870c717
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
class TextureModifier : AssetPostprocessor {
|
||||
|
||||
void OnPostprocessTexture (Texture2D texture){
|
||||
if (!assetPath.EndsWith ("Dither.png")) {
|
||||
return;
|
||||
}
|
||||
|
||||
var texw = texture.width;
|
||||
var texh = texture.height;
|
||||
|
||||
var pixels = texture.GetPixels ();
|
||||
var offs = 0;
|
||||
|
||||
var k1Per15 = 1.0f / 15.0f;
|
||||
var k1Per16 = 1.0f / 16.0f;
|
||||
var k3Per16 = 3.0f / 16.0f;
|
||||
var k5Per16 = 5.0f / 16.0f;
|
||||
var k7Per16 = 7.0f / 16.0f;
|
||||
|
||||
for (var y = 0; y < texh; y++) {
|
||||
for (var x = 0; x < texw; x++) {
|
||||
float a = pixels [offs].a;
|
||||
float r = pixels [offs].r;
|
||||
float g = pixels [offs].g;
|
||||
float b = pixels [offs].b;
|
||||
|
||||
var a2 = Mathf.Clamp01 (Mathf.Floor (a * 16) * k1Per15);
|
||||
var r2 = Mathf.Clamp01 (Mathf.Floor (r * 16) * k1Per15);
|
||||
var g2 = Mathf.Clamp01 (Mathf.Floor (g * 16) * k1Per15);
|
||||
var b2 = Mathf.Clamp01 (Mathf.Floor (b * 16) * k1Per15);
|
||||
|
||||
var ae = a - a2;
|
||||
var re = r - r2;
|
||||
var ge = g - g2;
|
||||
var be = b - b2;
|
||||
|
||||
pixels [offs].a = a2;
|
||||
pixels [offs].r = r2;
|
||||
pixels [offs].g = g2;
|
||||
pixels [offs].b = b2;
|
||||
|
||||
var n1 = offs + 1;
|
||||
var n2 = offs + texw - 1;
|
||||
var n3 = offs + texw;
|
||||
var n4 = offs + texw + 1;
|
||||
|
||||
if (x < texw - 1) {
|
||||
pixels [n1].a += ae * k7Per16;
|
||||
pixels [n1].r += re * k7Per16;
|
||||
pixels [n1].g += ge * k7Per16;
|
||||
pixels [n1].b += be * k7Per16;
|
||||
}
|
||||
|
||||
if (y < texh - 1) {
|
||||
pixels [n3].a += ae * k5Per16;
|
||||
pixels [n3].r += re * k5Per16;
|
||||
pixels [n3].g += ge * k5Per16;
|
||||
pixels [n3].b += be * k5Per16;
|
||||
|
||||
if (x > 0) {
|
||||
pixels [n2].a += ae * k3Per16;
|
||||
pixels [n2].r += re * k3Per16;
|
||||
pixels [n2].g += ge * k3Per16;
|
||||
pixels [n2].b += be * k3Per16;
|
||||
}
|
||||
|
||||
if (x < texw - 1) {
|
||||
pixels [n4].a += ae * k1Per16;
|
||||
pixels [n4].r += re * k1Per16;
|
||||
pixels [n4].g += ge * k1Per16;
|
||||
pixels [n4].b += be * k1Per16;
|
||||
}
|
||||
}
|
||||
|
||||
offs++;
|
||||
}
|
||||
}
|
||||
|
||||
texture.SetPixels (pixels);
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
EditorUtility.CompressTexture (texture, TextureFormat.RGBA4444, UnityEditor.TextureCompressionQuality.Best);
|
||||
#else
|
||||
EditorUtility.CompressTexture (texture, TextureFormat.RGBA4444, TextureCompressionQuality.Best);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 755998079b2404170980be49465fda06
|
||||
timeCreated: 1474456189
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0dd5f0e8659264f84ba2e86340d856aa
|
||||
folderAsset: yes
|
||||
timeCreated: 1474347172
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
|
||||
public class ExportAssetBundle {
|
||||
|
||||
[MenuItem("Tools/Export AssetBundle")]
|
||||
static void Export(){
|
||||
Build("/iOS/", BuildTarget.iOS);
|
||||
// Build("/Android/", BuildTarget.Android);
|
||||
}
|
||||
|
||||
private static void Build(string path, BuildTarget targetPlatform){
|
||||
Directory.CreateDirectory(Application.streamingAssetsPath + path);
|
||||
BuildPipeline.BuildAssetBundles(Application.streamingAssetsPath + path, BuildAssetBundleOptions.ChunkBasedCompression, targetPlatform);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7c335a6145daa4e5ba9a31c7e31f20c7
|
||||
timeCreated: 1459322533
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
public static class PlayerPrefsResetter {
|
||||
|
||||
[MenuItem("Tools/ResetTool/Reset PlayerPrefs")]
|
||||
public static void ResetPlayerPrefs(){
|
||||
PlayerPrefs.DeleteAll();
|
||||
PlayerPrefs.Save();
|
||||
Debug.Log("Reset PlayerPrefs");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ResetTool/Reset Data")]
|
||||
public static void ResetData(){
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Main_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Settings_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Wallet_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Purchaser_Data, Const.GameDataTag);
|
||||
Debug.Log("Reset Data");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ResetTool/Reset All Data")]
|
||||
public static void ResetAllData(){
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Main_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Settings_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Wallet_Data, Const.GameDataTag);
|
||||
UsayaStorageManager.Remove(UsayaStorageFilename.Purchaser_Data, Const.GameDataTag);
|
||||
PlayerPrefs.DeleteAll();
|
||||
PlayerPrefs.Save();
|
||||
Debug.Log("Reset All Data");
|
||||
}
|
||||
[MenuItem("Tools/ResetTool/Delete All Data")]
|
||||
public static void DeleteAllData(){
|
||||
if(!Directory.Exists(Application.persistentDataPath)){
|
||||
Debug.Log("Aready deleted.");
|
||||
return;
|
||||
}
|
||||
Directory.Delete(Application.persistentDataPath, true);
|
||||
Debug.Log("Delete All Data");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6aa4e9af91459451db718ca557fe66cd
|
||||
timeCreated: 1474347100
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 43a39b010bb1b4f089436a00bfbc830b
|
||||
folderAsset: yes
|
||||
timeCreated: 1475475984
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
using System.Collections;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class UVChecker : EditorWindow {
|
||||
private GameObject targetGameObject;
|
||||
private MeshFilter targetMeshFilter;
|
||||
private Texture2D tex;
|
||||
|
||||
[MenuItem("Window/UVChecker")]
|
||||
private static void Open(){
|
||||
GetWindow<UVChecker>();
|
||||
}
|
||||
|
||||
private void OnGUI(){
|
||||
targetGameObject = EditorGUILayout.ObjectField("TargetMesh", targetGameObject, typeof(GameObject), true) as GameObject;
|
||||
if(GUILayout.Button("Execute")){
|
||||
targetMeshFilter = targetGameObject.GetComponent<MeshFilter>();
|
||||
tex = new Texture2D(256, 256);
|
||||
var mesh = targetMeshFilter.sharedMesh;
|
||||
DrawUV(mesh);
|
||||
}
|
||||
if(tex != null){
|
||||
EditorGUI.DrawPreviewTexture(new Rect(10, 50, tex.width, tex.height), tex);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawUV(Mesh mesh){
|
||||
var uvs = mesh.uv;
|
||||
var tri = mesh.triangles;
|
||||
|
||||
for(int i_base = 0; i_base < tri.Length; i_base += 3){
|
||||
int i_1 = i_base;
|
||||
int i_2 = i_base + 1;
|
||||
int i_3 = i_base + 2;
|
||||
|
||||
Vector2 uv1 = uvs[tri[i_1]];
|
||||
Vector2 uv2 = uvs[tri[i_2]];
|
||||
Vector2 uv3 = uvs[tri[i_3]];
|
||||
|
||||
DrawLine(uv1, uv2);
|
||||
DrawLine(uv2, uv3);
|
||||
DrawLine(uv3, uv1);
|
||||
}
|
||||
|
||||
tex.Apply(false);
|
||||
|
||||
UVLog(uvs);
|
||||
}
|
||||
|
||||
private void UVLog(Vector2[] uvs){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach(var uv in uvs){
|
||||
sb.AppendLine(uv.ToString());
|
||||
}
|
||||
|
||||
Debug.Log(sb.ToString());
|
||||
}
|
||||
|
||||
private void DrawLine(Vector2 from, Vector2 to){
|
||||
int x0 = Mathf.RoundToInt(from.x * tex.width);
|
||||
int y0 = Mathf.RoundToInt(from.y * tex.height);
|
||||
int x1 = Mathf.RoundToInt(to.x * tex.width);
|
||||
int y1 = Mathf.RoundToInt(to.y * tex.height);
|
||||
|
||||
DrawLine(x0, y0, x1, y1, Color.red);
|
||||
}
|
||||
|
||||
private void DrawLine(int x0, int y0, int x1, int y1, Color col){
|
||||
int dy = y1 - y0;
|
||||
int dx = x1 - x0;
|
||||
int stepx, stepy;
|
||||
|
||||
if(dy < 0){
|
||||
dy = -dy;
|
||||
stepy = -1;
|
||||
}else{
|
||||
stepy = 1;
|
||||
}
|
||||
if(dx < 0){
|
||||
dx = -dx;
|
||||
stepx = -1;
|
||||
}else{
|
||||
stepx = 1;
|
||||
}
|
||||
dy <<= 1;
|
||||
dx <<= 1;
|
||||
|
||||
float fraction = 0;
|
||||
|
||||
tex.SetPixel(x0, y0, col);
|
||||
if(dx > dy){
|
||||
fraction = dy - (dx >> 1);
|
||||
while(Mathf.Abs(x0 - x1) > 1){
|
||||
if(fraction >= 0){
|
||||
y0 += stepy;
|
||||
fraction -= dx;
|
||||
}
|
||||
x0 += stepx;
|
||||
fraction += dy;
|
||||
tex.SetPixel(x0, y0, col);
|
||||
}
|
||||
}else{
|
||||
fraction = dx - (dy >> 1);
|
||||
while(Mathf.Abs(y0 - y1) > 1){
|
||||
if(fraction >= 0){
|
||||
x0 += stepx;
|
||||
fraction -= dy;
|
||||
}
|
||||
y0 += stepy;
|
||||
fraction += dx;
|
||||
tex.SetPixel(x0, y0, col);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d5ec281105a8a4d83928a39475a0e015
|
||||
timeCreated: 1475475744
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f1b645066b4c14f2da8a355d54b2d42b
|
||||
folderAsset: yes
|
||||
timeCreated: 1505305681
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package jp.usaya.lib;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
|
||||
/**
|
||||
* Created by sutoatsushi on 2018/03/23.
|
||||
*/
|
||||
|
||||
public class NotificationReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
//値の取得
|
||||
Integer primary_key = intent.getIntExtra("PRIMARY_KEY", 0);
|
||||
String ticker = intent.getStringExtra("TICKER");
|
||||
String content_title = intent.getStringExtra("CONTENT_TITLE");
|
||||
String content_text = intent.getStringExtra ("CONTENT_TEXT");
|
||||
String sound_path = intent.getStringExtra("SOUND_PATH");
|
||||
|
||||
// intentからPendingIntentを作成
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
// LargeIcon の Bitmap を生成
|
||||
final PackageManager pm = context.getPackageManager();
|
||||
ApplicationInfo applicationInfo = null;
|
||||
try {
|
||||
applicationInfo = pm.getApplicationInfo(context.getPackageName(),PackageManager.GET_META_DATA);
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
final int appIconResId = applicationInfo.icon;
|
||||
Bitmap largeIcon = BitmapFactory.decodeResource(context.getResources(), appIconResId);
|
||||
|
||||
// NotificationBuilderを作成
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
|
||||
builder.setContentIntent(pendingIntent);
|
||||
builder.setTicker(ticker); //通知到着時に通知バーに表示(4.4まで)
|
||||
builder.setSmallIcon(appIconResId); //アイコン
|
||||
builder.setContentTitle(content_title); // タイトル
|
||||
builder.setContentText(content_text); // 本文(サブタイトル)
|
||||
builder.setLargeIcon(largeIcon); //開いた時のアイコン
|
||||
builder.setWhen(System.currentTimeMillis()); //通知に表示される時間(※通知時間ではない!)
|
||||
|
||||
// 通知時の音・バイブ・ライト
|
||||
if( sound_path.equals("Default") ){
|
||||
builder.setDefaults(Notification.DEFAULT_SOUND);
|
||||
}else{
|
||||
builder.setSound( Uri.parse(sound_path));
|
||||
}
|
||||
builder.setDefaults(Notification.DEFAULT_VIBRATE);
|
||||
builder.setDefaults(Notification.DEFAULT_LIGHTS);
|
||||
builder.setAutoCancel(true);
|
||||
|
||||
// NotificationManagerを取得
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(Service.NOTIFICATION_SERVICE);
|
||||
// Notificationを作成して通知
|
||||
manager.notify(primary_key, builder.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fba37493533674d0daeacdc649fa71d2
|
||||
timeCreated: 1521809007
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
package jp.usaya.lib;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
// import com.google.firebase.messaging.MessageForwardingService;
|
||||
import com.unity3d.player.UnityPlayer;
|
||||
import com.unity3d.player.UnityPlayerActivity;
|
||||
// import com.onevcat.uniwebview.AndroidPlugin;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.*;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import android.os.SystemClock;
|
||||
import java.io.File;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
import android.content.Context;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
|
||||
import android.content.pm.ActivityInfo;
|
||||
|
||||
// public class UsayaUnityPlayerActivity extends com.unity3d.player.UnityPlayerActivity // NCMB使わない場合はこっち
|
||||
public class UsayaUnityPlayerActivity extends com.nifcloud.mbaas.ncmbfcmplugin.UnityPlayerActivity
|
||||
{
|
||||
public UsayaUnityPlayerActivity()
|
||||
{
|
||||
}
|
||||
|
||||
protected void onNewIntent(Intent intent)
|
||||
{
|
||||
// Intent message = new Intent(this, MessageForwardingService.class);
|
||||
// message.setAction(MessageForwardingService.ACTION_REMOTE_INTENT);
|
||||
// message.putExtras(intent);
|
||||
// startService(message);
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
if(mUnityPlayer != null)
|
||||
{
|
||||
mUnityPlayer.quit();
|
||||
mUnityPlayer = null;
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
public float getHeightPixels()
|
||||
{
|
||||
DisplayMetrics dMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getRealMetrics(dMetrics);
|
||||
return dMetrics.heightPixels;
|
||||
}
|
||||
|
||||
public float getWidthPixels()
|
||||
{
|
||||
DisplayMetrics dMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getRealMetrics(dMetrics);
|
||||
return dMetrics.widthPixels;
|
||||
}
|
||||
|
||||
public float getPointHeight()
|
||||
{
|
||||
DisplayMetrics dMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getRealMetrics(dMetrics);
|
||||
return dMetrics.heightPixels / dMetrics.density;
|
||||
}
|
||||
|
||||
public float getPointWidth()
|
||||
{
|
||||
DisplayMetrics dMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getRealMetrics(dMetrics);
|
||||
return dMetrics.widthPixels / dMetrics.density ;
|
||||
}
|
||||
|
||||
public void forceOrientationPortrait(){
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
public void forceOrientationLandscape(){
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
||||
public long elapsedRealtime(){
|
||||
return SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
public void postTwitterOrFacebook(boolean isTwitter, String message, String url, String imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
String name = isTwitter ? "com.twitter.android" : "com.facebook.katana";
|
||||
String type = imagePath.equals("") ? "text/plain" : getIntentTypeForImage(imagePath);
|
||||
Intent intent = createAppIntent(name, "android.intent.action.SEND", type);
|
||||
if(intent != null)
|
||||
{
|
||||
intent.putExtra("android.intent.extra.TEXT", (new StringBuilder(String.valueOf(message))).append(BR).append(url).toString());
|
||||
if(!imagePath.equals(""))
|
||||
intent.putExtra("android.intent.extra.STREAM", Uri.fromFile(new File(imagePath)));
|
||||
UnityPlayer.currentActivity.startActivity(intent);
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "0");
|
||||
} else
|
||||
{
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "1");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.e(TAG, "postTwitterOrFacebook", e);
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "2");
|
||||
}
|
||||
}
|
||||
|
||||
public void createChooser(String message, String imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
String type = imagePath.equals("") ? "text/plain" : getIntentTypeForImage(imagePath);
|
||||
Intent intent = createAppIntent(null, "android.intent.action.SEND", type);
|
||||
if(intent != null)
|
||||
{
|
||||
intent.putExtra("android.intent.extra.TEXT", message);
|
||||
if(!imagePath.equals(""))
|
||||
intent.putExtra("android.intent.extra.STREAM", Uri.fromFile(new File(imagePath)));
|
||||
UnityPlayer.currentActivity.startActivity(Intent.createChooser(intent, "Share"));
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "0");
|
||||
} else
|
||||
{
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "1");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.e(TAG, "createChooser", e);
|
||||
UnityPlayer.UnitySendMessage(UNITY_SEND_GAMEOBJECT, UNITY_SEND_CALLBACK, "2");
|
||||
}
|
||||
}
|
||||
|
||||
private String getIntentTypeForImage(String imagePath)
|
||||
{
|
||||
String extension = imagePath.substring(imagePath.lastIndexOf(".") + 1).toLowerCase(Locale.getDefault());
|
||||
return extension != ".png" ? "image/jpg" : "image/png";
|
||||
}
|
||||
|
||||
private Intent createAppIntent(String name, String action, String type)
|
||||
throws Exception
|
||||
{
|
||||
Intent intent;
|
||||
List ris;
|
||||
Iterator iterator;
|
||||
try
|
||||
{
|
||||
intent = new Intent(action);
|
||||
intent.setType(type);
|
||||
ris = UnityPlayer.currentActivity.getPackageManager().queryIntentActivities(intent, 0x10000);
|
||||
if(name == "" || name == null)
|
||||
return ris.isEmpty() ? null : intent;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
iterator = ris.iterator();
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
ResolveInfo ri = (ResolveInfo)iterator.next();
|
||||
if(ri.activityInfo.packageName.equals(name))
|
||||
{
|
||||
intent.setClassName(ri.activityInfo.packageName, ri.activityInfo.name);
|
||||
return intent;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void sendNotification(long unixtime, int primary_key, String ticker, String content_title, String content_text, String sound_path)
|
||||
{
|
||||
// インテント作成
|
||||
Activity activity = UnityPlayer.currentActivity;
|
||||
Context context = activity.getApplicationContext();
|
||||
Intent intent = new Intent(context, NotificationReceiver.class);
|
||||
//渡す値
|
||||
intent.putExtra("PRIMARY_KEY", primary_key);
|
||||
intent.putExtra("TICKER", ticker);
|
||||
intent.putExtra("CONTENT_TITLE", content_title);
|
||||
intent.putExtra("CONTENT_TEXT", content_text);
|
||||
intent.putExtra("SOUND_PATH", sound_path);
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(unixtime);
|
||||
|
||||
PendingIntent sender = PendingIntent.getBroadcast(context, primary_key, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
AlarmManager alarm = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
||||
alarm.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis() , sender);
|
||||
}
|
||||
public void clearNotification(int primary_key)
|
||||
{
|
||||
// インテント作成
|
||||
Activity activity = UnityPlayer.currentActivity;
|
||||
Context context = activity.getApplicationContext();
|
||||
Intent intent = new Intent(context,NotificationReceiver.class);
|
||||
|
||||
PendingIntent sender = PendingIntent.getBroadcast(context, primary_key, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager alarm = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
||||
alarm.cancel(sender);
|
||||
sender.cancel();
|
||||
}
|
||||
|
||||
public static final String TAG = "UsayaUnityPlayerActivity";
|
||||
public static final String BR = System.getProperty("line.separator");
|
||||
public static final String UNITY_SEND_GAMEOBJECT = "ShareManager";
|
||||
public static final String UNITY_SEND_CALLBACK = "OnShareManagerResult";
|
||||
public static final String RESULT_SUCCESS = "0";
|
||||
public static final String RESULT_NOT_AVAILABLE = "1";
|
||||
public static final String RESULT_ERROR = "2";
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1d2033f57cf7d4c7388ff1c7330f7e13
|
||||
timeCreated: 1505376972
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9d5228357859d4cbc8b327ec4aa665ac
|
||||
folderAsset: yes
|
||||
timeCreated: 1495443112
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
|
|
@ -0,0 +1,121 @@
|
|||
fileFormatVersion: 2
|
||||
guid: be9c6b7d0e0264a8cae5ecd136b2b5d0
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 256
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 256
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 4
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 13
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: fbe5b219faf0247128f647c4af7d32fb
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3865fff9beea4eaf9bf9e375ae00fea
|
||||
folderAsset: yes
|
||||
timeCreated: 1505292483
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 11c71e8e010bc4f41b23483713363284
|
||||
folderAsset: yes
|
||||
timeCreated: 1505303258
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a1f7a4504e34b42aab2e242344e11b55
|
||||
timeCreated: 1521809007
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9ae001176e96c4ba2b2d8ff79bbbc03b
|
||||
timeCreated: 1505373166
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,394 @@
|
|||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
public enum VibrationType {
|
||||
None,
|
||||
Once,
|
||||
OnceStrong,
|
||||
OnceWeak,
|
||||
DoubleStrong,
|
||||
DoubleWeak,
|
||||
Triple,
|
||||
}
|
||||
|
||||
public static class NativeUtils {
|
||||
|
||||
// Vibration Effect Type
|
||||
public static readonly string vEffectOneShot = "EFFECT_DEFAULT_AMPLITUDE";
|
||||
public static readonly string vEffectClick = "EFFECT_CLICK";
|
||||
public static readonly string vEffectDClick = "EFFECT_DOUBLE_CLICK";
|
||||
public static readonly string vEffectHClick = "EFFECT_HEAVY_CLICK";
|
||||
public static readonly string vEffectTick = "EFFECT_TICK";
|
||||
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern int _getHeight();
|
||||
[DllImport("__Internal")]
|
||||
private static extern int _getWidth();
|
||||
[DllImport("__Internal")]
|
||||
private static extern int _getPointHeight();
|
||||
[DllImport("__Internal")]
|
||||
private static extern int _getPointWidth();
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool _enableReviewWindow();
|
||||
[DllImport("__Internal")]
|
||||
private static extern int _reviewWindow(string appid);
|
||||
[DllImport("__Internal")]
|
||||
private static extern long _systemClockTime();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool _canOpenTwitter();
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool _canOpenFacebook();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _registerNotification();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _scheduleNotification(int triggerInSeconds, string message, string alarmId);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _cancelAllNotifications();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibration(int id);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationOnce();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationOnceStrong();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationOnceWeak();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationDoubleStrong();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationDoubleWeak();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _PlayVibrationTriple();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _showAlert(string title, string message);
|
||||
|
||||
#elif UNITY_ANDROID
|
||||
|
||||
private static void _Vibration(){
|
||||
Handheld.Vibrate();
|
||||
}
|
||||
private static void _VibrationAndroid(string effectType, long msec = 100){
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
using (AndroidJavaObject vibrator = jo.Call<AndroidJavaObject>("getSystemService", "vibrator"))
|
||||
{
|
||||
if(androidOSVersion() >= 26 )
|
||||
{
|
||||
using (AndroidJavaClass vCls = new AndroidJavaClass("android.os.VibrationEffect"))
|
||||
{
|
||||
AndroidJavaObject vEffect = default;
|
||||
if( effectType != NativeUtils.vEffectOneShot && androidOSVersion() >= 29)
|
||||
{
|
||||
vEffect = vCls.CallStatic<AndroidJavaObject>("createPredefined", vCls.GetStatic<int>(effectType));
|
||||
}
|
||||
else
|
||||
{
|
||||
vEffect = vCls.CallStatic<AndroidJavaObject>("createOneShot", new object[] { msec, vCls.GetStatic<int>("DEFAULT_AMPLITUDE") });
|
||||
}
|
||||
vibrator.Call("vibrate", vEffect);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vibrator.Call("vibrate", msec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int androidOSVersion() {
|
||||
#if !UNITY_EDITOR
|
||||
using (var version = new AndroidJavaClass("android.os.Build$VERSION"))
|
||||
{
|
||||
return version.GetStatic<int>("SDK_INT");
|
||||
}
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
public static int getHeight(){
|
||||
int height = 0;
|
||||
#if UNITY_EDITOR
|
||||
height = Screen.height;
|
||||
#elif UNITY_IOS
|
||||
height = _getHeight();
|
||||
#elif UNITY_ANDROID
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
height = (int)jo.Call<float>("getHeightPixels");
|
||||
}
|
||||
#endif
|
||||
return height;
|
||||
}
|
||||
public static int getWidth(){
|
||||
int width = 0;
|
||||
#if UNITY_EDITOR
|
||||
width = Screen.width;
|
||||
#elif UNITY_IOS
|
||||
width = _getWidth();
|
||||
#elif UNITY_ANDROID
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
width = (int)jo.Call<float>("getWidthPixels");
|
||||
}
|
||||
#endif
|
||||
return width;
|
||||
}
|
||||
|
||||
public static int getPointHeight(){
|
||||
int height = 0;
|
||||
#if UNITY_EDITOR
|
||||
height = Screen.height;
|
||||
#elif UNITY_IOS
|
||||
if (Application.platform != RuntimePlatform.OSXEditor) {
|
||||
height = _getPointHeight();
|
||||
}
|
||||
#elif UNITY_ANDROID
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
height = (int)jo.Call<float>("getPointHeight");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
return height;
|
||||
}
|
||||
public static int getPointWidth(){
|
||||
int width = 0;
|
||||
#if UNITY_EDITOR
|
||||
width = Screen.width;
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
if (Application.platform != RuntimePlatform.OSXEditor) {
|
||||
width = _getPointWidth();
|
||||
}
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
width = (int)jo.Call<float>("getPointWidth");
|
||||
}
|
||||
#endif
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
public static void forceOrientationLandscape(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
#elif UNITY_ANDROID
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
jo.Call("forceOrientationLandscape");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
public static void forceOrientationPortrait(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
#elif UNITY_ANDROID
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
jo.Call("forceOrientationPortrait");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public static bool enableReviewWindow(){
|
||||
bool res = false;
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
if (Application.platform != RuntimePlatform.OSXEditor) {
|
||||
res = _enableReviewWindow();
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void reviewWindow( string appid){
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
if (Application.platform != RuntimePlatform.OSXEditor) {
|
||||
_reviewWindow(appid);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 端末起動からの経過時間(s)
|
||||
/// </summary>
|
||||
public static long systemClockTime(){
|
||||
|
||||
long res = 0;
|
||||
#if UNITY_EDITOR
|
||||
var start = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
res = (long)(DateTime.Now.ToUniversalTime() - start).TotalSeconds;
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
if (Application.platform != RuntimePlatform.OSXEditor) {
|
||||
res = _systemClockTime();
|
||||
}
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject jo = cls.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
res = (long)(jo.Call<long>("elapsedRealtime") / 1000);
|
||||
}
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID
|
||||
public static int getAndroidApiLevel(){
|
||||
var cls = new AndroidJavaClass("android.os.Build$VERSION");
|
||||
var apiLevel = cls.GetStatic<int>("SDK_INT");
|
||||
Debug.Log(apiLevel);
|
||||
return apiLevel;
|
||||
}
|
||||
#elif UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
public static bool canOpenTwitter(){
|
||||
return _canOpenTwitter();
|
||||
}
|
||||
public static bool canOpenFacebook(){
|
||||
return _canOpenFacebook();
|
||||
}
|
||||
|
||||
public static int GetiOSMajorVersion(){
|
||||
string version = SystemInfo.operatingSystem;
|
||||
version = version.Split('.')[0];
|
||||
string[] stringSplits = version.Split(' ');
|
||||
version = stringSplits[stringSplits.Length -1];
|
||||
return int.Parse(version);
|
||||
}
|
||||
#endif
|
||||
public static void InitNotification()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
#elif UNITY_ANDROID
|
||||
// UniLocalNotification.Initialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void RegisterNotification()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_registerNotification();
|
||||
#elif UNITY_ANDROID
|
||||
#endif
|
||||
}
|
||||
public static void ScheduleNotification(int triggerInSeconds, string title, string message, int id)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_scheduleNotification(triggerInSeconds, message, id.ToString());
|
||||
#elif UNITY_ANDROID
|
||||
// UniLocalNotification.Register(triggerInSeconds, message, title);
|
||||
#endif
|
||||
}
|
||||
public static void CancelAllNotifications(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_cancelAllNotifications();
|
||||
#elif UNITY_ANDROID
|
||||
// UniLocalNotification.CancelAll();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void PlayVibration(VibrationType vibrationType){
|
||||
switch(vibrationType){
|
||||
case VibrationType.Once:
|
||||
PlayVibrationOnce();
|
||||
break;
|
||||
case VibrationType.OnceStrong:
|
||||
PlayVibrationOnceStrong();
|
||||
break;
|
||||
case VibrationType.OnceWeak:
|
||||
PlayVibrationOnceWeak();
|
||||
break;
|
||||
case VibrationType.DoubleStrong:
|
||||
PlayVibrationDoubleStrong();
|
||||
break;
|
||||
case VibrationType.DoubleWeak:
|
||||
PlayVibrationDoubleWeak();
|
||||
break;
|
||||
case VibrationType.Triple:
|
||||
PlayVibrationTriple();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlayVibrationOnce(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationOnce();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectClick, 20);
|
||||
#endif
|
||||
}
|
||||
public static void PlayVibrationOnceStrong(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationOnceStrong();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectHClick, 50);
|
||||
#endif
|
||||
}
|
||||
public static void PlayVibrationOnceWeak(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationOnceWeak();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectTick, 10);
|
||||
#endif
|
||||
}
|
||||
public static void PlayVibrationDoubleStrong(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationDoubleStrong();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectDClick, 80);
|
||||
#endif
|
||||
}
|
||||
public static void PlayVibrationDoubleWeak(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationDoubleWeak();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectOneShot, 100); // TODO:最適化
|
||||
#endif
|
||||
}
|
||||
public static void PlayVibrationTriple(){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_PlayVibrationTriple();
|
||||
#elif UNITY_ANDROID
|
||||
_VibrationAndroid(NativeUtils.vEffectOneShot, 200); // TODO:最適化
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void ShowAlert(string title, string message){
|
||||
#if UNITY_EDITOR
|
||||
#elif UNITY_IOS
|
||||
_showAlert(title, message);
|
||||
#elif UNITY_ANDROID
|
||||
// TODO:
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1d79e45cfabba4cd3b1d6a9f7ab0bf2c
|
||||
timeCreated: 1496659633
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2aac40ba60ff849ee88ec188ff5852ed
|
||||
folderAsset: yes
|
||||
timeCreated: 1505293985
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
@interface ISN_DataConvertor : NSObject
|
||||
|
||||
+ (NSString*) charToNSString: (char*)value;
|
||||
+ (const char *) NSStringToChar: (NSString *) value;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface ISN_NativeUtility : NSObject
|
||||
|
||||
@property (strong) UIActivityIndicatorView *spinner;
|
||||
|
||||
+ (id) sharedInstance;
|
||||
+ (int) majorIOSVersion;
|
||||
+ (BOOL) IsIPad;
|
||||
|
||||
- (void) ISN_NativeLog: (NSString *) appId, ...;
|
||||
- (void) ISN_SetLogState: (BOOL) appId;
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6387bda137dcb4b67ad4a0285193a98f
|
||||
timeCreated: 1505294039
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
data:
|
||||
first:
|
||||
'': Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
data:
|
||||
first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies: Accounts;Social;
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "ISN_NativeCore.h"
|
||||
#import "AppDelegateListener.h"
|
||||
|
||||
|
||||
@implementation ISN_DataConvertor
|
||||
|
||||
+(NSString *) charToNSString:(char *)value {
|
||||
if (value != NULL) {
|
||||
return [NSString stringWithUTF8String: value];
|
||||
} else {
|
||||
return [NSString stringWithUTF8String: ""];
|
||||
}
|
||||
}
|
||||
|
||||
+ (const char *) NSStringToChar:(NSString *)value {
|
||||
return [value UTF8String];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ISN_NativeUtility
|
||||
|
||||
static bool logState = false;
|
||||
static ISN_NativeUtility * na_sharedInstance;
|
||||
|
||||
+ (id)sharedInstance {
|
||||
if (na_sharedInstance == nil) {
|
||||
na_sharedInstance = [[self alloc] init];
|
||||
}
|
||||
|
||||
return na_sharedInstance;
|
||||
}
|
||||
|
||||
+ (BOOL) IsIPad {
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+ (int) majorIOSVersion {
|
||||
NSArray *vComp = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
|
||||
return [[vComp objectAtIndex:0] intValue];
|
||||
}
|
||||
|
||||
-(void) ISN_SetLogState:(BOOL)state {
|
||||
logState = state;
|
||||
}
|
||||
|
||||
-(void) ISN_NativeLog:(NSString *)msg, ... {
|
||||
if(logState) {
|
||||
va_list argumentList;
|
||||
va_start(argumentList, msg);
|
||||
|
||||
NSString *message = [[NSString alloc] initWithFormat:msg arguments:argumentList];
|
||||
|
||||
// clean up
|
||||
va_end(argumentList);
|
||||
|
||||
NSLog(@"ISN_NativeLog: %@", message);
|
||||
}
|
||||
}
|
||||
|
||||
- (CGFloat) GetW {
|
||||
UIViewController *vc = UnityGetGLViewController();
|
||||
|
||||
bool IsLandscape = true;
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
if(orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
|
||||
IsLandscape = true;
|
||||
} else {
|
||||
IsLandscape = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
CGFloat w;
|
||||
if(IsLandscape) {
|
||||
w = vc.view.frame.size.height;
|
||||
} else {
|
||||
w = vc.view.frame.size.width;
|
||||
}
|
||||
|
||||
NSArray *vComp = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
|
||||
if ([[vComp objectAtIndex:0] intValue] >= 8) {
|
||||
w = vc.view.frame.size.width;
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b48a13e4a3f24b7c9817beafda29890
|
||||
timeCreated: 1505294039
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
data:
|
||||
first:
|
||||
'': Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies: Accounts;Social;
|
||||
data:
|
||||
first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,131 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3e73def94b97c4038a468691abc7cd6d
|
||||
timeCreated: 1505293997
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
data:
|
||||
first:
|
||||
'': Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies: Accounts;Social;MessageUI;
|
||||
data:
|
||||
first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
@interface NativeUtils : NSObject
|
||||
|
||||
+ (NSString*) charToNSString: (char*)value;
|
||||
|
||||
+ (NativeUtils *)sharedInstance;
|
||||
|
||||
- (void) registerNotification;
|
||||
- (void) scheduleNotification: (int) triggerInSeconds message: (NSString*) message alarmId:(NSString *)alarmId;
|
||||
- (void) cancelAllNotifications;
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 27a2f26e8e9c34413992e9f33f3cc1c6
|
||||
timeCreated: 1496660244
|
||||
licenseType: Free
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
//
|
||||
// NativeUtils.mm
|
||||
// Unity-iPhone
|
||||
//
|
||||
// Created by Suto Atsushi on 2016/06/05.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <StoreKit/StoreKit.h>
|
||||
|
||||
#import <Social/Social.h>
|
||||
#import "UnityAppController.h"
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
|
||||
#import "NativeUtils.h"
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
|
||||
@implementation NativeUtils
|
||||
|
||||
+(NSString *) charToNSString:(char *)value
|
||||
{
|
||||
if (value != NULL)
|
||||
{
|
||||
return [NSString stringWithUTF8String: value];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [NSString stringWithUTF8String: ""];
|
||||
}
|
||||
}
|
||||
|
||||
static NativeUtils *_sharedInstance = nil;
|
||||
|
||||
+ (NativeUtils *) sharedInstance
|
||||
{
|
||||
if (!_sharedInstance)
|
||||
{
|
||||
_sharedInstance = [[NativeUtils alloc] init];
|
||||
}
|
||||
return _sharedInstance;
|
||||
}
|
||||
|
||||
-(void) registerNotification
|
||||
{
|
||||
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:
|
||||
(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert ) completionHandler:^(BOOL granted, NSError *_Nullable error) {
|
||||
if (granted) {
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
[[UIApplication sharedApplication] registerForRemoteNotifications];
|
||||
|
||||
}
|
||||
|
||||
-(void) scheduleNotification: (int) triggerInSeconds message: (NSString*) message alarmId:(NSString *)alarmId
|
||||
{
|
||||
// インスタンス生成
|
||||
UNMutableNotificationContent *unMutableNotice = [UNMutableNotificationContent new];
|
||||
|
||||
unMutableNotice.body = message;
|
||||
unMutableNotice.sound = [UNNotificationSound defaultSound];
|
||||
|
||||
UNTimeIntervalNotificationTrigger *triger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:triggerInSeconds repeats:NO];
|
||||
UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:alarmId content:unMutableNotice trigger:triger];
|
||||
|
||||
[UNUserNotificationCenter.currentNotificationCenter addNotificationRequest:request withCompletionHandler:nil];
|
||||
}
|
||||
|
||||
- (void) cancelAllNotifications
|
||||
{
|
||||
[[UNUserNotificationCenter currentNotificationCenter] removeAllPendingNotificationRequests];
|
||||
[[UNUserNotificationCenter currentNotificationCenter] removeAllDeliveredNotifications];
|
||||
}
|
||||
|
||||
- (void) showAlert: (NSString*) title message: (NSString*) message
|
||||
{
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
// addActionした順に左から右にボタンが配置されます
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
}]];
|
||||
[[[[UIApplication sharedApplication]keyWindow] rootViewController] presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
extern "C"{
|
||||
int _getHeight()
|
||||
{
|
||||
CGRect cr = [[UIScreen mainScreen] nativeBounds];
|
||||
return cr.size.height;
|
||||
}
|
||||
int _getWidth()
|
||||
{
|
||||
CGRect cr = [[UIScreen mainScreen] nativeBounds];
|
||||
return cr.size.width;
|
||||
}
|
||||
int _getPointHeight()
|
||||
{
|
||||
CGRect cr = [[UIScreen mainScreen] bounds];
|
||||
return cr.size.height;
|
||||
}
|
||||
int _getPointWidth()
|
||||
{
|
||||
CGRect cr = [[UIScreen mainScreen] bounds];
|
||||
return cr.size.width;
|
||||
}
|
||||
|
||||
bool _enableReviewWindow()
|
||||
{
|
||||
return [SKStoreReviewController class];
|
||||
}
|
||||
|
||||
void _reviewWindow(char* appid)
|
||||
{
|
||||
if([SKStoreReviewController class]){
|
||||
[SKStoreReviewController requestReview] ;
|
||||
}else{
|
||||
NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&action=write-review",[NativeUtils charToNSString:appid]];
|
||||
NSURL *URL = [NSURL URLWithString:str];
|
||||
[[UIApplication sharedApplication] openURL:URL];
|
||||
}
|
||||
}
|
||||
|
||||
long _systemClockTime()
|
||||
{
|
||||
struct timeval boottime;
|
||||
int mib[2] = {CTL_KERN, KERN_BOOTTIME};
|
||||
size_t size = sizeof(boottime);
|
||||
int rc = sysctl(mib, 2, &boottime, &size, NULL, 0);
|
||||
if (rc != 0) {
|
||||
return 0;
|
||||
}
|
||||
return (long)(time(NULL) - boottime.tv_sec);
|
||||
}
|
||||
|
||||
bool _canOpenTwitter()
|
||||
{
|
||||
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool _canOpenFacebook()
|
||||
{
|
||||
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void _registerNotification()
|
||||
{
|
||||
[[NativeUtils sharedInstance] registerNotification];
|
||||
}
|
||||
void _scheduleNotification (int triggerInSeconds, char* message, char* alarmId)
|
||||
{
|
||||
[[NativeUtils sharedInstance] scheduleNotification:triggerInSeconds message:[NativeUtils charToNSString:message] alarmId:[NativeUtils charToNSString:alarmId]];
|
||||
}
|
||||
void _cancelAllNotifications()
|
||||
{
|
||||
[[NativeUtils sharedInstance] cancelAllNotifications];
|
||||
}
|
||||
|
||||
void _PlayVibration(int id)
|
||||
{
|
||||
AudioServicesPlaySystemSound(id);
|
||||
}
|
||||
void _PlayVibrationOnce(){
|
||||
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleMedium)];
|
||||
[generator impactOccurred];
|
||||
}
|
||||
void _PlayVibrationOnceStrong(){
|
||||
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleHeavy)];
|
||||
[generator impactOccurred];
|
||||
}
|
||||
void _PlayVibrationOnceWeak(){
|
||||
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleLight)];
|
||||
[generator impactOccurred];
|
||||
}
|
||||
void _PlayVibrationDoubleStrong(){
|
||||
UINotificationFeedbackGenerator *generator = [[UINotificationFeedbackGenerator alloc] init];
|
||||
[generator notificationOccurred: UINotificationFeedbackTypeSuccess];
|
||||
}
|
||||
void _PlayVibrationDoubleWeak(){
|
||||
UINotificationFeedbackGenerator *generator = [[UINotificationFeedbackGenerator alloc] init];
|
||||
[generator notificationOccurred: UINotificationFeedbackTypeWarning];
|
||||
}
|
||||
void _PlayVibrationTriple(){
|
||||
UINotificationFeedbackGenerator *generator = [[UINotificationFeedbackGenerator alloc] init];
|
||||
[generator notificationOccurred: UINotificationFeedbackTypeError];
|
||||
}
|
||||
|
||||
void _showAlert(char* title, char* message)
|
||||
{
|
||||
[[NativeUtils sharedInstance] showAlert:[NativeUtils charToNSString:title] message:[NativeUtils charToNSString:message]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4383d909a0f3e411c9de1bb3b60ad6e4
|
||||
timeCreated: 1496660244
|
||||
licenseType: Free
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies: Social;StoreKit;
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue