Esempio n. 1
0
        static void Postfix(EntityDataBase __instance, EntityViewBase view)
        {
            if (view != null)
            {
                return;
            }

            var unit_entity_data = __instance as UnitEntityData;

            if (unit_entity_data == null)
            {
                return;
            }
            if (unit_entity_data.GetActivePolymorph() != null)
            {
                return;
            }
            var replace_view = unit_entity_data.Descriptor?.Get <UnitPartViewReplacement>()?.buff?.Blueprint.GetComponent <ReplaceUnitView>();

            if (replace_view != null)
            {
                Aux.TryReplaceView(unit_entity_data.Descriptor, replace_view.prefab, replace_view.use_master_view);
            }
        }
Esempio n. 2
0
 public override void OnFactActivate()
 {
     //Main.logger.Log("Activate");
     this.Owner.Ensure <UnitPartViewReplacement>().buff = this.Fact;
     Aux.TryReplaceView(this.Owner, prefab, use_master_view);
 }