Beispiel #1
0
    public bool isDodge;  // trapType2FireAttack을 피하기 위한것
    #endregion



    void Awake()
    {
        isDodge = false;
        HP      = maxHP;

        playerRectTransform = GetComponent <RectTransform>();
        playerRigid         = GetComponent <Rigidbody>();

        playerDodgeConScript  = GetComponent <playerDodgeCon>();
        playerAnimationScript = GetComponent <Player_Animation_Script>();
        playerAttackConScript = GetComponent <playerAttackCon>();
        playerSpConScript     = GetComponent <playerSpCon>();

        cam = FindObjectOfType <Camera>();

        PlayerUI   = PlayerUI.invenOff;
        state      = PlayerState.idle;
        mousePlace = MousePlace.top;

        stunParticleObj = transform.Find("paticlePos").gameObject;
        stunParticleObj.SetActive(false);

        instance = this;
        if (null == instance)
        {
            instance = this;
        }
    }
Beispiel #2
0
    public bool isDodge;  // trapType2FireAttack을 피하기 위한것
    #endregion


    private void Start()
    {
        if (SceneManager.GetActiveScene().name == "Tutorial_Scene_Ver2")
        {
            tutorialManagerVer2Script = GameObject.Find("TutorialManagerVer2").GetComponent <TutorialManagerVer2>();
        }

        playerColliderConScript = GetComponent <PlayerColliderCon>();
        rectTransform           = GetComponent <RectTransform>();
        rigid           = GetComponent <Rigidbody>();
        dodgeConScript  = GetComponent <PlayerDodgeCon>();
        animationScript = GetComponent <PlayerAniScript>();
        attackConScript = GetComponent <PlayerAttackCon>();
        spConScript     = GetComponent <PlayerSpCon>();
        cam             = FindObjectOfType <Camera>();

        isDodge = false;
        hP      = maxHP;

        playerHitted  = PlayerHitted.none;
        playerUIState = PlayerUI.invenOff;
        state         = PlayerState.idle;
        mousePlace    = MousePlace.top;

        instance = this;
        if (null == instance)
        {
            instance = this;
        }
    }
 private void Update()
 {
     if (Input.mousePresent && cachedEventData != null)
     {
         MousePlace pointPlacement = GetPointPlacement(Input.mousePosition, cachedEventData.enterEventCamera);
         SetActiveArrow(pointPlacement);
     }
 }
 private void SetActiveArrow(MousePlace place)
 {
     if (place == MousePlace.None)
     {
         leftArrow.canvasRenderer.SetColor(new Color(1f, 1f, 1f, 0.5f));
         rightArrow.canvasRenderer.SetColor(new Color(1f, 1f, 1f, 0.5f));
     }
     else
     {
         if (place == currentArrow)
         {
             return;
         }
         leftArrow.CrossFadeAlpha((place != MousePlace.Left) ? 0.5f : 1f, 0.1f, ignoreTimeScale: true);
         rightArrow.CrossFadeAlpha((place != MousePlace.Right) ? 0.5f : 1f, 0.1f, ignoreTimeScale: true);
     }
     currentArrow = place;
 }
Beispiel #5
0
    void checkRotationAndKeyDownToAniCon()

    {
        if (transform.rotation.y >= -0.4f && transform.rotation.y <= 0.4f)
        {
            mousePlace = MousePlace.top;
        }
        else if (transform.rotation.y >= 0.4f && transform.rotation.y <= 0.8f)
        {
            mousePlace = MousePlace.right;
        }
        else if ((transform.rotation.y >= 0.8f && transform.rotation.y <= 1f) || (transform.rotation.y < -0.8f && transform.rotation.y < -1f))
        {
            mousePlace = MousePlace.bot;
        }
        else if (transform.rotation.y <= 0f && transform.rotation.y >= -0.8f)
        {
            mousePlace = MousePlace.left;
        }
    }