コード例 #1
0
 private void Start()
 {
     selfHealth        = transform.root.GetComponent <HealthSinglePlayer>();
     currentHealth     = selfHealth.CurrentHealth();
     shootingRangeMode = ai.shootingRangeMode;
     ai.AddDetectionObject(this);
 }
コード例 #2
0
    private void Update()
    {
        if (shootingRangeMode)
        {
            return;
        }
        if (playerDetected)
        {
            detectionTimer = memoryTime;
            ai.SetPlayerPosition(playerPosition);
            ai.SetPlayerDetected(true);
        }
        else if (detectionTimer >= 0)
        {
            ai.SetPlayerPosition(playerPosition);
            ai.SetPlayerDetected(true);
        }
        else
        {
            ai.SetPlayerDetected(false);
        }


        currentHealth   = selfHealth.CurrentHealth();
        detectionTimer -= Time.deltaTime;
    }