Ejemplo n.º 1
0
    private void OnCreatureMorphModelChanged()
    {
        var node = transform?.parent;

        if (!node)
        {
            return;
        }

        var nnode = node.name == "effects" ? source.behaviour.effects.transform : Util.FindChild(source.activeRootNode, node.name);

        if (nnode != node)
        {
            Util.AddChildStayLocal(nnode, transform);
            #if UNITY_EDITOR
            if (source.lockLayer)
            {
                Util.SetLayer(gameObject, source.lockedLayer);
            }
            #endif
        }
    }