示例#1
0
 public override void OnHitConfirm(GameObject other, HitInfo hb, HitResult hr)
 {
     //Debug.Log ("Hit Confirm with: " + other);
     if (other.GetComponent <PropertyHolder> () != null)
     {
         PropertyHolder  other_ph = other.GetComponent <PropertyHolder> ();
         PropertyHolder  m_ph     = GetComponent <PropertyHolder> ();
         List <Property> pList    = m_ph.GetVisibleProperties();
         foreach (Property p in pList)
         {
             m_ph.TransferProperty(p, other_ph);
         }
     }
 }
示例#2
0
    public void AddPropertyHolder(PropertyHolder ph, int coordIndex)
    {
        PropertyMenu pm;

        pm = m_propMenus [coordIndex];
        if (ph.HolderName == "SameAsObject")
        {
            pm.holderName = removeParenthesis(ph.gameObject.name);
        }
        else
        {
            pm.holderName = ph.HolderName;
        }
        pm.MaxSlots     = ph.MaxSlots;
        pm.propertyList = ph.GetVisibleProperties();
        pm.holder       = ph;

        AddPropertyList(pm.propertyList, pm.holderName, coordIndex);
        int left = pm.MaxSlots - pm.NumProps();

        pm.slotText.text = left.ToString() + " / " + pm.MaxSlots + "\n Free";
    }
示例#3
0
 public override List <Property> GetVisibleProperties()
 {
     Debug.Log("Override");
     return(PropHolder.GetVisibleProperties());
 }