예제 #1
0
    private void InitReferences()
    {
        horseBehavior = GetComponent <Horse_Behavior> ();
        if (horseBehavior == null)
        {
            Debug.Log("No horseBehavior on " + name);
        }
        else
        {
            horseBehavior.horse = this;
        }

        horseInteractable = GetComponent <Horse_Interactable> ();
        if (horseInteractable == null)
        {
            Debug.Log("No horseInteractable on " + name);
        }
        else
        {
            horseInteractable.horse = this;
        }

        horseStats = GetComponent <Horse_Stats> ();
        if (horseStats == null)
        {
            Debug.Log("No horseStats on " + name);
        }
        else
        {
            horseStats.horse = this;
        }

        horseRidingBehavior = GetComponent <Horse_RidingBehavior> ();
        if (horseRidingBehavior == null)
        {
            Debug.Log("No horseRidingBehavior on " + name);
        }
        else
        {
            horseRidingBehavior.horse = this;
        }

        horseAnimator = GetComponentInChildren <Animator> ();
        if (horseAnimator == null)
        {
            Debug.Log("No horseAnimator on " + name);
        }
    }
    private void Start()
    {
        horseMounted = GetComponent <Horse_RidingBehavior> ();

        //get all equippable components on this GO, go through and assign them by id
        Equippable[] allEquippables = GetComponents <Equippable>();
        foreach (Equippable e in allEquippables)
        {
            switch (e.id)
            {
            case equippableItemID.HORSE_ON_LEAD:
                horseOnLeadEquippable = e;
                break;

            case equippableItemID.HORSE_MOUNTED:
                mountedHorseEquippable = e;
                break;
            }
        }
    }
예제 #3
0
 public void MountHorse(Horse_RidingBehavior mountedHorse)
 {
     currentMovementSet = playerMovementSet.RIDING;
     nearestHorse       = mountedHorse.horse;
 }