示例#1
0
    public void ReassignObjectGhost(PlaceableObject obj)
    {
        foreach (Transform child in objectGhost.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        ObjectGhost newGhost = Instantiate(obj.GetGhost().GetComponent <ObjectGhost>());

        newGhost.transform.SetParent(objectGhost.transform);
        newGhost.transform.position = objectGhost.transform.position;
        newGhost.transform.rotation = objectGhost.transform.rotation;
        newGhost.gameObject.SetActive(true);
    }