コード例 #1
0
    /// <summary>
    /// 1. 실드 일정시간 활성화
    /// 2. 시간 끝나면 러시 반동 (이미 종료된 경우에는 호출 안함(navmesh로) : 아무것도 맞지 않은 경우 반동이 없음)
    /// </summary>
    /// <param name="time"></param>
    /// <returns></returns>
    IEnumerator ShieldOnOff(float time)
    {
        Debug.Log("들어갑니다 : " + time);
        // 1.
        AILiving entity = GetComponent <AILiving>();

        entity.bShield = true;
        yield return(new WaitUntil(() => isRush == false));

        entity.bShield = false;
        Debug.Log("종료됩니다");
        // 2.
        //if (!nav.enabled)
        //    RushRebound();
    }
コード例 #2
0
    bool[] skillCooltime;                  // 쿨타임 인지 (NO DB)

    /// <summary>
    /// 스킬 쿨타임초기화
    /// </summary>
    private void Start()
    {
        aiCon  = GetComponent <AIController>();
        living = GetComponent <AILiving>();

        // **AI에서 밖에 못씀
        skillInfo = aiCon.aiInfo.skill;

        skillCooltime = new bool[skillInfo.skillCount];

        //Debug.Log(skillCooltime.Length);

        GetComponent <AIController>().DieAction += () =>
        {
            for (int i = 0; i < skillInfo.skillCount; i++)
            {
                skillCooltime[i] = false;
            }
        };
    }
コード例 #3
0
ファイル: AIBaseState.cs プロジェクト: rwcel/DeadLegacy
    protected NetworkAISyncor networkAISyncor;              // 게스트

    void Awake()
    {
        aiCon               = GetComponent <AIController>();
        aiAnim              = transform.GetChild(0).GetComponent <AIAnim>();
        anim                = aiAnim.GetComponent <Animator>();
        living              = GetComponent <AILiving>();
        skillProcess        = GetComponent <SkillProcess>();
        cNetworkIdentity    = GetComponent <CNetworkIdentity>();
        networkAITransmitor = GetComponent <NetworkAITransmitor>();
        networkAISyncor     = GetComponent <NetworkAISyncor>();

        nav = GetComponent <NavMeshAgent>();
        col = GetComponent <CapsuleCollider>();
        rd  = GetComponent <Rigidbody>();

        SettingLayerMasks();
        DictionarySetting();

        // 죽으면 실행
        GetComponent <AIController>().DieAction += () => { isAction = false; isPatrolMove = false; };
    }
コード例 #4
0
    // 컴포넌트 불러오기
    private void Awake()
    {
        aiAggro             = GetComponent <AIAggro>();
        aiAnim              = transform.GetChild(0).GetComponent <AIAnim>();
        anim                = aiAnim.GetComponent <Animator>();
        baseState           = GetComponent <AIBaseState>();
        living              = GetComponent <AILiving>();
        skillProcess        = GetComponent <SkillProcess>();
        cNetworkIdentity    = GetComponent <CNetworkIdentity>();
        networkAITransmitor = GetComponent <NetworkAITransmitor>();
        networkAISyncor     = GetComponent <NetworkAISyncor>();

        nav  = GetComponent <NavMeshAgent>();
        path = nav.path;
        rd   = GetComponent <Rigidbody>();
        col  = GetComponent <CapsuleCollider>();

        SettingLayerMasks();

        // 애니메이션 똑같이 안보이게
        stateTickCount = UnityEngine.Random.Range(stateTickCount - 1, stateTickCount + 2);
        // stateCheckCooltime = UnityEngine.Random.Range(stateCheckCooltime - 0.1f, stateCheckCooltime + 0.1f);
    }
コード例 #5
0
    // obj 그대로 베끼기
    public void CopyAppearance(GameObject obj)
    {
        // 트랜스폼 조절
        transform.position   = obj.transform.position;
        transform.rotation   = obj.transform.rotation;
        transform.localScale = obj.transform.localScale;

        // 색상 조절
        AILiving _aiLiving = obj.GetComponent <AILiving>();

        for (int i = 0; i < renderObject.Length; i++)
        {
            // 켜져있는거라면 색상 조절하고 아니라면 안보이게
            if (_aiLiving.renderObject[i].gameObject.activeSelf)
            {
                renderObject[i].gameObject.SetActive(true);
                renderObject[i].material.color = _aiLiving.renderObject[i].material.color;
            }
            else
            {
                renderObject[i].gameObject.SetActive(false);
            }
        }
    }