コード例 #1
0
 internal override void ReportUndectOf(Sense origin, Collider other)
 {
     other.GetComponent<Renderer>()
         .material = new Material(Shader.Find("Diffuse"))
         {
             color = Color.white
         };
 }
コード例 #2
0
ファイル: Animal.cs プロジェクト: Miista/TerrainGeneration
 internal override void ReportDetectOf(Sense origin, Collider other)
 {
     if (origin is VisionSense)
     {
         var otherAiRig = AiRig.ExtractRigInfo(other);
         var isDangerous = this.AiRig.RankingSystem.GreaterThan(otherAiRig.RankingSystem);
         if (isDangerous) threats.Add(other);
         //else if (isDangerous) threats.Add(other);
         else prey.Add(other);
     }
     else if (origin is AudiatorySense)
     {
         //turn towards the sound
         //var dir = transform.position - other.transform.position;
         //_charController.transform.rotation.SetLookRotation(dir);
     }
 }
コード例 #3
0
        internal override void ReportDetectOf(Sense origin, Collider other)
        {
            Material m = null;
            if (origin is VisionSense)
            {
                m = AiRig.AudioSensor.Detected.Contains(other)
                    ? CanSeeAndHear
                    : CanSee;
            }
            else if (origin is AudiatorySense)
            {
                m = AiRig.VisionSensor.Detected.Contains(other)
                    ? CanSeeAndHear
                    : CanOnlyHear;
            }
            else if (origin is ScentSense)
                m = AiRig.VisionSensor.Detected.Contains(other)
                    ? CanSeeAndHear
                    : CanSmell;

            other.GetComponent<Renderer>()
                .material = m;
        }
コード例 #4
0
 internal abstract void ReportUndectOf(Sense origin, Collider other);
コード例 #5
0
ファイル: Animal.cs プロジェクト: Miista/TerrainGeneration
 internal override void ReportUndectOf(Sense origin, Collider other)
 {
     if (origin is VisionSense)
     {
         if (prey.Contains(other))
         {
             prey.Remove(other);
         }
     }
     else if (origin is AudiatorySense)
     {
         //Shouldnt react to not hearing anything
     }
 }
コード例 #6
0
 internal abstract void ReportDetectOf(Sense origin, Collider other);