void GUIItemComponent(GameplayItemComponent Comp, int componentId)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.SelectableLabel(Comp.GetType().Name);
        m_ItemComponentGUIs[componentId].Edit = GUILayout.Toggle(m_ItemComponentGUIs[componentId].Edit, "Edit");
        if (GUILayout.Button("Remove"))
        {
            //m_AddedItemComponents.RemoveAt(componentId);
            m_Item.Components.RemoveAt(componentId);
        }
        EditorGUILayout.EndHorizontal();

        if (m_ItemComponentGUIs[componentId].Edit)
        {
            //GUIEditItemComponent(Comp);
            GUIDrawObject(Comp);
        }
    }
    string WriteComponent(BinaryWriter Writer, GameplayItemComponent Comp)
    {
        System.Type CmpType = Comp.GetType();

        Writer.Write(CmpType.Name); //string

        m_err = Comp.Serialize(Writer);

        return m_err;
    }
Пример #3
0
 private IEnumerator BulletHitCoroutine(float time, GameplayItemComponent component)
 {
     yield return new WaitForSeconds(time);
     component.StartInteractionAnimation();
 }
 protected void Start()
 {
     component = GetComponent<GameplayItemComponent>();
     component.OnAction += ConfirmAction;
 }
Пример #5
0
 protected virtual void SetupGameplayComponent()
 {
     if (gameplayComponent == null)
         gameplayComponent = GetComponent<GameplayItemComponent>();
     gameplayComponent.OnAction += ConfirmAction;
 }
 public override void CopyFrom(GameplayItemComponent Other)
 {
     base.CopyFrom(Other);
     GameplayArmorComponent Cmp = (GameplayArmorComponent)Other;
     ArmorValue = Cmp.ArmorValue;
 }
 public override void CopyFrom(GameplayItemComponent Other)
 {
     base.CopyFrom(Other);
     GameplayWeaponComponent Cmp = (GameplayWeaponComponent)Other;
     MinDmg = Cmp.MinDmg;
     MaxDmg = Cmp.MaxDmg;
     Speed = Cmp.Speed;
     DamageType = Cmp.DamageType;
     UseType = Cmp.UseType;
 }
 public virtual void CopyFrom(GameplayItemComponent Other)
 {
     m_Item = Other.Item;
 }