C# Класс Duality.Resources.PrefabLink

Represents a GameObject">GameObjects connection to the
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AffectsObject ( Component cmp ) : bool

Returns whether a specific object is affected by this PrefabLink.

AffectsObject ( GameObject obj ) : bool

Returns whether a specific object is affected by this PrefabLink.

Apply ( ) : void

Applies both Prefab and change list to this PrefabLinks GameObject.

ApplyAllLinks ( IEnumerable objEnum, Predicate predicate = null ) : List

Applies all PrefabLinks in a set of GameObjects.

ApplyChanges ( ) : void

Applies this PrefabLinks change list to its GameObject. This will restore all deliberate modifications (made in the editor) of the GameObjects Properties after linking it to the Prefab.

ApplyPrefab ( ) : void

Applies the Prefab to this PrefabLinks GameObject. This will overwrite all of its existing data and establish the state as defined in the Prefab.

ClearChanges ( ) : void

Clears the change list.

ClearChanges ( GameObject targetObj, Type cmpType, PropertyInfo prop ) : void

Clears the change list for certain objects

Clone ( ) : PrefabLink

Clones the PrefabLink.

Clone ( GameObject newObj ) : PrefabLink

Clones the PrefabLink, but targets a different GameObject.

Clone ( GameObject newObj, ContentRef newPrefab ) : PrefabLink

Clones the PrefabLink, but targets a different GameObject and Prefab.

HasChange ( object target, PropertyInfo prop ) : bool

Returns whether there is a specific change list entry.

PopChange ( object target, PropertyInfo prop ) : void

Removes an existing change list entry.

PrefabLink ( GameObject obj, ContentRef prefab ) : System

Creates a new PrefabLink, connecting a GameObject to a Prefab.

PushChange ( object target, PropertyInfo prop ) : void

Creates a new change list entry.

PushChange ( object target, PropertyInfo prop, object value ) : void

Creates a new change list entry.

RelocateChanges ( PrefabLink other ) : void

Relocates the internal change list from this PrefabLink to a different, hierarchially lower PrefabLink.

In general, each PrefabLink is responsible for all hierarchially lower GameObjects. If one of them has a PrefabLink on its own, then the higher PrefabLinks responsibility ends there.

Change relocation is done when linking an existing GameObject to a Prefab although it is already affected by a hierarchially higher PrefabLink. In order to prevent both PrefabLinks to interfere with each other, all higher PrefabLink change list entries referring to that GameObject are relocated to the new, lower PrefabLink that is specifically targetting it.

This way, the above responsibility guideline remains applicable.

UpdateChanges ( ) : void

Updates all existing change list entries by the GameObjects current Property values.

Приватные методы

Метод Описание
Apply ( bool deep ) : void
ClearEmptyChanges ( ) : void
ICloneExplicit ( object targetObj, CloneProvider provider ) : void
PopChange ( IEnumerable indexPath, PropertyInfo prop, Type componentType = null ) : void
PrefabLink ( ) : System

Описание методов

AffectsObject() публичный Метод

Returns whether a specific object is affected by this PrefabLink.
public AffectsObject ( Component cmp ) : bool
cmp Component
Результат bool

AffectsObject() публичный Метод

Returns whether a specific object is affected by this PrefabLink.
public AffectsObject ( GameObject obj ) : bool
obj GameObject
Результат bool

Apply() публичный Метод

Applies both Prefab and change list to this PrefabLinks GameObject.
public Apply ( ) : void
Результат void

ApplyAllLinks() публичный статический Метод

Applies all PrefabLinks in a set of GameObjects.
public static ApplyAllLinks ( IEnumerable objEnum, Predicate predicate = null ) : List
objEnum IEnumerable An enumeration of all GameObjects containing PrefabLinks that are to apply.
predicate Predicate An optional predicate. If set, only PrefabLinks meeting its requirements are applied.
Результат List

ApplyChanges() публичный Метод

