Exemple #1
0
        public void Move(string id, Vector2 position, int speed = 0, EffectHolderNode observer = null)
        {
            GameObject go = GameObject.Find(id);
            Mover      m  = go.GetComponent <Mover>();

            if (m != null)
            {
                if (speed == 0)
                {
                    m.MoveInstant(position);
                }
                else
                {
                    m.MoveFreely(position, observer, data =>
                    {
                        EffectHolderNode tmp = (EffectHolderNode)data;
                        tmp.doPulse();
                        Game.Instance.ContinueEffectExecution();
                    }, null);
                }
            }
            else
            {
                ScenePositioner r = go.GetComponent <ScenePositioner>();
                r.Position = position;
            }
        }
Exemple #2
0
 protected void Start()
 {
     representable   = GetComponent <Representable>();
     scenePositioner = GetComponent <ScenePositioner>();
     if (scenePositioner)
     {
         representable.Play("stand");
     }
 }
Exemple #3
0
 protected void Start()
 {
     mover           = GetComponent <Mover>();
     representable   = GetComponent <Representable>();
     scenePositioner = GetComponent <ScenePositioner>();
 }