コード例 #1
0
    public void Impact(Vector2 impactDir)
    {
        Vector3      pos   = transform.position + (Vector3)impactDir.normalized * radius * 0.92f + new Vector3(0, 0, -2);
        ShieldImpact clone = Instantiate(impact, pos, Quaternion.LookRotation(transform.forward, impactDir)) as ShieldImpact;

        Destroy(clone, 5f);
        Debug.DrawLine(transform.position, pos);
    }
コード例 #2
0
ファイル: Wings.cs プロジェクト: lwsn/SPACE
    public void Impact(Vector2 impactDir, Destructables target)
    {
        ShieldImpact clone = Instantiate(impact, parent.transform.position + new Vector3(0, 0, -2), Quaternion.LookRotation(transform.forward, impactDir)) as ShieldImpact;

        clone.transform.parent = parent.transform;
    }