Applies this PrefabLinks change list to its GameObject. This will restore all deliberate modifications (made in the editor) of the GameObjects Properties after linking it to the Prefab.
public ApplyChanges ( ) : void
Результат void

ApplyPrefab() публичный Метод

Applies the Prefab to this PrefabLinks GameObject. This will overwrite all of its existing data and establish the state as defined in the Prefab.
public ApplyPrefab ( ) : void
Результат void

ClearChanges() публичный Метод

Clears the change list.
public ClearChanges ( ) : void
Результат void

ClearChanges() публичный Метод

Clears the change list for certain objects
public ClearChanges ( GameObject targetObj, Type cmpType, PropertyInfo prop ) : void
targetObj GameObject
cmpType System.Type
prop System.Reflection.PropertyInfo
Результат void

Clone() публичный Метод

Clones the PrefabLink.
public Clone ( ) : PrefabLink
Результат PrefabLink

Clone() публичный Метод

Clones the PrefabLink, but targets a different GameObject.
public Clone ( GameObject newObj ) : PrefabLink
newObj GameObject The GameObject which the clone is connected to.
Результат PrefabLink

Clone() публичный Метод

Clones the PrefabLink, but targets a different GameObject and Prefab.
public Clone ( GameObject newObj, ContentRef newPrefab ) : PrefabLink
newObj GameObject The GameObject which the clone is connected to.
newPrefab ContentRef The Prefab which the clone will connect its GameObject to.
Результат PrefabLink

HasChange() публичный Метод

Returns whether there is a specific change list entry.
public HasChange ( object target, PropertyInfo prop ) : bool
target object The target object in which the change has been made. Must be a GameObject or Component.
prop System.Reflection.PropertyInfo The target objects Property that has been changed.
Результат bool

PopChange() публичный Метод

Removes an existing change list entry.
public PopChange ( object target, PropertyInfo prop ) : void
target object The target object in which the change has been made. Must be a GameObject or Component.
prop System.Reflection.PropertyInfo The target objects Property that has been changed.
Результат void

PrefabLink() публичный Метод

Creates a new PrefabLink, connecting a GameObject to a Prefab.
public PrefabLink ( GameObject obj, ContentRef prefab ) : System
obj GameObject The GameObject to link.
prefab ContentRef The Prefab to connect the GameObject with.
Результат System

PushChange() публичный Метод

Creates a new change list entry.
public PushChange ( object target, PropertyInfo prop ) : void
target object The target object in which the change has been made. Must be a GameObject or Component.
prop System.Reflection.PropertyInfo The target objects Property that has been changed.
Результат void

PushChange() публичный Метод

Creates a new change list entry.
public PushChange ( object target, PropertyInfo prop, object value ) : void
target object The target object in which the change has been made. Must be a GameObject or Component.
prop System.Reflection.PropertyInfo The target objects Property that has been changed.
value object The value to which the specified Property has been changed to.
Результат void

RelocateChanges() публичный Метод

Relocates the internal change list from this PrefabLink to a different, hierarchially lower PrefabLink.

In general, each PrefabLink is responsible for all hierarchially lower GameObjects. If one of them has a PrefabLink on its own, then the higher PrefabLinks responsibility ends there.

Change relocation is done when linking an existing GameObject to a Prefab although it is already affected by a hierarchially higher PrefabLink. In order to prevent both PrefabLinks to interfere with each other, all higher PrefabLink change list entries referring to that GameObject are relocated to the new, lower PrefabLink that is specifically targetting it.

This way, the above responsibility guideline remains applicable.

public RelocateChanges ( PrefabLink other ) : void
other PrefabLink /// The PrefabLink to which to relocate changes. It needs to be hierarchially lower than /// this one for the relocation to succeed. ///
Результат void

UpdateChanges() публичный Метод

Updates all existing change list entries by the GameObjects current Property values.
public UpdateChanges ( ) : void
Результат void