Exemplo n.º 1
0
        public static void RemoveProvider(NodePosRot node, IAvatarHintProvider <PositionRotation> provider)
        {
            RequireProvidersPosRot();

            if (providersPosRot.TryGetValue(node, out IAvatarHintProvider <PositionRotation> extProvider) &&
                extProvider == provider)
            {
                providersPosRot.Remove(node);
            }
        }
Exemplo n.º 2
0
        public static bool TryGet(NodePosRot node, out PositionRotation posRot)
        {
            RequireProvidersPosRot();

            if (providersPosRot.TryGetValue(node, out IAvatarHintProvider <PositionRotation> provider))
            {
                posRot = provider.Provide();
                return(true);
            }
            posRot = PositionRotation.identity;
            return(false);
        }
Exemplo n.º 3
0
        public static void AddProvider(NodePosRot node, IAvatarHintProvider <PositionRotation> provider)
        {
            RequireProvidersPosRot();

            if (providersPosRot.ContainsKey(node))
            {
                // Silently ignoring subsequent providers now as this can happen
                // on scene reload due to (temporary) multiple player prefabs
                // Debug.LogError("Multiple AvatarHint providers for node: " + node
                //     + ", but only one can be used at any time. Ignoring.");
                return;
            }

            providersPosRot[node] = provider;
        }