Example #1
0
 /// <summary> Call this when you drop this weapon </summary>
 public void OnDrop(CharacterMasterAbstract newHolder)
 {
     OnUnequip();
     holder = null;
     ctrl   = null;
     anim   = null;
     mvmt   = null;
 }
Example #2
0
    /// <summary> Call this when you pickup or switch to this weapon </summary>
    /// <param name="newHolder"> The CharacterMasterAbstract of the character that just picked up this weapon </param>
    public void OnEquip(CharacterMasterAbstract newHolder)
    {
        holder = newHolder;

        // All hittable things minus this layer
        whatIsHittable = CommonObjectsSingleton.Instance.whatIsHittableMaster & ~(1 << holder.gameObject.layer);

        ctrl          = holder.control;
        holder.weapon = this;
        anim          = holder.anim;
        mvmt          = holder.gameObject.GetComponent <MovementAbstract>();
    }
Example #3
0
 private void Start()
 {
     _characterMaster = GetComponent <CharacterMasterAbstract>();
 }