예제 #1
0
    private GameObject createTeleport(Transform transform, Vector2 target)
    {
        GameObject obj      = Instantiate(teleportTemplate) as GameObject;
        Teleport   teleport = obj.GetComponent <Teleport>();

        teleport.Init(transform, target);
        teleport.OnUsed += teleportPlayer;
        return(obj);
    }
예제 #2
0
    public float TeleportMe(float[] stats) //(float aff, float where)
    {
        if (teleport == null)
        {
            teleport = gameObject.AddComponent <Teleport>() as Teleport;
            teleport.Init(this);
        }

        modified_defenses = true;

        float def = teleport.TeleportMe(stats);

        IncrementDefense(EffectType.Teleport, def);
        return(def);
    }