Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Stop == true)
        {
            return;
        }

        // Debug.Log(animatorNpc.GetInteger("face"));

        RaycastMetode.dirSeeNpc(transform, dirfaceku, rangerSee, Layermask);
        DirFace();

        // detecte player
        if (RaycastMetode.lookDir.collider != null)
        {
            if (
                RaycastMetode.lookDir.collider.name == "personaje" &&
                PlayerScritp.pos == playerTransf.position &&
                npcMove.pos == transform.position

                )
            {
                EntraceBattle();
                Debug.Log("llegue  aqui ");
                NpcDialogueClass.MoveTowardsText(SpeedMoveText);
            }
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    /// <summary>
    ///
    /// </summary>
    void FixedUpdate()
    {
        if (stopDialogue)
        {
            return;
        }


        Raycast_Npc.RayColision(transform, Layermask);

        if (Raycast_Npc.hitdown.Length < 3)
        {
            Raycast_Npc.hitdown = new RaycastHit2D[3];
        }

        if (Raycast_Npc.hitleft.Length < 3)
        {
            Raycast_Npc.hitleft = new RaycastHit2D[3];
        }

        if (Raycast_Npc.hitup.Length < 3)
        {
            Raycast_Npc.hitup = new RaycastHit2D[3];
        }

        if (Raycast_Npc.hitright.Length < 3)
        {
            Raycast_Npc.hitright = new RaycastHit2D[3];
        }



        if (ActDialogue == true)
        {
            NpcDialogueClass.MoveTowardsText(SpeedMoveText);
        }



        DialogueText();

        DirFaceNum();
    }