Esempio n. 1
0
    public void Init(CreatureModel nullthing)
    {
        this.movableObject = nullthing.GetMovableNode();
        //Bad.GetComponent<AnimatorEventScript>().SetTarget(nullthing.script as IAnimatorEventCalled);
        //Normal.GetComponent<AnimatorEventScript>().SetTarget(nullthing.script as IAnimatorEventCalled);
        Egg.GetComponent <AnimatorEventScript>().SetTarget(nullthing.script as IAnimatorEventCalled);

        level2Script.SetTarget(animScript);
        current = malkutAgent;
        level1SpriteRenderer.SetSprite(current);
    }
Esempio n. 2
0
    WorkerModel HitScan()
    {
        float startX = model.GetMovableNode().GetCurrentViewPosition().x;
        float maxVal = float.MaxValue;

        WorkerModel target = null;

        foreach (WorkerModel wm in this.targetList)
        {
            float currentx = wm.GetMovableNode().GetCurrentViewPosition().x;
            float val      = 0f;
            if (currentDir == UnitDirection.RIGHT)
            {
                //ㅁ뱀위치보다 x값이 큰 애들
                if (currentx < startX)
                {
                    continue;
                }
                val = currentx - startX;
            }
            else
            {
                if (currentx > startX)
                {
                    continue;
                }
                val = startX - currentx;
            }
            if (maxVal > val)
            {
                target = wm;
                maxVal = val;
            }
        }

        if (target != null)
        {
            endPos.transform.position = target.GetMovableNode().GetCurrentViewPosition();
            //this.currentTarget = target;

            if (line.enabled == false)
            {
                ReadyLine();
            }
            return(target);
        }
        else
        {
            //fail, release, disable
            return(null);
        }
    }
Esempio n. 3
0
 public void MoveToCreture(CreatureModel target)
 {
     movableNode.MoveToMovableNode(target.GetMovableNode());
 }