// add a new key
    public void addKey(int _frame, Transform target)
    {
        foreach (AMOrientationKey key in keys)
        {
            // if key exists on frame, update key
            if (key.frame == _frame)
            {
                AMUtil.recordObject(key, "update key");
                key.target = target;
                // update cache
                updateCache();
                return;
            }
        }
        AMOrientationKey a = ScriptableObject.CreateInstance <AMOrientationKey>();

        a.frame  = _frame;
        a.target = target;
        // set default ease type to linear
        a.easeType = (int)AMTween.EaseType.linear;
        // add a new key
        AMUtil.recordObject(this, "add key");
        keys.Add(a);
        // update cache
        updateCache();
    }
Esempio n. 2
0
    public override AMKey CreateClone()
    {
        AMOrientationKey a = ScriptableObject.CreateInstance <AMOrientationKey>();

        a.frame      = frame;
        a.target     = target;
        a.easeType   = easeType;
        a.customEase = new List <float>(customEase);
        return(a);
    }