Пример #1
0
    void Start()
    {
        motor = GetComponent <CreatureMotor>();

        gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        maxJumpVelocity = Mathf.Abs(gravity * timeToJumpApex);
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
    }
Пример #2
0
    void Start()
    {
        creatureMotor = GetComponent <CreatureMotor>();

        creatureAI = GetComponent <CreatureAI>();

        behavior = creatureAI.creature.creatureBehavior;

        creatureHealth = creatureAI.creature.creatureHealth;
    }
Пример #3
0
    public void moveCreature()
    {
        if (InventoryController.instance.getEquippedCreature() != null)
        {
            CreatureMotor equippedCreature = InventoryController.instance.getEquippedCreature().GetComponent <CreatureMotor>();

            Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);

            RaycastHit hitPoint;

            if (Physics.Raycast(ray, out hitPoint))
            {
                equippedCreature.moveToPoint(hitPoint.point);
            }
        }
    }