I created the animation and added to Animator controller. This animation modify properties in Serializable structure. That works on PC x86 application, but on Windows store application(arm and metro) doesn’t work.
using UnityEngine;
using System.Collections;
public class TestAnimator : MonoBehaviour {
[System.Serializable]
public struct AnimationProp
{
public float x_position;
}
public Transform obj;
public AnimationProp animationProp;
void Update () {
Vector3 currentObjPos = obj.transform.position;
currentObjPos.x = animationProp.x_position;
obj.transform.position = currentObjPos;
}
}
I builded my game for windows phone 8.1 and run it on Nokia lumia 930. And I got very low fps. I builded the application with only one script for showing fps and one UI text with canvas. any way I was getting very low fps about 30-40 fps.
using UnityEngine;
using System.Collections;
namespace Medvedya.DebugUtilletes
{
[RequireComponent(typeof(UnityEngine.UI.Text))]
public class DrawFPS : MonoBehaviour
{
// Attach this to a GUIText to make a frames/second indicator.
//
// It calculates frames/second over each updateInterval,
// so the display does not keep changing wildly.
//
// It is also fairly accurate at very low FPS counts (<10).
// We do this not by simply counting frames per interval, but
// by accumulating FPS for each frame. This way we end up with
// correct overall FPS even if the interval renders something like
// 5.5 frames.
public float updateInterval = 0.5F;
private float accum = 0; // FPS accumulated over the interval
private int frames = 0; // Frames drawn over the interval
private float timeleft; // Left time for current interval
public UnityEngine.UI.Text text;
void Start()
{
text = GetComponent<UnityEngine.UI.Text>();
timeleft = updateInterval;
}
void Update()
{
timeleft -= Time.deltaTime;
accum += Time.timeScale / Time.deltaTime;
++frames;
// Interval ended - update GUI text and start new interval
if (timeleft <= 0.0)
{
// display two fractional digits (f2 format)
float fps = accum / frames;
string format = System.String.Format("{0:F2} FPS", fps);
text.text = format;
if (fps < 30)
text.color = Color.yellow;
else
if (fps < 10)
text.color = Color.red;
else
text.color = Color.green;
// DebugConsole.Log(format,level);
timeleft = updateInterval;
accum = 0.0F;
frames = 0;
}
}
}
}