示例#1
0
    // Update is called once per frame
    void Update()
    {
        fireTimer = Mathf.Max(0.0f, fireTimer - Time.deltaTime);

        // プレイヤーの情報が何も入ってない場合
        if (Player == null)
        {
            GameplayChannel.GetInstance().SendRequestPlayerEvent();
            return;
        }

        //更新処理 Update.
        _flowAI.Update(Time.deltaTime);

        time += Time.deltaTime;

        bool canSeePlayer = UpdatePlayerLastKnownPosition();

        _visionCone.CreateVisionConeMesh();

        // 敵を見ているかの判定
        //if (_visionCone.IsTargetInVisionCone(gameObject, Player))
        if (CanSeePlayer())
        {
            _isFound = true;

            //Debug.Log("Can see target! 主人公を見ています!");
        }
        else
        {
            _isFound = false;

            //Debug.Log("Cannot see target! 主人公を見ていません!");
        }


        //Any process...
        if (_isRot)
        {
            //head.transform.Rotate(new Vector3(0,0, 60f * Time.deltaTime));
            this.transform.Rotate(new Vector3(0, 60f * Time.deltaTime));
            head.transform.Rotate(new Vector3(0, (((-1) * 60f) * Time.deltaTime)));
        }
        if (_isBullet)
        {
            Shoot();
        }

        canSeePlayerPrevious = canSeePlayer;

        TFDebug.ClearMonitor("enemy");
        TFDebug.Write("enemy", "isRot:{0}\n", _isRot.ToString());
        TFDebug.Write("enemy", "isFound:{0}\n", _isFound.ToString());
    }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        //更新処理 Update.
        _flowAI.Update(Time.deltaTime);


        //Any process...
        if (_isRot)
        {
            this.transform.Rotate(new Vector3(0f, 60f * Time.deltaTime));
        }

        TFDebug.ClearMonitor("enemy");
        TFDebug.Write("enemy", "isRot:{0}\n", _isRot.ToString());
        TFDebug.Write("enemy", "isFound:{0}\n", _isFound.ToString());
    }
示例#3
0
        /// <summary>チャンネル使用状況の更新</summary>
        public static void Checkout()
        {
            for (int f1 = 0; f1 < _capacity; f1++)
            {
                _channels[f1].used = _channels[f1].audioSrc.isPlaying;
            }

            int count     = _channels.Count(elem => elem.used);
            var usageKeys = _channels.Where(elem => elem.used);
            var keys      = usageKeys.ToArray();

            TFDebug.ClearMonitor("@sound");
            TFDebug.Write("@sound", string.Format("now using {0}/{1} channels\n", count.ToString(), _capacity.ToString()));
            for (int f1 = 0; f1 < keys.Count(); f1++)
            {
                TFDebug.Write("@sound", keys[f1].audioSrc.clip.name + "\n");
            }
        }
示例#4
0
        void Update()
        {
            TFDebug.ClearMonitor("visualizer");

            if (_isInSwapping)
            {
                _swappingElapsed += Time.unscaledDeltaTime;
                if (_swappingElapsed > _swappingDuration)
                {
                    _isInSwapping   = false;
                    _swappingFromId = -1;
                    _swappingToId   = -1;
                }
            }

            if (!_isInHacking)
            {
                _showElapsed += Time.deltaTime;
                if (_showElapsed > _showDuration)
                {
                    _isVisible = false;
                }
            }
        }