C# Class Duality.Resources.PrefabLink

Represents a GameObject">GameObjects connection to the
Afficher le fichier Open project: BraveSirAndrew/duality Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
Apply ( bool deep ) : void
ClearEmptyChanges ( ) : void
ICloneExplicit ( object targetObj, CloneProvider provider ) : void
PopChange ( IEnumerable indexPath, PropertyInfo prop, Type componentType = null ) : void
PrefabLink ( ) : System

Method Details

AffectsObject() public méthode

Returns whether a specific object is affected by this PrefabLink.
public AffectsObject ( Component cmp ) : bool
cmp Component
Résultat bool

AffectsObject() public méthode

Returns whether a specific object is affected by this PrefabLink.
public AffectsObject ( GameObject obj ) : bool
obj GameObject
Résultat bool

Apply() public méthode

Applies both Prefab and change list to this PrefabLinks GameObject.
public Apply ( ) : void
Résultat void

ApplyAllLinks() public static méthode

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.
Résultat List

ApplyChanges() public méthode

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
Résultat void

ApplyPrefab() public méthode

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
Résultat void

ClearChanges() public méthode

Clears the change list.
public ClearChanges ( ) : void
Résultat void

ClearChanges() public méthode

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
Résultat void

Clone() public méthode

Clones the PrefabLink.
public Clone ( ) : PrefabLink
Résultat PrefabLink

Clone() public méthode

Clones the PrefabLink, but targets a different GameObject.
public Clone ( GameObject newObj ) : PrefabLink
newObj GameObject The GameObject which the clone is connected to.
Résultat PrefabLink

Clone() public méthode

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.
Résultat PrefabLink

HasChange() public méthode

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.
Résultat bool

PopChange() public méthode

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.
Résultat void

PrefabLink() public méthode

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.
Résultat System

PushChange() public méthode

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.
Résultat void

PushChange() public méthode

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.
Résultat void

RelocateChanges() public méthode

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. ///
Résultat void

UpdateChanges() public méthode

Updates all existing change list entries by the GameObjects current Property values.
public UpdateChanges ( ) : void
Résultat void