Exemplo n.º 1
0
    public void RegisterKey(StoredObject key)
    {
        PublicKey newKey = gameObject.AddComponent(key.objectType) as PublicKey;

        if (!ReflectionUtil.ApplyStoredObject(key, newKey))
        {
            return;
        }
        newKey.isAvailable = true;
        keys.Add(newKey);
    }
Exemplo n.º 2
0
 public bool InstallComponent(out EntityComponent installedComponent, StoredObject storedObject)
 {
     installedComponent = Player.I.gameObject.AddComponent(storedObject.objectType) as EntityComponent;
     if (installedComponent == null)
     {
         return(false);
     }
     ReflectionUtil.ApplyStoredObject(storedObject, installedComponent);
     onInstall.Invoke(installedComponent);
     return(true);
 }
Exemplo n.º 3
0
 protected override void DealDamage(IDamageable target)
 {
     base.DealDamage(target);
     foreach (StoredObject storedOnHitCondition in onHitConditions)
     {
         Condition newCondition = target.GetGameObject().AddComponent(storedOnHitCondition.objectType) as Condition;
         if (newCondition == null)
         {
             continue;
         }
         ReflectionUtil.ApplyStoredObject(storedOnHitCondition, newCondition);
         newCondition.Init(this);
     }
 }