コード例 #1
0
    public void HitCol(GameObject otherFormation)
    {
        var otherFormationScript = otherFormation.GetComponent <Formation> ();

        if (otherFormationScript.team == myFormation.team)
        {
            return;
        }

        if (ignoreEngage)
        {
            return;
        }

        var enemyFormationCenter = otherFormationScript.GetFormationCenter();
        //RotateToFace (enemyFormationCenter);

        var relPos = enemyFormationCenter - transform.position;

        relPos = relPos.normalized;

        NMA.SetDestination(transform.position + relPos);
        myFormation.Engage();
        engaging = true;
    }