Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        MeshFilter mf = GetComponentInChildren <MeshFilter>();

        skin = new Vector2(mf.mesh.bounds.extents.x, mf.mesh.bounds.extents.z);
        _rb  = GetComponent <Rigidbody>();

        _gc = FindObjectOfType <GroundConstraints>();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        _gc = GetComponent <GroundConstraints>();

        combats = FindObjectsOfType <CombatMovement>();
        if (combats.Length > 1)
        {
            distance        = Mathf.Abs(combats[0].transform.position.x - combats[1].transform.position.x);
            distancePercent = distance / (float)_gc.constrainedArea.x;
        }

        if (distancePercent < .3f)
        {
            distBetweenChars = Dist.CLOSE;
        }
        else if (distancePercent < .7f)
        {
            distBetweenChars = Dist.MEDIUM;
        }
        else
        {
            distBetweenChars = Dist.FAR;
        }
    }