Пример #1
0
        public void ScaleSprite(long objectId, float scaleDuration, Vector2 targetSize)
        {
            if (!contextSpriteRenderers.ContainsKey(objectId))
            {
                throw new System.Exception("Error while scaling sprite : objectId " + objectId + " is undefined.");
            }
            DialogueSprite ds = contextSpriteRenderers[objectId];

            if (!ds.isAnimating)
            {
                animatingSprites.Add(ds);
            }
            ds.Scale(scaleDuration, targetSize);
        }
Пример #2
0
        public void MoveSprite(long objectId, float moveDuration, Vector3 targetPosition, SpriteSnapPosition targetSnapPosition)
        {
            if (!contextSpriteRenderers.ContainsKey(objectId))
            {
                throw new System.Exception("Error while moving sprite : objectId " + objectId + " is undefined.");
            }
            DialogueSprite ds = contextSpriteRenderers[objectId];

            if (!ds.isAnimating)
            {
                animatingSprites.Add(ds);
            }
            ds.Move(moveDuration, targetPosition, targetSnapPosition);
        }
Пример #3
0
 public void SetContextObject(long id, System.Object o)
 {
     if (contextObjects.ContainsKey(id))
     {
         throw new System.Exception("Error while setting context object : id " + id + " was already defined and wasn't freed.");
     }
     contextObjects[id] = o;
     if (o is DialogueSprite)
     {
         DialogueSprite ds = contextSpriteRenderers[id] = (DialogueSprite)o;
         GameObject     go = new GameObject("Sprite(" + id + ")");
         go.transform.parent = spriteHolder;
         ds.spriteRenderer   = go.AddComponent <SpriteRenderer>();
         ds.SetVisible(false);
     }
     else if (o is AudioClip)
     {
         contextAudioClips[id] = (AudioClip)o;
     }
 }