public override void execute(int frameRate, float delay)
 {
     if (!obj)
     {
         return;
     }
     if (endFrame == -1)
     {
         return;
     }
     // if start and end target are the same, look follow
     if (isLookFollow())
     {
         AMTween.LookFollow(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "looktarget", startTarget));
         // look to follow
     }
     else
     {
         if (hasCustomEase())
         {
             AMTween.LookToFollow(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "looktarget", endTarget, "endposition", (isSetEndPosition ? (Vector3?)endPosition : null), "easecurve", easeCurve));
         }
         else
         {
             AMTween.LookToFollow(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "looktarget", endTarget, "endposition", (isSetEndPosition ? (Vector3?)endPosition : null), "easetype", (AMTween.EaseType)easeType));
         }
     }
 }
Пример #2
0
    private static bool parseLookToFollow(JSONAction a)
    {
        Hashtable hash = new Hashtable();

        hash.Add("disable", true);
        hash.Add("delay", a.delay);
        hash.Add("time", a.time);
        setupHashEase(hash, a);
        if (a.strings.Length >= 1)
        {
            hash.Add("looktarget", getGO(a.strings[0]).transform);                              // move to position
        }
        else
        {
            Debug.LogWarning("Animator: LookFollow missing 'looktarget'.");
            return(false);
        }
        if (a.path != null && a.path.Length >= 1)
        {
            hash.Add("endposition", a.path[0].toVector3());
        }
        AMTween.LookToFollow(getGO(a.go), hash);
        return(true);
    }